3 test -f $PLAN9/config && . $PLAN9/config
16 -Wno-unknown-pragmas \
17 -fno-omit-frame-pointer \
19 # want to put -fno-optimize-sibling-calls here but
20 # that option only works with gcc3+ it seems
21 cflags="$ngflags -ggdb"
24 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
28 cflags="$ngflags -g3 -no-cpp-precomp" ;;
29 *HP-UX*) cc=cc; cflags="-g -O -c -Ae" ;;
31 case "${SYSVERSION:-`uname -r`}" in
33 cflags="$cflags -D__Linux26__"
37 *OSF1*) cc=cc; cflags="-g -O -c" ;;
39 cflags="-mt -g -O -c -xCC -D__sun__"
42 s=`echo $u$v | tr '. ' '__'`
43 cflags="$cflags -D__${s}__"
48 s=`echo $u$v | tr '. ' '__'`
50 cflags="$cflags -D__${s}__"
53 echo 9c does not know how to compile on "$tag" 1>&2
57 # N.B. Must use temp file to avoid pipe; pipe loses status.
58 xtmp=/tmp/9c.$$.$USER.out
59 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" >$xtmp 2>&1
61 grep -v '__p9l_autolib_' $xtmp |
62 egrep -v ': error: .Each undeclared identifier|: error: for each function it appears|: In function `|: At top level: ' |
63 sed 's/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g'
64 rm -f $xtmp $xtmp.status