Index: configure =================================================================== RCS file: /cvsroot/mplayer/main/configure,v retrieving revision 1.735 diff -u -r1.735 configure --- configure 7 Jul 2003 16:26:27 -0000 1.735 +++ configure 7 Jul 2003 17:21:34 -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,13 +836,17 @@ 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 @@ -884,6 +857,9 @@ _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' ;; @@ -903,6 +879,9 @@ esac fi fi + echores "$proc" + + _optimizing=$proc ;; alpha) @@ -910,6 +889,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 @@ -919,6 +921,8 @@ fi _mcpu="-mcpu=$proc" echores "$proc" + + _optimizing=$proc ;; mips)