changeset 22697:2fe9bd97a7f6

Fix configure -march detection for athlon-xp The configure script uses SSE support to distinguish between athlon and athlon-xp, but SSE support was tested _after_ deciding the basic CPU type. Thus athlon-xp was always misdetected as athlon. Fix this by moving the CPU extensions check before the CPU type check. Patch from Andrew Savchenko, bircoph list ru.
author uau
date Sun, 18 Mar 2007 13:38:55 +0000
parents 3eba30a92c20
children 21010b8ee7d2
files configure
diffstat 1 files changed, 55 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Mar 18 13:08:10 2007 +0000
+++ b/configure	Sun Mar 18 13:38:55 2007 +0000
@@ -1505,6 +1505,61 @@
 
 fi # test "$_runtime_cpudetection" = no
 
+if x86 && test "$_runtime_cpudetection" = no ; then
+  extcheck() {
+    if test "$1" = kernel_check ; then
+      echocheck "kernel support of $2"
+      cat > $TMPC <<EOF
+#include <signal.h>
+void catch() { exit(1); }
+int main(void){
+  signal(SIGILL, catch);
+  __asm__ __volatile__ ("$3":::"memory");return(0);
+}
+EOF
+
+      if cc_check && tmp_run ; then
+        eval _$2=yes
+        echores "yes"
+	_optimizing="$_optimizing $2"
+        return 0
+      else
+        eval _$2=no
+        echores "failed"
+        echo "It seems that your kernel does not correctly support $2."
+        echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
+	return 1
+      fi
+    fi
+    return 0
+  }
+
+  extcheck $_mmx      "mmx"      "emms"
+  extcheck $_mmxext   "mmxext"   "sfence"
+  extcheck $_3dnow    "3dnow"    "femms"
+  extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
+  extcheck $_sse      "sse"      "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
+  extcheck $_sse2     "sse2"     "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
+  extcheck $_cmov     "cmov"     "cmovb %%eax,%%ebx"
+
+  echocheck "mtrr support"
+  if test "$_mtrr" = kernel_check ; then
+    _mtrr="yes"
+    _optimizing="$_optimizing mtrr"
+  fi
+  echores "$_mtrr"
+
+  if test "$_gcc3_ext" != ""; then
+    # if we had to disable sse/sse2 because the active kernel does not
+    # support this instruction set extension, we also have to tell
+    # gcc3 to not generate sse/sse2 instructions for normal C code
+    cat > $TMPC << EOF
+int main(void) { return 0; }
+EOF
+    cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
+  fi
+
+fi
 
 case "$host_arch" in
   i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
@@ -2133,61 +2188,6 @@
   fi
 fi
 
-if x86 && test "$_runtime_cpudetection" = no ; then
-  extcheck() {
-    if test "$1" = kernel_check ; then
-      echocheck "kernel support of $2"
-      cat > $TMPC <<EOF
-#include <signal.h>
-void catch() { exit(1); }
-int main(void){
-  signal(SIGILL, catch);
-  __asm__ __volatile__ ("$3":::"memory");return(0);
-}
-EOF
-
-      if cc_check && tmp_run ; then
-        eval _$2=yes
-        echores "yes"
-	_optimizing="$_optimizing $2"
-        return 0
-      else
-        eval _$2=no
-        echores "failed"
-        echo "It seems that your kernel does not correctly support $2."
-        echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
-	return 1
-      fi
-    fi
-    return 0
-  }
-
-  extcheck $_mmx      "mmx"      "emms"
-  extcheck $_mmxext   "mmxext"   "sfence"
-  extcheck $_3dnow    "3dnow"    "femms"
-  extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
-  extcheck $_sse      "sse"      "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
-  extcheck $_sse2     "sse2"     "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
-  extcheck $_cmov     "cmov"     "cmovb %%eax,%%ebx"
-
-  echocheck "mtrr support"
-  if test "$_mtrr" = kernel_check ; then
-    _mtrr="yes"
-    _optimizing="$_optimizing mtrr"
-  fi
-  echores "$_mtrr"
-
-  if test "$_gcc3_ext" != ""; then
-    # if we had to disable sse/sse2 because the active kernel does not
-    # support this instruction set extension, we also have to tell
-    # gcc3 to not generate sse/sse2 instructions for normal C code
-    cat > $TMPC << EOF
-int main(void) { return 0; }
-EOF
-    cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
-  fi
-
-fi
 
 
 echocheck "assembler support of -pipe option"