#!/bin/sh # $NetBSD: cpuflags.SunOS,v 1.1 2002/06/21 11:35:16 abs Exp $ arch=`/usr/bin/uname -m` case $arch in sun4c | sun4 ) FLAGS='-mcpu=cypress' ;; sun4m ) FLAGS='-mcpu=supersparc' ;; sun4u ) FLAGS='-mcpu=v9' ;; esac if [ -z "$FLAGS" -a -z "$NONE" ] ; then echo 'Unknown machine - please send details to abs@netbsd.org' >&2 echo " arch : '$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}'` FLAGS=`awk -v "flags=$FLAGS" -v "gcc_ver=$gcc_ver" ' {if (gcc_ver < $1){map[$2] = ""$3}} END{if (flags in map) {print map[flags]}else {print flags}} ' <