aboutsummaryrefslogtreecommitdiff
path: root/bin/9c
blob: 871e6f66332b53d5a5c732f0393c9e6459d91ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

usegcc()
{
	cc=gcc
	cflags=" \
		-O2 \
		-c \
		-ggdb \
		-Wall \
		-Wno-parentheses \
		-Wno-missing-braces \
		-Wno-switch \
		-Wno-comment \
		-Wno-sign-compare \
	"
}

tag="`uname`-`uname -m`-${CC9:-cc}"
case "$tag" in
*BSD*)		usegcc ;;
*Darwin*)	usegcc 
	cflags=`echo $cflags|sed 's/-ggdb/-g3 -no-cpp-precomp/'`
	;;
*HP-UX*)	cc=cc; cflags="-g -O -c -Ae" ;;
*Linux*)	usegcc ;;
*OSF1*)		cc=cc; cflags="-g -O -c" ;;
*SunOS*-cc)	cc=cc; cflags="-g -O -c -xCC -D__sun__" ;;
*SunOS*-gcc)	usegcc ;;
*)
	echo 9c does not know how to compile on "$tag" 1>&2
	exit 1
esac

exec $cc -I$PLAN9/include $cflags "$@"