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' |
49 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
62 -Wno-unknown-pragmas \
68 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
70 *FreeBSD*gcc*) usegcc ;;
71 *FreeBSD*clang*) useclang ;;
73 *Darwin-x86_64*) usegcc
74 cflags="$ngflags -g3 -no-cpp-precomp -m64" ;;
76 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
77 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
85 case "${SYSVERSION:-`uname -r`}" in
87 cflags="$cflags -D__Linux24__"
90 cflags="$cflags -D__Linux26__"
94 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
96 cflags="-mt -g -O -c -xCC -D__sun__"
99 s=`echo $u$v | tr '. ' '__'`
100 cflags="$cflags -D__${s}__"
105 s=`echo $u$v | tr '. ' '__'`
107 cflags="$cflags -D__sun__ -D__${s}__"
110 cflags="$ngflags -g -D__AIX__"
113 echo 9c does not know how to compile on "$tag" 1>&2
117 # N.B. Must use temp file to avoid pipe; pipe loses status.
118 xtmp=/tmp/9c.$$.$USER.out
119 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp