]> git.sesse.net Git - ffmpeg/blobdiff - configure
Add OS-specific executable suffix to temporary executable name.
[ffmpeg] / configure
index c0116c1e68b476b3c2e9f90e6867d856edb098ed..7e80f1f4ebed2d17a0c9e1298688fbd04a7b7440 100755 (executable)
--- a/configure
+++ b/configure
@@ -60,7 +60,7 @@ show_help(){
   echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
   echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
   echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
-  echo "  --incdir=DIR             install includes in DIR [PREFIX/include/ffmpeg]"
+  echo "  --incdir=DIR             install includes in DIR [PREFIX/include]"
   echo "  --mandir=DIR             install man page in DIR [PREFIX/share/man]"
   echo "  --enable-static          build static libraries [default=yes]"
   echo "  --disable-static         do not build static libraries [default=no]"
@@ -120,6 +120,8 @@ show_help(){
   echo "  --enable-powerpc-perf    enable performance report on PPC"
   echo "                           (requires enabling PMC)"
   echo "  --disable-mmx            disable MMX usage"
+  echo "  --disable-mmx2           disable MMX2 usage"
+  echo "  --disable-ssse3          disable SSSE3 usage"
   echo "  --disable-armv5te        disable armv5te usage"
   echo "  --disable-armv6          disable armv6 usage"
   echo "  --disable-iwmmxt         disable iwmmxt usage"
@@ -699,6 +701,7 @@ ARCH_EXT_LIST='
     iwmmxt
     mmi
     mmx
+    mmx2
     ssse3
     vis
 '
@@ -745,6 +748,7 @@ HAVE_LIST="
     memalign
     mkstemp
     mlib
+    pld
     ppc64
     round
     roundf
@@ -753,6 +757,7 @@ HAVE_LIST="
     socklen_t
     soundcard_h
     poll_h
+    sys_mman_h
     sys_select_h
     sys_soundcard_h
     termios_h
@@ -780,6 +785,7 @@ armv6_deps="armv4l"
 iwmmxt_deps="armv4l"
 mmi_deps="mips"
 mmx_deps="x86"
+mmx2_deps="x86"
 ssse3_deps="x86"
 vis_deps="sparc"
 
@@ -857,21 +863,6 @@ ffserver_extralibs='$ldl'
 vhook_extralibs='$ldl'
 
 
-# set temporary file name
-if test ! -z "$TMPDIR" ; then
-    TMPDIR1="${TMPDIR}"
-elif test ! -z "$TEMPDIR" ; then
-    TMPDIR1="${TEMPDIR}"
-else
-    TMPDIR1="/tmp"
-fi
-
-TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
-TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
-TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
-TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
-TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
-
 # default parameters
 
 enable logging
@@ -888,6 +879,7 @@ bindir='$(PREFIX)/bin'
 # toolchain
 cc="gcc"
 ar="ar"
+nm="nm"
 ranlib="ranlib"
 make="make"
 strip="strip"
@@ -935,8 +927,8 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 # gcc stupidly only outputs the basename of targets with -MM
-DEPEND_CMD='$(CC) -MM $(CFLAGS) $(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9]*/\).*,\1&,"'
-VHOOKDEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\1,"'
+DEPEND_CMD='$(CC) -MM $(CFLAGS) $(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \($(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"'
+VHOOK_DEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\\1,"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -1085,7 +1077,7 @@ case "$arch" in
         enable fast_unaligned
         canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
         if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
-            if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
+            if ! echo $CFLAGS | grep -q -- -m32; then
                 arch="x86_64"
                 enable fast_64bit
             fi
@@ -1170,7 +1162,7 @@ case $targetos in
         # no need for libm, but the inet stuff
         # Check for BONE
         # XXX: actually should check for NOT net_server
-        if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
+        if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
             network_extralibs="-lbind -lsocket"
         else
             enable beos_netserver
@@ -1264,16 +1256,13 @@ case $targetos in
         ranlib="echo ignoring ranlib"
         ;;
     os/2*)
-        ar="emxomfar -p256"
-        ranlib="echo ignoring ranlib"
         strip="lxlite"
         ln_s="cp -f"
-        add_cflags "-Zomf"
         EXESUF=".exe"
         FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
         SHFLAGS='$(NAME).def -Zdll -Zomf'
         FFSERVERLDFLAGS=""
-        LIBSUF="_s.lib"
+        LIBSUF="_s.a"
         SLIBPREF=""
         SLIBSUF=".dll"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
@@ -1299,6 +1288,22 @@ case $targetos in
         ;;
 esac
 
+# set temporary file name
+if test ! -z "$TMPDIR" ; then
+    TMPDIR1="${TMPDIR}"
+elif test ! -z "$TEMPDIR" ; then
+    TMPDIR1="${TEMPDIR}"
+else
+    TMPDIR1="/tmp"
+fi
+
+TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
+TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
+TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
+TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
+
+
 add_extralibs $osextralibs
 
 if ! disabled logging ; then
@@ -1315,6 +1320,7 @@ LDFLAGS="$FFLDFLAGS $LDFLAGS"
 test -n "$cross_prefix" && enable cross_compile
 cc="${cross_prefix}${cc}"
 ar="${cross_prefix}${ar}"
+nm="${cross_prefix}${nm}"
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
@@ -1372,7 +1378,7 @@ test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
 if test $targetos = darwin; then
-    if test -n "`$cc -v 2>&1 | grep xlc`"; then
+    if $cc -v 2>&1 | grep -q xlc; then
         add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
     else
         add_cflags "-pipe"
@@ -1491,6 +1497,12 @@ if test "$?" != 0; then
     die "C compiler test failed."
 fi
 
+check_cc <<EOF || die "Symbol mangling check failed."
+int ff_extern;
+EOF
+sym=$($nm -P -g $TMPO)
+extern_prefix=${sym%%ff_extern*}
+
 check_asm inline_asm '""'
 
 if enabled x86; then
@@ -1509,8 +1521,9 @@ EOF
     # check wether EBX is available on x86
     check_asm ebx_available '"":::"%ebx"'
 
-    # check whether binutils is new enough to compile SSSE3
+    # check whether binutils is new enough to compile SSSE3/MMX2
     enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
+    enabled mmx2  && check_asm mmx2  '"movss %xmm0, %xmm0"'
 
     check_asm bswap '"bswap %%eax" ::: "%eax"'
 fi
@@ -1532,13 +1545,9 @@ fi
 
 # AltiVec flags: The FSF version of GCC differs from the Apple version
 if enabled altivec; then
-    if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
-        add_cflags "-faltivec"
-    else
-        add_cflags "-maltivec -mabi=altivec"
-    fi
-
-    check_header altivec.h
+    check_cflags -maltivec -mabi=altivec &&
+        check_header altivec.h ||
+        check_cflags -faltivec
 
     # check if our compiler supports Motorola AltiVec C API
     enabled altivec_h &&
@@ -1554,6 +1563,8 @@ int main(void) {
 EOF
 fi
 
+# We have to check if pld is a nop and disable it.
+enabled armv4l  && check_asm pld     '"pld [r0]"'
 enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
 enabled armv6   && check_asm armv6   '"sadd16 r0, r0, r0"'
 enabled iwmmxt  && check_asm iwmmxt  '"wunpckelub wr6, wr4"'
@@ -1590,6 +1601,7 @@ check_header byteswap.h
 check_header conio.h
 check_header dlfcn.h
 check_header malloc.h
+check_header sys/mman.h
 check_header termios.h
 
 if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
@@ -1806,7 +1818,7 @@ if enabled small; then
     check_cflags -Os            # not all compilers support -Os
     optimizations="small"
 elif enabled optimizations; then
-    if test -n "`$cc -v 2>&1 | grep xlc`"; then
+    if $cc -v 2>&1 | grep -q xlc; then
         add_cflags  "-O5"
         add_ldflags "-O5"
     else
@@ -1998,7 +2010,7 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=$SLIBSUF" >> config.mak
 echo "EXESUF=$EXESUF" >> config.mak
 echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
-echo "VHOOKDEPEND_CMD=$VHOOKDEPEND_CMD" >> config.mak
+echo "VHOOK_DEPEND_CMD=$VHOOK_DEPEND_CMD" >> config.mak
 
 if enabled bigendian; then
     echo "WORDS_BIGENDIAN=yes" >> config.mak
@@ -2074,6 +2086,7 @@ enabled asmalign_pot &&
     printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
     printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
 
+echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
 
 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH