#!/bin/sh # $NetBSD: cpuflags.Linux,v 1.5 2001/11/27 12:26:12 abs Exp $ hw_model=`uname -m` case $hw_model in # i386 i386) FLAGS='-march=i386' ;; i486) FLAGS='-march=i486' ;; i586) FLAGS='-march=pentium' ;; i686) FLAGS='-march=pentiumpro' ;; # *) echo "Unknown hw.model '$hw_model'" >&2 echo "Please send machine details to abs@netbsd.org" >&2 ;; esac # 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["-m"$2] = "-m"$3}} END{if (map[flags]) {print map[flags]}else {print flags}} ' <