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" ;;
37 case "${SYSVERSION:-`uname -r`}" in
39 cflags="$cflags -D__Linux24__"
42 cflags="$cflags -D__Linux26__"
46 *OSF1*) cc=cc; cflags="-g -O -c" ;;
48 cflags="-mt -g -O -c -xCC -D__sun__"
51 s=`echo $u$v | tr '. ' '__'`
52 cflags="$cflags -D__${s}__"
57 s=`echo $u$v | tr '. ' '__'`
59 cflags="$cflags -D__${s}__"
62 echo 9c does not know how to compile on "$tag" 1>&2
66 # N.B. Must use temp file to avoid pipe; pipe loses status.
67 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
68 # which multiplies single errors as a result of its expansion.
69 xtmp=/tmp/9c.$$.$USER.out
70 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp
72 grep -v '__p9l_autolib_' $xtmp |
73 egrep -v ': error: .Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|In file included from| from|use of C99 long long|ISO C forbids conversion' |
74 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
76 rm -f $xtmp $xtmp.status