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"
26 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
27 # which multiplies single errors as a result of its expansion.
28 # The "Cursor. is deprecated" kills off warnings from Apple
29 # about using SetCursor/InitCursor. (Okay, they're deprecated,
30 # but you could at least tell us what to use instead, Apple!)
32 ignore=': error: .Each undeclared identifier'
33 ignore=$ignore'|: error: for each function it appears'
34 ignore=$ignore'|is dangerous, better use'
35 ignore=$ignore'|is almost always misused'
36 ignore=$ignore'|: In function '
37 ignore=$ignore'|: At top level:'
38 ignore=$ignore'|support .long long.'
39 ignore=$ignore'|In file included from'
40 ignore=$ignore'| from'
41 ignore=$ignore'|use of C99 long long'
42 ignore=$ignore'|ISO C forbids conversion'
43 ignore=$ignore'|is deprecated'
44 ignore=$ignore'|warn_unused_result'
46 grep -v '__p9l_autolib_' $1 |
48 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
62 -Wno-unknown-pragmas \
68 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
70 *FreeBSD*gcc*) usegcc ;;
71 *FreeBSD*clang*) useclang ;;
74 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
75 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
83 case "${SYSVERSION:-`uname -r`}" in
85 cflags="$cflags -D__Linux24__"
88 cflags="$cflags -D__Linux26__"
92 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
94 cflags="-mt -g -O -c -xCC -D__sun__"
97 s=`echo $u$v | tr '. ' '__'`
98 cflags="$cflags -D__${s}__"
103 s=`echo $u$v | tr '. ' '__'`
105 cflags="$cflags -D__sun__ -D__${s}__"
108 cflags="$ngflags -g -D__AIX__"
111 echo 9c does not know how to compile on "$tag" 1>&2
115 # N.B. Must use temp file to avoid pipe; pipe loses status.
116 xtmp=/tmp/9c.$$.$USER.out
117 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp