--- configure.orig 2003-04-07 05:12:59.000000000 +0200 +++ configure 2003-04-07 05:15:05.000000000 +0200 @@ -550,14 +550,24 @@ fi 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` pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1` if test -z "$pparam" ; then - pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1` + pparam=`$_cpuinfo | grep '^flags' | cut -d ':' -f 2 | head -1` + fi + + # Fix for benh kernel on ppc + if test -z "$pname" ; then + pname=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` + fi + if test -z "$pparam" ; then + pparam=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 3 | head -1` fi _mmx=no @@ -843,12 +853,43 @@ proc='' _march='' _mcpu='' - cpu750=`$_cpuinfo | grep "cpu.*750"` - if test -n "$cpu750"; then - _march='-mcpu=750' - _mcpu='-mtune=750' + + echocheck "Using ppc ($pname) optimizations" + + case "$pname" in + 603*) + _march="-mcpu=603" + _mcpu="-mtune=603" + ;; + 604*) + _march="-mcpu=604" + _mcpu="-mtune=604" + ;; + 74[10]0*) + _march="-mcpu=7400" + _mcpu="-mtune=7400" + ;; + 745[570]*) + _march="-mcpu=7450" + _mcpu="-mtune=7450" + ;; + 7[45][50]*) + _march="-mcpu=750" + _mcpu="-mtune=750" + ;; + 82[46][50]*) + _march="-mcpu=603e" + _mcpu="-mtune=603e" + ;; + esac + + if test "$_altivec" = yes ; then + _march="$_march -maltivec -mabi=altivec" fi + + echores "$_mcpu and $_march" ;; + alpha) _def_arch='#define ARCH_ALPHA 1'