[Ffmpeg-devel] bash substitutions

Jacob Meuser jakemsr
Sun Dec 18 00:28:30 CET 2005


revision 1.217 of configure added some shell substitutions.
these apparently only work with bash, which is _not_ the /bin/sh
on all systems.

specifically:

  echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
  echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
  echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
  echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak

this not work with pdksh, which is the /bin/sh on OpenBSD.
I doubt it works with ash, which is the /bin/sh on NetBSD.

I suggest the following patch.

-- 
<jakemsr at jakemsr.com>

--- configure.orig	Sat Dec 17 15:00:08 2005
+++ configure	Sat Dec 17 15:26:44 2005
@@ -1457,13 +1457,13 @@ lavu_version=`grep '#define LIBAVUTIL_VE
 if test "$lshared" = "yes" ; then
   echo "BUILD_SHARED=yes" >> config.mak
   echo "PIC=-fPIC -DPIC" >> config.mak
-  echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
+  echo "SPPMAJOR=$(echo $lavc_version | sed 's/\..*//')" >> config.mak
   echo "SPPVERSION=$lavc_version" >> config.mak
-  echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
+  echo "LAVCMAJOR=$(echo $lavc_version | sed 's/\..*//')" >> config.mak
   echo "LAVCVERSION=$lavc_version" >> config.mak
-  echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
+  echo "LAVFMAJOR=$(echo $lavf_version | sed 's/\..*//')" >> config.mak
   echo "LAVFVERSION=$lavf_version" >> config.mak
-  echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak
+  echo "LAVUMAJOR=$(echo $lavu_version | sed s'/\..*//')" >> config.mak
   echo "LAVUVERSION=$lavu_version" >> config.mak
 fi
 echo "EXTRALIBS=$extralibs" >> config.mak





More information about the ffmpeg-devel mailing list