]> git.sesse.net Git - ffmpeg/blobdiff - configure
MPEG-2 4:2:2 encoding support
[ffmpeg] / configure
index 0a9f867d13ae2477377bf59553fed6665e68b85d..f491f2aaa7f228fc7766eb3a287387e7a93e1cad 100755 (executable)
--- a/configure
+++ b/configure
@@ -228,14 +228,14 @@ vhook="default"
 dlfcn="no"
 dlopen="no"
 mpegaudio_hp="yes"
-SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)'
+SHFLAGS='-shared -Wl,-soname,$@'
 netserver="no"
 need_inet_aton="no"
 protocols="yes"
 ffserver="yes"
 ffplay="yes"
 LIBOBJFLAGS=""
-LDFLAGS=-Wl,--warn-common
+FFLDFLAGS=-Wl,--warn-common
 FFSLDFLAGS=-Wl,-E
 LDCONFIG="ldconfig"
 LIBPREF="lib"
@@ -265,7 +265,7 @@ case $targetos in
 BeOS)
 prefix="/boot/home/config"
 # helps building libavcodec
-CFLAGS="-DPIC -fomit-frame-pointer"
+CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer"
 # 3 gcc releases known for BeOS, each with ugly bugs
 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
 case "$gcc_version" in
@@ -299,7 +299,7 @@ v4l2="no"
 audio_oss="no"
 dv1394="no"
 make="gmake"
-LDFLAGS=""
+FFLDFLAGS=""
 FFSLDFLAGS=""
 need_inet_aton="yes"
 extralibs="$extralibs -lsocket -lnsl"
@@ -311,11 +311,8 @@ bktr="yes"
 audio_oss="yes"
 dv1394="no"
 make="gmake"
-LDFLAGS="$LDFLAGS -export-dynamic"
-case `uname -r` in
-2.*) extralibs="$extralibs -lossaudio"
-;;
-esac
+FFLDFLAGS="$FFLDFLAGS -export-dynamic"
+extralibs="$extralibs -lossaudio"
 ;;
 OpenBSD)
 v4l="no"
@@ -325,7 +322,7 @@ audio_oss="yes"
 dv1394="no"
 make="gmake"
 LIBOBJFLAGS="\$(PIC)"
-LDFLAGS="$LDFLAGS -export-dynamic -pthread"
+FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
 LDCONFIG="ldconfig -m \$(libdir)"
 extralibs="$extralibs -lossaudio"
 ;;
@@ -336,8 +333,8 @@ bktr="yes"
 audio_oss="yes"
 dv1394="no"
 make="gmake"
-CFLAGS="-pthread"
-LDFLAGS="$LDFLAGS -export-dynamic -pthread"
+CFLAGS="$CFLAGS -pthread"
+FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
 ;;
 BSD/OS)
 v4l="no"
@@ -356,13 +353,12 @@ v4l="no"
 v4l2="no"
 audio_oss="no"
 dv1394="no"
-ffserver="no"
 SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
 extralibs=""
 darwin="yes"
 strip="strip -x"
 installstrip=""
-LDFLAGS="-Wl,-dynamic,-search_paths_first"
+FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
 SLIBSUF=".dylib"
 SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
@@ -384,7 +380,7 @@ cygwin="yes"
 EXESUF=".exe"
 ;;
 Linux)
-LDFLAGS="$LDFLAGS -rdynamic"
+FFLDFLAGS="$FFLDFLAGS -rdynamic -Wl,--as-needed -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil"
 ;;
 IRIX*)
 ranlib="echo ignoring ranlib"
@@ -398,8 +394,8 @@ TMPE=$TMPE".exe"
 ar="emxomfar -p128"
 ranlib="echo ignoring ranlib"
 strip="echo ignoring strip"
-CFLAGS="-Zomf"
-LDFLAGS="-Zomf -Zstack 16384 -s"
+CFLAGS="$CFLAGS -Zomf"
+FFLDFLAGS="-Zomf -Zstack 16384 -s"
 SHFLAGS="-Zdll -Zomf"
 FFSLDFLAGS=""
 LIBPREF=""
@@ -479,7 +475,7 @@ for opt do
   ;;
   --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
   ;;
-  --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
+  --extra-ldflags=*) FFLDFLAGS="$FFLDFLAGS ${opt#--extra-ldflags=}"
   ;;
   --extra-libs=*) extralibs=${opt#--extra-libs=}
   ;;
@@ -592,13 +588,13 @@ for opt do
   ;;
   --enable-small) optimize="small"
   ;;
-  --enable-amr_nb) amr_nb="yes"
+  --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
   ;;
-  --enable-amr_nb-fixed) amr_nb_fixed="yes"
+  --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
   ;;
-  --enable-amr_wb) amr_wb="yes"
+  --enable-amr_wb) amr="yes"; amr_wb="yes"
   ;;
