configure: split $cpu handling by arch
authorMåns Rullgård <mans@mansr.com>
Mon, 18 Jan 2010 21:05:05 +0000 (21:05 +0000)
committerMåns Rullgård <mans@mansr.com>
Mon, 18 Jan 2010 21:05:05 +0000 (21:05 +0000)
Originally committed as revision 21296 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure

index 62f9bf2..0221b95 100755 (executable)
--- a/configure
+++ b/configure
@@ -1812,8 +1812,11 @@ case "$arch" in
 esac
 
 is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch"
 esac
 
 is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch"
+enable $arch
 
 # Add processor-specific flags
 
 # Add processor-specific flags
+if enabled ppc; then
+
 case $cpu in
     601|ppc601|PowerPC601)
         cpuflags="-mcpu=601"
 case $cpu in
     601|ppc601|PowerPC601)
         cpuflags="-mcpu=601"
@@ -1840,6 +1843,11 @@ case $cpu in
         cpuflags="-mcpu=cell"
         enable ldbrx
     ;;
         cpuflags="-mcpu=cell"
         enable ldbrx
     ;;
+esac
+
+elif enabled x86; then
+
+case $cpu in
     i[345]86|pentium)
         cpuflags="-march=$cpu"
         disable mmx
     i[345]86|pentium)
         cpuflags="-march=$cpu"
         disable mmx
@@ -1861,9 +1869,19 @@ case $cpu in
         enable cmov
         disable fast_cmov
     ;;
         enable cmov
         disable fast_cmov
     ;;
+esac
+
+elif enabled sparc; then
+
+case $cpu in
     sparc64)
         cpuflags="-mcpu=v9"
     ;;
     sparc64)
         cpuflags="-mcpu=v9"
     ;;
+esac
+
+elif enabled arm; then
+
+case $cpu in
     arm11*|cortex*)
         cpuflags="-mcpu=$cpu"
     ;;
     arm11*|cortex*)
         cpuflags="-mcpu=$cpu"
     ;;
@@ -1876,15 +1894,35 @@ case $cpu in
     arm*)
         cpuflags="-mcpu=$cpu"
     ;;
     arm*)
         cpuflags="-mcpu=$cpu"
     ;;
+esac
+
+elif enabled alpha; then
+
+case $cpu in
     ev4|ev45|ev5|ev56|pca56|ev6|ev67)
         enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
     ;;
     ev4|ev45|ev5|ev56|pca56|ev6|ev67)
         enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
     ;;
+esac
+
+elif enabled bfin; then
+
+case $cpu in
     bf*)
         cpuflags="-mcpu=$cpu"
     ;;
     bf*)
         cpuflags="-mcpu=$cpu"
     ;;
+esac
+
+elif enabled mips; then
+
+case $cpu in
     mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
         cpuflags="-march=$cpu"
     ;;
     mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
         cpuflags="-march=$cpu"
     ;;
+esac
+
+elif enabled avr32; then
+
+case $cpu in
     ap7[02]0[0-2])
         subarch="avr32_ap"
         cpuflags="-mpart=$cpu"
     ap7[02]0[0-2])
         subarch="avr32_ap"
         cpuflags="-mpart=$cpu"
@@ -1901,13 +1939,16 @@ case $cpu in
         subarch="avr32_uc"
         cpuflags="-march=$cpu"
     ;;
         subarch="avr32_uc"
         cpuflags="-march=$cpu"
     ;;
-    generic)
-    ;;
-    *)
-        echo "WARNING: Unknown CPU \"$cpu\", ignored."
-    ;;
 esac
 
 esac
 
+else
+
+    if test "$cpu" != generic; then
+        echo "WARNING: Unknown CPU \"$cpu\", ignored."
+    fi
+
+fi
+
 add_cflags $cpuflags
 add_asflags $cpuflags
 
 add_cflags $cpuflags
 add_asflags $cpuflags
 
@@ -1950,7 +1991,7 @@ EOF
     ;;
 esac
 
     ;;
 esac
 
-enable $arch $subarch
+enable $subarch
 enabled spic && enable pic
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
 
 enabled spic && enable pic
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic