#!/bin/sh # $NetBSD: cpuflags.NetBSD,v 1.5 2001/06/28 22:23:00 abs Exp $ hw_model=`sysctl -n hw.model` case $hw_model in # i386 *386-class*) FLAGS='-march=i386' ;; *486-class*) FLAGS='-march=i486' ;; *586-class*) FLAGS='-march=pentium' ;; *686-class*) FLAGS='-march=pentiumpro' ;; # # sparc MB86904* | MB86907*) FLAGS="-mcpu=supersparc" ;; # ss5 TMS390Z50*) FLAGS="-mcpu=supersparc" ;; # ss10/ss20 MB86930* | MB86934*) FLAGS="-mcpu=sparclite" ;; # from gcc MB86900/1A*) FLAGS="-mcpu=cypress" ;; # ss1+ CY7C601*) FLAGS="-mcpu=cypress" ;; # ss2 # under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl SUNW,UltraSPARC*) FLAGS="-mcpu=v9" ;; # Ultra # # arm32 ARM610*) FLAGS="-mcpu=arm610" ;; # risc pc ARM710*) FLAGS="-mcpu=arm710" ;; # risc pc SA-110*) # The memorybus in strongarm risc pc machines cannot support # certain strongarm instructions, but we cannot tell a shark # from such a risc pc via uname or sysctl (Certainly for 1.5) if grep -q ofbus0 /var/run/dmesg.boot 2>/dev/null ; then FLAGS="-mcpu=strongarm110" # shark else FLAGS="-march=armv3m -mtune=strongarm" # risc pc fi ;; # *) echo "Unknown hw.model '$hw_model'" >&2 esac if [ -n "$FLAGS" ];then gcc_ver=`gcc -v 2>&1 | awk '/gcc version/ {print $3}'` case $gcc_ver in egcs* ) gcc_ver=2.8 ;; esac if [ "$gcc_ver" \< 2.8 ];then # Old gcc, such as in NetBSD 1.3 FLAGS=`awk -v "flags=$FLAGS" ' {map["-m"$1] = "-m"$2} END{print map[flags]}' <