-  --enable-amr_if2) amr_if2="yes"
+  --enable-amr_if2) amr="yes"; amr_if2="yes"
   ;;
   --enable-sunmlib) sunmlib="yes"
   ;;
@@ -634,6 +630,10 @@ for opt do
   esac
 done
 
+
+# Combine FFLDFLAGS and the LDFLAGS environment variable
+LDFLAGS="$FFLDFLAGS $LDFLAGS"
+
 # we need to build at least one lib type
 if test "$lstatic" = "no" && test "$lshared" = "no" ; then
     cat <<EOF
@@ -912,7 +912,7 @@ if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
 You can only build one library type at once on MinGW.
 Specify --disable-static --enable-shared to only build
 the shared libraries. To build only the static libraries
-you don't need to pass additional options.
+you do not need to pass additional options.
 EOF
         exit 1
     fi
@@ -1074,7 +1074,7 @@ int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
 EOF
 
 have_lrintf="no"
-if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
+if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC $extralibs 2> /dev/null ; then
   have_lrintf="yes"
   # allanc@chickenandporn.com: cannot execute cross-compiled
   # code on the host.  Only execute if not cross-compiling.
@@ -1114,12 +1114,19 @@ fi
 cat > $TMPC << EOF
 #include <mm3dnow.h>
 int main(void) {
+__m64 b1;
+b1 = _m_pswapd(b1);
+_m_femms();
 return 0;
 }
 EOF
 
 mm3dnow=no
-if $cc -march=athlon -o $TMPO $TMPC 2> /dev/null ; then
+march=athlon
+if test "$cpu" = "x86_64"; then
+  march=k8
+fi
+if $cc -march=$march -o $TMPO $TMPC 2> /dev/null ; then
   mm3dnow=yes
 fi
 
@@ -1218,9 +1225,10 @@ EOF
 
 sdl_too_old=no
 sdl=no
-if (sdl-config --version) >/dev/null 2>&1 ; then
-if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
-_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
+SDL_CONFIG="${cross_prefix}sdl-config"
+if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
+if $cc -o $TMPE `"${SDL_CONFIG}" --cflags` $TMPC `"${SDL_CONFIG}" --libs`  > /dev/null 2>&1  ; then
+_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
 if test "$_sdlversion" -lt 121 ; then
 sdl_too_old=yes
 else
@@ -1267,6 +1275,7 @@ cat > $TMPC << EOF
 #include <sys/time.h>
 #include <linux/videodev.h>
 int dummy = V4L2_PIX_FMT_YUV420;
+struct v4l2_buffer dummy1;
 EOF
 $cc -c -o $TMPE $TMPC 2> /dev/null || v4l2="no"
 fi
@@ -1573,8 +1582,8 @@ if test "$pthreads" = "yes" ; then
 fi
 if test "$sdl" = "yes" ; then
   echo "CONFIG_SDL=yes" >> config.mak
-  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
-  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
+  echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
+  echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
 fi
 if test "$texi2html" = "yes"; then
   echo "BUILD_DOC=yes" >> config.mak
@@ -1912,6 +1921,11 @@ fi
 echo "SRC_PATH=$source_path" >> config.mak
 echo "BUILD_ROOT=$PWD" >> config.mak
 
+if test "$amr" = "yes" ; then
+  echo "#define AMR 1" >> $TMPH
+  echo "AMR=yes" >> config.mak
+fi
+
 if test "$amr_wb" = "yes" ; then
   echo "#define AMR_WB 1" >> $TMPH
   echo "AMR_WB=yes" >> config.mak
@@ -1920,37 +1934,35 @@ if test "$amr_wb" = "yes" ; then
   echo "V5.1.0 from "
   echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
   echo "and extracted the source to libavcodec/amrwb_float"
-  echo
 fi
 
 if test "$amr_nb" = "yes" ; then
   echo "#define AMR_NB 1" >> $TMPH
   echo "AMR_NB=yes" >> config.mak
   echo
+  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
+  echo "REL-5 V5.1.0 from "
+  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
+  echo "and extracted the source to libavcodec/amr_float"
+  echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
+fi
+
 if test "$amr_nb_fixed" = "yes" ; then
-  echo "AMR_NB_FIXED=yes" >> config.mak
   echo "#define AMR_NB_FIXED 1" >> $TMPH
+  echo "AMR_NB_FIXED=yes" >> config.mak
+  echo
   echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
   echo "REL-5 version 5.1.0 from "
   echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
   echo "and extracted src to libavcodec/amr"
   echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
   echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
-  echo
-else
-  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
-  echo "REL-5 V5.1.0 from "
-  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
-  echo "and extracted the source to libavcodec/amr_float"
-  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
-  echo
 fi
 
 if test "$amr_if2" = "yes" ; then
   echo "AMR_CFLAGS=-DIF2=1" >> config.mak
 fi
 
-fi
 
 for codec in $CODEC_LIST ; do
     echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH