]> git.sesse.net Git - ffmpeg/blobdiff - configure
Check for sys/mman.h and set appropriate definitions.
[ffmpeg] / configure
index 54d03d36d1f5dec1dceae6d69e6083bad38de080..46996db35b5a7b46ee2ca5540bbb4ca3332c440a 100755 (executable)
--- a/configure
+++ b/configure
@@ -699,6 +699,7 @@ ARCH_EXT_LIST='
     iwmmxt
     mmi
     mmx
+    mmx2
     ssse3
     vis
 '
@@ -753,6 +754,7 @@ HAVE_LIST="
     socklen_t
     soundcard_h
     poll_h
+    sys_mman_h
     sys_select_h
     sys_soundcard_h
     termios_h
@@ -780,6 +782,7 @@ armv6_deps="armv4l"
 iwmmxt_deps="armv4l"
 mmi_deps="mips"
 mmx_deps="x86"
+mmx2_deps="x86"
 ssse3_deps="x86"
 vis_deps="sparc"
 
@@ -888,6 +891,7 @@ bindir='$(PREFIX)/bin'
 # toolchain
 cc="gcc"
 ar="ar"
+nm="nm"
 ranlib="ranlib"
 make="make"
 strip="strip"
@@ -1085,7 +1089,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 -q -- -m32`"  ]; then
+            if ! echo $CFLAGS | grep -q -- -m32; then
                 arch="x86_64"
                 enable fast_64bit
             fi
@@ -1170,7 +1174,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 -q 'headers/be/bone'); then
+        if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
             network_extralibs="-lbind -lsocket"
         else
             enable beos_netserver
@@ -1315,6 +1319,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 +1377,7 @@ test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
 if test $targetos = darwin; then
-    if test -n "`$cc -v 2>&1 | grep -q 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 +1496,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 +1520,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
@@ -1586,6 +1598,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
@@ -1802,7 +1815,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 -q xlc`"; then
+    if $cc -v 2>&1 | grep -q xlc; then
         add_cflags  "-O5"
         add_ldflags "-O5"
     else
@@ -2070,6 +2083,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