Index: configure =================================================================== RCS file: /cvsroot/mplayer/main/configure,v retrieving revision 1.1082 diff -u -r1.1082 configure --- configure 17 Oct 2005 04:51:34 -0000 1.1082 +++ configure 17 Oct 2005 21:55:35 -0000 @@ -761,11 +761,8 @@ done } -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" - +if (x86 || x86_64) ; then + # gather more CPU information 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` pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` @@ -779,6 +776,12 @@ echocheck "CPU type" echores "$pname" +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" case "$pvendor" in AuthenticAMD) @@ -838,7 +841,9 @@ fi ;; 6) iproc=686 - if test "$pmodel" -ge 7; then + if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then + proc=pentium-m + elif test "$pmodel" -ge 7; then proc=pentium3 elif test "$pmodel" -ge 3; then proc=pentium2 @@ -846,8 +851,15 @@ proc=i686 fi ;; - 15) proc=pentium4 iproc=686 ;; - *) proc=pentium4 iproc=686 ;; + 15) iproc=686 + if test "$pmodel" -ge 3; then + # A nocona in 32-bit has no more capabilities than a prescott. + proc=prescott + else + proc=pentium4 + fi + ;; + *) proc=prescott iproc=686 ;; esac ;; CentaurHauls) @@ -1005,9 +1017,17 @@ else cpuopt=-mcpu fi - # k8 cpu-type only supported in gcc >= 3.4.0, but that will be - # caught and remedied in the optimization tests below. - proc=k8 + case "$pvendor" in + AuthenticAMD) + proc=k8;; + GenuineIntel) + # 64-bit prescotts exist, but as far as GCC is concerned they have the + # same capabilities as a nocona. + proc=nocona;; + *) + # The optimization tests will see this and disable optimization. + proc=error;; + esac echocheck "GCC & CPU optimization abilities" cat > $TMPC << EOF @@ -1015,6 +1035,7 @@ EOF # This is a stripped-down version of the i386 fallback. if test "$_runtime_cpudetection" = no ; then + # --- AMD processors --- if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp fi @@ -1024,10 +1045,19 @@ if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then cc_check -march=$proc $cpuopt=$proc || proc=error fi + # --- Intel processors --- + if test "$proc" = "nocona" || test "$proc" = "prescott" ; then + cc_check -march=$proc $cpuopt=$proc || proc=pentium4 + fi + # As with k8/opteron/etc, this will fail if gcc version < 3.3. + if test "$proc" = "pentium4" || test "$proc" = "pentium4m" ; then + cc_check -march=$proc $cpuopt=$proc || proc=error + fi + _march="-march=$proc" _mcpu="$cpuopt=$proc" if test "$proc" = "error" ; then - echores "Your $_cc does not even support \"athlon-xp\" for '-march' and '$cpuopt'." + echores "CPU optimization disabled. You have an old $_cc and/or configure does not recognize your CPU." _mcpu="" _march="" fi