]> git.sesse.net Git - x264/blobdiff - configure
Overhaul CABAC: faster, less cache usage
[x264] / configure
index 25f54588da123e373e7d7b9cdb382e6b59427b23..d02d2d417fea94ce09645f5ac986e0ed2a48551a 100755 (executable)
--- a/configure
+++ b/configure
@@ -12,7 +12,7 @@ echo "  --disable-lavf-input     disables libavformat input"
 echo "  --disable-ffms-input     disables ffmpegsource input"
 echo "  --disable-mp4-output     disables mp4 output (using gpac)"
 echo "  --disable-pthread        disables multithreaded encoding"
-echo "  --disable-asm            disables assembly optimizations on x86 and arm"
+echo "  --disable-asm            disables platform-specific assembly optimizations"
 echo "  --enable-debug           adds -g, doesn't strip"
 echo "  --enable-gprof           adds -pg, doesn't strip"
 echo "  --enable-visualize       enables visualization (X11 only)"
@@ -118,7 +118,7 @@ lavf_input="auto"
 ffms_input="auto"
 mp4_output="auto"
 pthread="auto"
-asm="yes"
+asm="auto"
 debug="no"
 gprof="no"
 pic="no"
@@ -154,33 +154,18 @@ for opt do
         --includedir=*)
             includedir="$optarg"
             ;;
-        --enable-asm)
-            asm="yes"
-            ;;
         --disable-asm)
             asm="no"
             ;;
-        --enable-avs-input)
-            avs_input="auto"
-            ;;
         --disable-avs-input)
             avs_input="no"
             ;;
-        --enable-lavf-input)
-            lavf_input="auto"
-            ;;
         --disable-lavf-input)
             lavf_input="no"
             ;;
-        --enable-ffms-input)
-            ffms_input="auto"
-            ;;
         --disable-ffms-input)
             ffms_input="no"
             ;;
-        --enable-mp4-output)
-            mp4_output="yes"
-            ;;
         --disable-mp4-output)
             mp4_output="no"
             ;;
@@ -193,9 +178,6 @@ for opt do
         --extra-ldflags=*)
             LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
             ;;
-        --enable-pthread)
-            pthread="auto" # can't skip detection, since it differs by OS
-            ;;
         --disable-pthread)
             pthread="no"
             ;;
@@ -214,8 +196,6 @@ for opt do
             shared="yes"
             ;;
         --enable-visualize)
-            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
-            define HAVE_VISUALIZE
             vis="yes"
             ;;
         --host=*)
@@ -348,20 +328,23 @@ case $host_cpu in
     ;;
   powerpc|powerpc64)
     ARCH="PPC"
-    if [ $SYS = MACOSX ]
-    then
-      CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
-    else
-      CFLAGS="$CFLAGS -maltivec -mabi=altivec"
-      define HAVE_ALTIVEC_H
+    if [ $asm = yes ] ; then
+      define HAVE_ALTIVEC
+      AS="${AS-${cross_prefix}gcc}"
+      if [ $SYS = MACOSX ] ; then
+        CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
+      else
+        CFLAGS="$CFLAGS -maltivec -mabi=altivec"
+        define HAVE_ALTIVEC_H
+      fi
     fi
     ;;
   sparc)
-    if test "$(uname -m)" = "sun4u"; then
+    if [ $asm = yes ] && test "$(uname -m)" = "sun4u"; then
       ARCH="UltraSparc"
       CFLAGS="$CFLAGS -mcpu=ultrasparc"
       LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
-      AS="${cross_prefix}as"
+      AS="${AS-${cross_prefix}as}"
       ASFLAGS="$ASFLAGS -xarch=v8plusa"
     else
       ARCH="Sparc"
@@ -390,6 +373,9 @@ case $host_cpu in
   parisc|parisc64)
     ARCH="PARISC"
     ;;
+  ia64)
+    ARCH="IA64"
+    ;;
   *)
     ARCH="$(echo $host_cpu | tr a-z A-Z)"
     ;;
@@ -415,11 +401,11 @@ elif cc_check '' -std=c99 ; then
     CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE"
 fi
 
-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" \) ] ; then
+if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" \) ] ; then
     pic="yes"
 fi
 
-if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
     if ! as_check "lzcnt eax, eax" ; then
         VER=`($AS --version || echo no assembler) 2>$DEVNULL | head -n 1`
         echo "Found $VER"
@@ -438,7 +424,7 @@ if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
     define HAVE_MMX
 fi
 
-if [ $asm = yes -a $ARCH = ARM ] ; then
+if [ $asm = auto -a $ARCH = ARM ] ; then
     # set flags so neon is built by default
     echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-mfloat-abi)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
 
@@ -454,7 +440,7 @@ if [ $asm = yes -a $ARCH = ARM ] ; then
 fi
 
 [ $asm = no ] && AS=""
-[ "x$AS" = x ] && asm="no"
+[ "x$AS" = x ] && asm="no" || asm="yes"
 
 define ARCH_$ARCH
 define SYS_$SYS
@@ -510,6 +496,13 @@ if cc_check "math.h" "-Werror" "return log2f(2);" ; then
     define HAVE_LOG2F
 fi
 
+if [ "$vis" = "yes" ] && cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay( 0 );" ; then
+    LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
+    define HAVE_VISUALIZE
+else
+    vis="no"
+fi
+
 if [ "$lavf_input" = "auto" ] ; then
     lavf_input="no"
     if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>$DEVNULL; then
@@ -543,7 +536,7 @@ if [ "$ffms_input" = "auto" ] ; then
     [ $ffms_bump -gt 0 ] && vbump=".$ffms_bump"
     if ${cross_prefix}pkg-config --atleast-version="$ffms_major.$ffms_minor$vmicro$vbump" ffms2 2>$DEVNULL; then
         FFMS2_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)"
-        FFMS2_CFLAGS="$FFMS2_LIBS $(${cross_prefix}pkg-config --cflags ffms2)"
+        FFMS2_CFLAGS="$FFMS2_CFLAGS $(${cross_prefix}pkg-config --cflags ffms2)"
         api_check="no"
     else
         api_check="yes"
@@ -584,10 +577,19 @@ if [ $SYS = MINGW ]; then
 fi
 if [ "$mp4_output" = "auto" ] ; then
     mp4_output="no"
-    cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes"
+    if cc_check gpac/isomedia.h "$MP4_LDFLAGS" ; then
+        if cc_check gpac/isomedia.h "$MP4_LDFLAGS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
+            mp4_output="yes"
+        else
+            echo "Warning: gpac is too old, update to 2007-06-21 UTC or later"
+        fi
+    fi
 fi
 if [ "$mp4_output" = "yes" ] ; then
     define MP4_OUTPUT
+    if cc_check gpac/isomedia.h "-Werror $MP4_LDFLAGS" "gf_malloc(1); gf_free(NULL);" ; then
+        define HAVE_GF_MALLOC
+    fi
     LDFLAGSCLI="$LDFLAGSCLI $MP4_LDFLAGS"
 fi