Index: configure =================================================================== RCS file: /cvsroot/mplayer/main/configure,v retrieving revision 1.734 diff -u -r1.734 configure --- configure 3 Jul 2003 17:36:52 -0000 1.734 +++ configure 7 Jul 2003 16:35:58 -0000 @@ -557,21 +557,26 @@ test -z "$_as" && _as=as fi -# Try to find the available options for the current CPU -if x86 || ppc; then - if test -r /proc/cpuinfo ; then - # Linux with /proc mounted, extract CPU information from it - _cpuinfo="cat /proc/cpuinfo" - elif test -r /compat/linux/proc/cpuinfo ; then - # FreeBSD with Linux emulation /proc mounted, - # extract CPU information from it - _cpuinfo="cat /compat/linux/proc/cpuinfo" - elif x86; then - # all other OSes try to extract CPU information from a small helper - # program TOOLS/cpuinfo instead - $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c - _cpuinfo="TOOLS/cpuinfo" - fi +# XXX: this should be ok.. +_cpuinfo="echo" +if test -r /proc/cpuinfo ; then + # Linux with /proc mounted, extract CPU information from it + _cpuinfo="cat /proc/cpuinfo" +elif test -r /compat/linux/proc/cpuinfo ; then + # FreeBSD with Linux emulation /proc mounted, + # extract CPU information from it + _cpuinfo="cat /compat/linux/proc/cpuinfo" +elif x86; then + # all other OSes try to extract CPU information from a small helper + # program TOOLS/cpuinfo instead + $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c + _cpuinfo="TOOLS/cpuinfo" +fi + +case "$host_arch" in + i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) + _def_arch="#define ARCH_X86 1" + _target_arch="TARGET_ARCH_X86 = yes" pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1` pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` @@ -591,14 +596,12 @@ _sse=no _sse2=no _mtrr=no - _altivec=no for i in $pparam ; do case "$i" in 3dnow) _3dnow=yes ;; 3dnowext) _3dnow=yes _3dnowex=yes ;; mmx) _mmx=yes ;; - altivec) _altivec=yes ;; mmxext) _mmx2=yes ;; mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;; xmm|sse|kni) _sse=yes _mmx2=yes ;; @@ -626,40 +629,6 @@ _optimizing="Runtime CPU-Detection enabled" fi -fi - - -if [ "$host_arch" = alpha ]; then - echocheck "CPU type" -cat > $TMPC << EOF -int main() { - unsigned long ver, mask; - asm ("implver %0" : "=r" (ver)); - asm ("amask %1, %0" : "=r" (mask) : "r" (-1)); - printf("%ld-%x\n", ver, ~mask); - return 0; -} -EOF - $_cc -o "$TMPO" "$TMPC" - case `"$TMPO"` in - 0-0) proc="ev4" ;; - 1-0) proc="ev5" ;; - 1-1) proc="ev56" ;; - 1-101) proc="pca56" ;; - 2-303) proc="ev6" ;; - 2-307) proc="ev67" ;; - 2-1307) proc="ev68" ;; - esac - echores "$proc" -fi - - -# x86/x86pc is used by QNX -case "$host_arch" in - i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) - _def_arch="#define ARCH_X86 1" - _target_arch="TARGET_ARCH_X86 = yes" - case "$pvendor" in AuthenticAMD) case "$pfamily" in @@ -854,7 +823,7 @@ arm|armv4l|armv5tel) _def_arch='#define ARCH_ARMV4L 1' _target_arch='TARGET_ARCH_ARMV4L = yes' - iproc=arm + iproc='arm' proc='' _march='' _mcpu='' @@ -867,12 +836,18 @@ proc='' _march='' _mcpu='' + _altivec=no + + # XXX: this should be removed imho... cpu750=`$_cpuinfo | grep "cpu.*750"` if test -n "$cpu750"; then _march='-mcpu=750' _mcpu='-mtune=750' fi - if linux ; then + + echocheck "CPU type" + if linux && test -n "$_cpuinfo"; then + proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1` if test -n "`$_cpuinfo | grep altivec`"; then _altivec=yes fi @@ -882,6 +857,29 @@ _altivec=yes fi fi + echores "$proc" + + echocheck "GCC & CPU optimization abilities" + if test -n "$proc"; then + case "$proc" in + 601) _march='-mcpu=601' _mcpu='-mtune=601' ;; + 603) _march='-mcpu=603' _mcpu='-mtune=603' ;; + 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;; + 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;; + 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;; + 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;; + *) ;; + esac + # gcc 3.1(.1) and up supports 7400 and 7450 + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1"; then + case "$proc" in + 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;; + 7450*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; + *) ;; + esac + fi + fi + echores "$_march" ;; alpha) @@ -889,6 +887,29 @@ _target_arch='TARGET_ARCH_ALPHA = yes' iproc='alpha' _march='' + + echocheck "CPU type" + cat > $TMPC << EOF +int main() { + unsigned long ver, mask; + asm ("implver %0" : "=r" (ver)); + asm ("amask %1, %0" : "=r" (mask) : "r" (-1)); + printf("%ld-%x\n", ver, ~mask); + return 0; +} +EOF + $_cc -o "$TMPO" "$TMPC" + case `"$TMPO"` in + 0-0) proc="ev4" ;; + 1-0) proc="ev5" ;; + 1-1) proc="ev56" ;; + 1-101) proc="pca56" ;; + 2-303) proc="ev6" ;; + 2-307) proc="ev67" ;; + 2-1307) proc="ev68" ;; + esac + echores "$proc" + echocheck "GCC & CPU optimization abilities" if test "$proc" = "ev68" ; then cc_check -mcpu=$proc || proc=ev67