]> granicus.if.org Git - libx264/commitdiff
ARM configure: enable NEON-related options by default
authorDavid Conrad <lessen42@gmail.com>
Tue, 25 Aug 2009 00:17:41 +0000 (17:17 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 25 Aug 2009 03:49:43 +0000 (20:49 -0700)
When compiling for ARM, x264 will compile by default for Cortex A8 unless specified otherwise.
To compile for pre-ARMv6, --disable-asm is required.

configure

index a4af82ad88822c50a56b04caf532c3abf17604f6..ac07a01a670b6be63fe3a50bd3c7897b8380103e 100755 (executable)
--- a/configure
+++ b/configure
@@ -326,12 +326,17 @@ if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
 fi
 
 if [ $asm = yes -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"
+
     if  cc_check '' '' 'asm("rev r0, r0");' ; then      CFLAGS="$CFLAGS -DHAVE_ARMV6"
         cc_check '' '' 'asm("movt r0, #0");'         && CFLAGS="$CFLAGS -DHAVE_ARMV6T2"
         cc_check '' '' 'asm("vadd.i16 q0, q0, q0");' && CFLAGS="$CFLAGS -DHAVE_NEON"
         ASFLAGS="$ASFLAGS $CFLAGS -c"
     else
-        asm="no"
+        echo "You specified a pre-ARMv6 CPU in your CFLAGS."
+        echo "If you really want to run on such a CPU, configure with --disable-asm."
+        exit 1
     fi
 fi