]> git.sesse.net Git - x264/blobdiff - configure
Faster deblocking
[x264] / configure
index d1fa2222729cd0e29d70d701522471d2faec137a..adb2748400b554aee57649a95a8ab56a4589e40f 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,10 +7,11 @@ echo ""
 echo "available options:"
 echo ""
 echo "  --help                   print this message"
-echo "  --enable-avis-input      enables avisynth input (win32 only)"
-echo "  --enable-mp4-output      enables mp4 output (using gpac)"
+echo "  --disable-avis-input     disables avisynth input (win32 only)"
+echo "  --disable-mp4-output     disables mp4 output (using gpac)"
+echo "  --disable-pthread        disables multithreaded encoding"
+echo "  --disable-asm            disables assembly optimizations on x86"
 echo "  --enable-gtk             build GTK+ interface"
-echo "  --enable-pthread         enables multithreaded encoding"
 echo "  --enable-debug           adds -g, doesn't strip"
 echo "  --enable-gprof           adds -pg, doesn't strip"
 echo "  --enable-visualize       enables visualization (X11 only)"
@@ -53,6 +54,7 @@ DEVNULL='/dev/null'
 avis_input="auto"
 mp4_output="auto"
 pthread="auto"
+asm="yes"
 debug="no"
 gprof="no"
 pic="no"
@@ -102,6 +104,12 @@ for opt do
         --includedir=*)
             includedir="$optarg"
             ;;
+        --enable-asm)
+            asm="yes"
+            ;;
+        --disable-asm)
+            asm="no"
+            ;;
         --enable-avis-input)
             avis_input="yes"
             ;;
@@ -241,8 +249,6 @@ case $host_cpu in
       ASFLAGS="$ASFLAGS -f macho -DPREFIX"
     elif [ "$SYS" = MINGW ]; then
       ASFLAGS="$ASFLAGS -f win32 -DPREFIX"
-    elif [ "$SYS" = NETBSD ]; then
-      ASFLAGS="$ASFLAGS -f aoutb"
     else
       ASFLAGS="$ASFLAGS -f elf"
     fi
@@ -252,7 +258,7 @@ case $host_cpu in
     ARCH="X86_64"
     AS="yasm"
     if [ "$SYS" = MACOSX ];then
-      ASFLAGS="-f macho64 -m amd64 -D__PIC__ -DPREFIX"
+      ASFLAGS="-f macho64 -m amd64 -DPIC -DPREFIX"
       CFLAGS="$CFLAGS -arch x86_64"
       LDFLAGS="$LDFLAGS -arch x86_64"
     else
@@ -302,36 +308,21 @@ if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" \)
     pic="yes"
 fi
 
-if [ $SYS = MACOSX -a $ARCH = X86 ]
-then
-  # we want Apple's nasm from Xcode 2.4.1 or later
-  NASM_BUILD_REQUIRED=11
-  NASM_BUILD=`nasm -v|grep "Apple Computer"|sed 's/.*build \([0-9]*\).*/\1/'`
-  if [ $NASM_BUILD -lt $NASM_BUILD_REQUIRED ]
-  then
-    echo "Your version of 'nasm' is too old."
-    echo "Please install Xcode 2.4.1 or later."
-    AS=""
-  fi
-fi
-
-if [ $ARCH = X86 -o $ARCH = X86_64 ] ; then
+if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
     if [ $ARCH = X86 -a $pic = yes -a x$AS = xyasm -a\
-         "`yasm --version | head -n 1`" "<" "yasm 0.6.2" ] ; then
+         "`yasm --version 2>$DEVNULL | head -n 1`" "<" "yasm 0.6.2" ] ; then
          echo "yasm prior to 0.6.2 miscompiles PIC. trying nasm instead..."
          AS=nasm
     fi
-    if as_check ; then
+    if as_check "pabsw xmm0, xmm0" ; then
         CFLAGS="$CFLAGS -DHAVE_MMX"
-        if as_check "pabsw xmm0, xmm0" ; then
-            ASFLAGS="$ASFLAGS -DHAVE_SSE3"
-            CFLAGS="$CFLAGS -DHAVE_SSE3"
-        fi
     else
-        echo "No suitable assembler found.  x264 will be several times slower."
-        echo "Please install 'yasm' to get MMX/SSE optimized code."
-        AS=""
+        echo "No suitable assembler found.  Install 'yasm' to get MMX/SSE optimized code."
+        echo "If you really want to compile without asm, configure with --disable-asm."
+        exit 1
     fi
+else
+    AS=""
 fi
 
 CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
@@ -399,7 +390,7 @@ fi
 
 if [ "$pic" = "yes" ] ; then
     CFLAGS="$CFLAGS -fPIC"
-    ASFLAGS="$ASFLAGS -D__PIC__"
+    ASFLAGS="$ASFLAGS -DPIC"
     # resolve textrels in the x86 asm
     cc_check stdio.h -Wl,-Bsymbolic && LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
 fi
@@ -463,9 +454,12 @@ if [ "$shared" = "yes" ]; then
         echo "SONAME=libx264-$API.dll" >> config.mak
         echo 'IMPLIBNAME=libx264.dll.a' >> config.mak
         echo 'SOFLAGS=-Wl,--out-implib,$(IMPLIBNAME) -Wl,--enable-auto-image-base' >> config.mak
+    elif [ "$SYS" = "MACOSX" ]; then
+        echo "SONAME=libx264.$API.dylib" >> config.mak
+        echo 'SOFLAGS=-dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress' >> config.mak        
     else
         echo "SONAME=libx264.so.$API" >> config.mak
-        echo 'SOFLAGS=-Wl,soname,$(SONAME)' >> config.mak
+        echo 'SOFLAGS=-Wl,-soname,$(SONAME)' >> config.mak
     fi
     echo 'default: $(SONAME)' >> config.mak
     if [ "$gtk" = "yes" ]; then
@@ -498,6 +492,7 @@ EOF
 
 echo "Platform:   $ARCH"
 echo "System:     $SYS"
+echo "asm:        $asm"
 echo "avis input: $avis_input"
 echo "mp4 output: $mp4_output"
 echo "pthread:    $pthread"