diff options
author | abs <abs> | 2002-03-27 21:16:48 +0000 |
---|---|---|
committer | abs <abs> | 2002-03-27 21:16:48 +0000 |
commit | 17b92a7ff100480a5a97dbf7ecc48fe51b98806b (patch) | |
tree | 4e33f055b573764c5acc5508fbc7142e1ccb7166 /devel | |
parent | 0c3f62349202c931e48b8a2cd0777f9365eb34ce (diff) | |
download | pkgsrc-17b92a7ff100480a5a97dbf7ecc48fe51b98806b.tar.gz |
Updated cpuflags to 0.21 - add powerpc values from Jon Buller plus some
other friendly people on port-macppc.
While I'm here rework to check hw.machine_arch first and then hw.model, so
we cna handle overlapping model matches between hw.machine_arch. We've not
hit any yet, but this is the right thing to do :)
Diffstat (limited to 'devel')
-rw-r--r-- | devel/cpuflags/Makefile | 4 | ||||
-rwxr-xr-x | devel/cpuflags/files/cpuflags.NetBSD | 148 |
2 files changed, 86 insertions, 66 deletions
diff --git a/devel/cpuflags/Makefile b/devel/cpuflags/Makefile index c551d75b2ad..0e471f9642b 100644 --- a/devel/cpuflags/Makefile +++ b/devel/cpuflags/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.20 2002/03/14 11:31:29 abs Exp $ +# $NetBSD: Makefile,v 1.21 2002/03/27 21:16:48 abs Exp $ # -DISTNAME= cpuflags-0.20 +DISTNAME= cpuflags-0.21 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/devel/cpuflags/files/cpuflags.NetBSD b/devel/cpuflags/files/cpuflags.NetBSD index 7c21163b0ba..5aef8a3609b 100755 --- a/devel/cpuflags/files/cpuflags.NetBSD +++ b/devel/cpuflags/files/cpuflags.NetBSD @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: cpuflags.NetBSD,v 1.19 2002/03/14 11:31:29 abs Exp $ +# $NetBSD: cpuflags.NetBSD,v 1.20 2002/03/27 21:16:48 abs Exp $ if [ -x /sbin/sysctl ] ;then SYSCTL=/sbin/sysctl @@ -7,8 +7,9 @@ else SYSCTL=/usr/sbin/sysctl # NetBSD 1.3 fi -hw_model=`$SYSCTL -n hw.model` hw_machine=`$SYSCTL -n hw.machine` +hw_machine_arch=`$SYSCTL -n hw.machine_arch` +hw_model=`$SYSCTL -n hw.model` # We're almost certainly crosscompiling if [ -n "$MACHINE" -a $hw_machine != "$MACHINE" ]; then @@ -16,71 +17,90 @@ if [ -n "$MACHINE" -a $hw_machine != "$MACHINE" ]; then exit fi -case $hw_model in - # i386 - *386-class*) FLAGS='-march=i386' ;; - *486-class*) FLAGS='-march=i486' ;; - *AMD\ K6*) FLAGS='-march=k6' ;; - *586-class*) FLAGS='-march=pentium' ;; - *686-class*) FLAGS='-march=pentiumpro' ;; - # m68k - *\(68020\)) FLAGS='-m68020' ;; # Untested - *\(68030\)) FLAGS='-m68030' ;; # Mac LC III - *\(68040\)) FLAGS='-m68040' ;; # Untested - *\(68060\)) FLAGS='-m68060' ;; # Untested - # - # sparc - MB86900/1A*) FLAGS="-mcpu=cypress" ;; # ss1+ - CY7C601*) FLAGS="-mcpu=cypress" ;; # ss2 - W8601/8701*) FLAGS="-mcpu=cypress" ;; # elc - MB86904* | MB86907*) FLAGS="-mcpu=supersparc" ;; # ss5 (microsparc) - TMS390S10*) FLAGS="-mcpu=supersparc" ;; # classic (") - TMS390Z50*) FLAGS="-mcpu=supersparc" ;; # ss10/ss20 - RT620/625*) FLAGS="-mcpu=supersparc" ;; # ss20 ross - MB86930* | MB86934*) FLAGS="-mcpu=sparclite" ;; # from gcc - # under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl - SUNW,UltraSPARC*) FLAGS="-mcpu=v9" ;; # Ultra - # - # arm - ARM610*) FLAGS="-mcpu=arm610" ;; # risc pc - ARM710*) FLAGS="-mcpu=arm710" ;; # risc pc - SA-110*) - case $hw_machine in # arm32 split post 1.5 - cats|dnard|hpcarm|netwinder) - FLAGS="-mcpu=strongarm110" ;; - acorn32) - FLAGS="-march=armv3m -mtune=strongarm" ;; - *) - # The memorybus in strongarm risc pc machines cannot support - # certain strongarm instructions, but in 1.5 and earlier all - # strongarm machines are 'arm32', so uname and sysctl no use - if egrep -q 'ofbus0|footbridge0' /var/run/dmesg.boot \ +case $hw_machine_arch in + + alpha) + # cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ... + if egrep -q '^cpu0.*21164A' /var/run/dmesg.boot 2>/dev/null ; then + FLAGS="-mcpu=21164a" + fi ;; + + arm32) case $hw_model in + ARM610*) FLAGS="-mcpu=arm610" ;; # risc pc + ARM710*) FLAGS="-mcpu=arm710" ;; # risc pc + SA-110*) + case $hw_machine in # arm32 split post 1.5 + cats|shark|hpcarm|netwinder) + FLAGS="-mcpu=strongarm110" ;; + acorn32) + FLAGS="-march=armv3m -mtune=strongarm" ;; + *) + # memorybus in strongarm risc pc machines cannot support + # certain strongarm instructions, but in 1.5 and earlier + # all strongarm machines are 'arm32', so uname and sysctl + # no use + if egrep -q 'ofbus0|footbridge0' /var/run/dmesg.boot \ 2>/dev/null ; then - FLAGS="-mcpu=strongarm110" # dnard/cats - else - FLAGS="-march=armv3m -mtune=strongarm" # risc pc - fi - esac ;; - # - # alpha / vax / unknown - *) - case $hw_machine in - alpha) - # cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ... - if egrep -q '^cpu0.*21164A' /var/run/dmesg.boot 2>/dev/null \ - ; then - FLAGS="-mcpu=21164a" - fi - # Need to confirm how other CPUs probe - ;; # No VAX specific gcc flags :( - vax) - ;; # No VAX specific gcc flags :( - *) - echo "Unknown hw.model '$hw_model'" >&2 - echo "Please send machine details to abs@netbsd.org" >&2 - esac + FLAGS="-mcpu=strongarm110" # shark/cats + else + FLAGS="-march=armv3m -mtune=strongarm" # risc pc + fi + esac ;; + esac ;; + + i386) case $hw_model in + *386-class*) FLAGS='-march=i386' ;; + *486-class*) FLAGS='-march=i486' ;; + *AMD\ K6*) FLAGS='-march=k6' ;; + *586-class*) FLAGS='-march=pentium' ;; + *686-class*) FLAGS='-march=pentiumpro' ;; + esac ;; + + m68k) case $hw_model in + *\(68020\)) FLAGS='-m68020' ;; # Untested + *\(68030\)) FLAGS='-m68030' ;; # Mac LC III + *\(68040\)) FLAGS='-m68040' ;; # Untested + *\(68060\)) FLAGS='-m68060' ;; # Untested + esac ;; + + powerpc) case $hw_model in + 601\ *) FLAGS='-mcpu=601' ;; # Untested + 602\ *) FLAGS='-mcpu=602' ;; # Untested + 603\ *) FLAGS='-mcpu=603' ;; # Untested + 603ev\ *) FLAGS='-mcpu=603e' ;; # PM 4400 + 604\ *) FLAGS='-mcpu=604' ;; # Mac 8500 + 604ev\ *) FLAGS='-mcpu=604e' ;; # upgr B&W G3 + 750\ *) FLAGS='-mcpu=750' ;; # Untested + 740\ *) FLAGS='-mcpu=750' ;; # Untested + 620\ *) FLAGS='-mcpu=750' ;; # Untested + esac ;; + + sparc | sparc64) case $hw_model in + MB86900/1A*) FLAGS='-mcpu=cypress' ;; # ss1+ + CY7C601*) FLAGS='-mcpu=cypress' ;; # ss2 + W8601/8701*) FLAGS='-mcpu=cypress' ;; # elc + MB86904* | MB86907*) FLAGS='-mcpu=supersparc' ;; # ss5 usparc + TMS390S10*) FLAGS='-mcpu=supersparc' ;; # classic " + TMS390Z50*) FLAGS='-mcpu=supersparc' ;; # ss10/ss20 + RT620/625*) FLAGS='-mcpu=supersparc' ;; # ss20 ross + MB86930* | MB86934*) FLAGS='-mcpu=sparclite' ;; # from gcc + # under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl + SUNW,UltraSPARC*) FLAGS='-mcpu=v9' ;; # Ultra + esac ;; + + vax) # No VAX specific gcc optimisations available + NONE=1 + ;; + esac +if [ -z "$FLAGS" -a -z "$NONE" ] ; then + echo 'Unknown machine - please send details to abs@netbsd.org' >&2 + echo " hw.model : '$hw_model'" >&2 + echo " hw.machine : '$hw_machine'" >&2 + echo " hw.machine_arch : '$hw_machine_arch'" >&2 +fi + # Fixup flags for old gcc if [ -n "$FLAGS" ]; then gcc_ver=`gcc -v 2>&1 | awk '/gcc version/ {sub("egcs-","");print $3}'` |