comparison configure @ 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 bf78d0e672d3
children 0223db3425f8
comparison
equal deleted inserted replaced
22696:3eba30a92c20 22697:2fe9bd97a7f6
1503 echores "$pname" 1503 echores "$pname"
1504 fi 1504 fi
1505 1505
1506 fi # test "$_runtime_cpudetection" = no 1506 fi # test "$_runtime_cpudetection" = no
1507 1507
1508 if x86 && test "$_runtime_cpudetection" = no ; then
1509 extcheck() {
1510 if test "$1" = kernel_check ; then
1511 echocheck "kernel support of $2"
1512 cat > $TMPC <<EOF
1513 #include <signal.h>
1514 void catch() { exit(1); }
1515 int main(void){
1516 signal(SIGILL, catch);
1517 __asm__ __volatile__ ("$3":::"memory");return(0);
1518 }
1519 EOF
1520
1521 if cc_check && tmp_run ; then
1522 eval _$2=yes
1523 echores "yes"
1524 _optimizing="$_optimizing $2"
1525 return 0
1526 else
1527 eval _$2=no
1528 echores "failed"
1529 echo "It seems that your kernel does not correctly support $2."
1530 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1531 return 1
1532 fi
1533 fi
1534 return 0
1535 }
1536
1537 extcheck $_mmx "mmx" "emms"
1538 extcheck $_mmxext "mmxext" "sfence"
1539 extcheck $_3dnow "3dnow" "femms"
1540 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1541 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1542 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1543 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1544
1545 echocheck "mtrr support"
1546 if test "$_mtrr" = kernel_check ; then
1547 _mtrr="yes"
1548 _optimizing="$_optimizing mtrr"
1549 fi
1550 echores "$_mtrr"
1551
1552 if test "$_gcc3_ext" != ""; then
1553 # if we had to disable sse/sse2 because the active kernel does not
1554 # support this instruction set extension, we also have to tell
1555 # gcc3 to not generate sse/sse2 instructions for normal C code
1556 cat > $TMPC << EOF
1557 int main(void) { return 0; }
1558 EOF
1559 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1560 fi
1561
1562 fi
1508 1563
1509 case "$host_arch" in 1564 case "$host_arch" in
1510 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) 1565 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1511 _def_arch_x86="#define ARCH_X86 1" 1566 _def_arch_x86="#define ARCH_X86 1"
1512 _target_arch_x86="TARGET_ARCH_X86 = yes" 1567 _target_arch_x86="TARGET_ARCH_X86 = yes"
2131 if ppc; then 2186 if ppc; then
2132 _altivec=yes 2187 _altivec=yes
2133 fi 2188 fi
2134 fi 2189 fi
2135 2190
2136 if x86 && test "$_runtime_cpudetection" = no ; then
2137 extcheck() {
2138 if test "$1" = kernel_check ; then
2139 echocheck "kernel support of $2"
2140 cat > $TMPC <<EOF
2141 #include <signal.h>
2142 void catch() { exit(1); }
2143 int main(void){
2144 signal(SIGILL, catch);
2145 __asm__ __volatile__ ("$3":::"memory");return(0);
2146 }
2147 EOF
2148
2149 if cc_check && tmp_run ; then
2150 eval _$2=yes
2151 echores "yes"
2152 _optimizing="$_optimizing $2"
2153 return 0
2154 else
2155 eval _$2=no
2156 echores "failed"
2157 echo "It seems that your kernel does not correctly support $2."
2158 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
2159 return 1
2160 fi
2161 fi
2162 return 0
2163 }
2164
2165 extcheck $_mmx "mmx" "emms"
2166 extcheck $_mmxext "mmxext" "sfence"
2167 extcheck $_3dnow "3dnow" "femms"
2168 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
2169 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
2170 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
2171 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
2172
2173 echocheck "mtrr support"
2174 if test "$_mtrr" = kernel_check ; then
2175 _mtrr="yes"
2176 _optimizing="$_optimizing mtrr"
2177 fi
2178 echores "$_mtrr"
2179
2180 if test "$_gcc3_ext" != ""; then
2181 # if we had to disable sse/sse2 because the active kernel does not
2182 # support this instruction set extension, we also have to tell
2183 # gcc3 to not generate sse/sse2 instructions for normal C code
2184 cat > $TMPC << EOF
2185 int main(void) { return 0; }
2186 EOF
2187 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
2188 fi
2189
2190 fi
2191 2191
2192 2192
2193 echocheck "assembler support of -pipe option" 2193 echocheck "assembler support of -pipe option"
2194 cat > $TMPC << EOF 2194 cat > $TMPC << EOF
2195 int main(void) { return 0; } 2195 int main(void) { return 0; }