]> git.sesse.net Git - ffmpeg/blobdiff - configure
remove STATS code (probably hasnt been used for years ..., and its not completely...
[ffmpeg] / configure
index 3b73f9ddc4b4a2a2d77ed043b14b58277c08510d..904c97fc6b6fccae7b9de7faee6bf56b663fd765 100755 (executable)
--- a/configure
+++ b/configure
@@ -3,6 +3,20 @@
 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
 #
 
+# make sure we are running under a compatible shell
+(: ${foo%%bar}) 2>/dev/null
+if test "$?" != 0; then
+    if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
+        FFMPEG_CONFIGURE_EXEC=1
+        export FFMPEG_CONFIGURE_EXEC
+        exec bash "$0" "$@"
+        exec ksh "$0" "$@"
+        exec /usr/xpg4/bin/sh "$0" "$@"
+    fi
+    echo "No compatible shell script interpreter found."
+    exit 1
+fi
+
 show_help(){
   echo "Usage: configure [options]"
   echo "Options: [defaults in brackets after descriptions]"
@@ -71,7 +85,6 @@ show_help(){
   echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
   echo "  --disable-network        disable network support [default=no]"
   echo "  --disable-zlib           disable zlib [default=no]"
-  echo "  --disable-lzo            disable lzo [default=no]"
   echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
   echo "  --disable-vhook          disable video hooking support"
   echo "  --enable-gprof           enable profiling with gprof [$gprof]"
@@ -102,7 +115,7 @@ log(){
     echo "$@" >>$logfile
 }
 
-logfile(){
+log_file(){
     log BEGIN $1
     cat -n $1 >>$logfile
     log END $1
@@ -120,7 +133,7 @@ If you think configure made a mistake, make sure you are using the latest
 version from SVN.  If the latest version fails, report the problem to the
 ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
 EOF
-    if enabled log; then
+    if enabled logging; then
         cat <<EOF
 Include the log file "$logfile" produced by configure as this will help
 solving the problem.
@@ -196,7 +209,7 @@ add_extralibs(){
 check_cc(){
     log check_cc "$@"
     cat >$TMPC
-    logfile $TMPC
+    log_file $TMPC
     log $cc $CFLAGS "$@" -c -o $TMPO $TMPC
     $cc $CFLAGS "$@" -c -o $TMPO $TMPC >>$logfile 2>&1
 }
@@ -204,7 +217,7 @@ check_cc(){
 check_cpp(){
     log check_cpp "$@"
     cat >$TMPC
-    logfile $TMPC
+    log_file $TMPC
     log $cc $CFLAGS "$@" -E -o $TMPO $TMPC
     $cc $CFLAGS "$@" -E -o $TMPO $TMPC >>$logfile 2>&1
 }
@@ -212,7 +225,7 @@ check_cpp(){
 check_ld(){
     log check_ld "$@"
     cat >$TMPC
-    logfile $TMPC
+    log_file $TMPC
     log $cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs
     $cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs >>$logfile 2>&1
 }
@@ -299,7 +312,7 @@ TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
 
 # default parameters
-log="yes"
+logging="yes"
 logfile="config.err"
 prefix="/usr/local"
 libdir=""
@@ -381,7 +394,6 @@ dv1394="yes"
 dc1394="no"
 network="yes"
 zlib="yes"
-lzo="yes"
 libgsm="no"
 mp3lame="no"
 libogg="no"
@@ -488,6 +500,7 @@ dv1394="no"
 make="gmake"
 FFLDFLAGS=""
 FFSLDFLAGS=""
+SHFLAGS="-shared -Wl,-h,\$@"
 need_inet_aton="yes"
 extralibs="$extralibs -lsocket -lnsl"
 ;;
@@ -650,7 +663,7 @@ for opt do
   case "$opt" in
   --log)
   ;;
-  --log=*) log="${opt#*=}"
+  --log=*) logging="${opt#*=}"
   ;;
   --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
   ;;
@@ -708,8 +721,6 @@ for opt do
   ;;
   --disable-zlib) zlib="no"
   ;;
-  --disable-lzo) lzo="no"
-  ;;
   --enable-a52) a52="yes"
   ;;
   --enable-a52bin) a52bin="yes"
@@ -818,8 +829,8 @@ for opt do
   esac
 done
 
-if test "$log" != no; then
-    test "$log" = yes || logfile="$log"
+if test "$logging" != no; then
+    test "$logging" = yes || logfile="$logging"
     echo "# $0 $@" >$logfile
     set >>$logfile
 else
@@ -1033,6 +1044,20 @@ if test $tune != "generic"; then
     esac
 fi
 
+# compiler sanity check
+check_exec <<EOF
+int main(){
+    return 0;
+}
+EOF
+if test "$?" != 0; then
+    echo "$cc is unable to create an executable file."
+    if test -z "$cross_prefix" -a "$cross_compile" = no; then
+        echo "If $cc is a cross-compiler, use the --cross-compile option."
+    fi
+    die "C compiler test failed."
+fi
+
 # check for SIMD availability
 
 # AltiVec flags: The FSF version of GCC differs from the Apple version
@@ -1183,7 +1208,6 @@ fi
 
 check_func localtime_r && localtime_r=yes || localtime_r=no
 enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
-enabled lzo && enabled gpl && check_lib lzo1x.h lzo_version -llzo || lzo="no"
 
 # check for some common methods of building with pthread support
 # do this before the optional library checks as some of them require pthreads
@@ -1404,9 +1428,9 @@ fi
 if test "$lshared" = "yes" ; then
     # LIBOBJFLAGS may have already been set in the OS configuration
     if test -z "$LIBOBJFLAGS" ; then
-        if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
-            LIBOBJFLAGS="\$(PIC)"
-        fi
+        case "$cpu" in
+            x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
+        esac
     fi
 fi
 
@@ -1453,7 +1477,6 @@ if test $cpu = "powerpc"; then
 fi
 echo "gprof enabled    $gprof"
 echo "zlib enabled     $zlib"
-echo "lzo enabled      $lzo"
 echo "libgsm enabled   $libgsm"
 echo "mp3lame enabled  $mp3lame"
 echo "libogg enabled   $libogg"
@@ -1709,12 +1732,16 @@ fi
 echo "EXTRALIBS=$extralibs" >> config.mak
 
 # If you do not want to use encoders, disable them.
-echo "#define CONFIG_ENCODERS 1" >> $TMPH
-echo "CONFIG_ENCODERS=yes" >> config.mak
+if echo "$CODEC_LIST" | grep -q encoder; then
+    echo "#define CONFIG_ENCODERS 1" >> $TMPH
+    echo "CONFIG_ENCODERS=yes" >> config.mak
+fi
 
 # If you do not want to use decoders, disable them.
-echo "#define CONFIG_DECODERS 1" >> $TMPH
-echo "CONFIG_DECODERS=yes" >> config.mak
+if echo "$CODEC_LIST" | grep -q decoder; then
+    echo "#define CONFIG_DECODERS 1" >> $TMPH
+    echo "CONFIG_DECODERS=yes" >> config.mak
+fi
 
 # muxers
 if test "$muxers" = "yes" ; then
@@ -1813,11 +1840,6 @@ if test "$zlib" = "yes" ; then
   echo "CONFIG_ZLIB=yes" >> config.mak
 fi
 
-if test "$lzo" = "yes" ; then
-  echo "#define CONFIG_LZO 1" >> $TMPH
-  echo "CONFIG_LZO=yes" >> config.mak
-fi
-
 if test "$libgsm" = "yes" ; then
   echo "#define CONFIG_LIBGSM 1" >> $TMPH
   echo "CONFIG_LIBGSM=yes" >> config.mak
@@ -1965,6 +1987,7 @@ echo "#define restrict $_restrict" >> $TMPH
 
 if test "$optimize" = "small"; then
   echo "#define always_inline"  >> $TMPH
+  echo "#define CONFIG_SMALL 1" >> $TMPH
 fi
 
 # build tree in object directory if source path is different from current one