plan9port/bin/9c

46 lines
806 B
Text
Raw Normal View History

#!/bin/sh
usegcc()
{
cc=gcc
2004-03-02 17:34:15 +00:00
ngflags=" \
-O2 \
-c \
-Wall \
-Wno-parentheses \
-Wno-missing-braces \
-Wno-switch \
2004-02-09 19:33:05 +00:00
-Wno-comment \
2003-11-25 02:36:46 +00:00
-Wno-sign-compare \
"
cflags="$ngflags -ggdb"
}
2004-03-02 17:34:15 +00:00
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
case "$tag" in
*BSD*) usegcc ;;
2004-03-02 16:58:49 +00:00
*Darwin*) usegcc
2004-03-02 17:34:15 +00:00
cflags="$ngflags -g3 -no-cpp-precomp" ;;
*HP-UX*) cc=cc; cflags="-g -O -c -Ae" ;;
*Linux*) usegcc ;;
*OSF1*) cc=cc; cflags="-g -O -c" ;;
2004-03-26 05:01:11 +00:00
*SunOS*-cc) cc=cc;
cflags="-g -O -c -xCC -D__sun__"
u=`uname`
v=`uname -v`
s=`echo $u$v | tr '. ' '__'
cflags="$cflags -D$s"
;;
*SunOS*-gcc) usegcc
u=`uname`
v=`uname -v`
s=`echo $u$v | tr '. ' '__'
cflags="$cflags -D$s"
;;
*)
echo 9c does not know how to compile on "$tag" 1>&2
exit 1
esac
2003-11-25 02:11:11 +00:00
exec $cc -I$PLAN9/include $cflags "$@"