[MPlayer-cvslog] r22715 - trunk/configure
uau
subversion at mplayerhq.hu
Sun Mar 18 14:38:56 CET 2007
Author: uau
Date: Sun Mar 18 14:38:55 2007
New Revision: 22715
Modified:
trunk/configure
Log:
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.
Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Sun Mar 18 14:38:55 2007
@@ -1505,6 +1505,61 @@ fi
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 @@ if test "$_runtime_cpudetection" = yes ;
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"
More information about the MPlayer-cvslog
mailing list