3 test -f $PLAN9/config && . $PLAN9/config
16 -Wno-unknown-pragmas \
17 -Wno-misleading-indentation \
18 -Wno-stringop-truncation \
19 -Wno-stringop-overflow \
20 -Wno-format-truncation \
21 -fno-omit-frame-pointer \
25 # want to put -fno-optimize-sibling-calls here but
26 # that option only works with gcc3+ it seems
27 cflags="$ngflags -ggdb"
32 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
33 # which multiplies single errors as a result of its expansion.
34 # The "Cursor. is deprecated" kills off warnings from Apple
35 # about using SetCursor/InitCursor. (Okay, they're deprecated,
36 # but you could at least tell us what to use instead, Apple!)
38 ignore=': error: .Each undeclared identifier'
39 ignore=$ignore'|: error: for each function it appears'
40 ignore=$ignore'|is dangerous, better use'
41 ignore=$ignore'|is almost always misused'
42 ignore=$ignore'|: In function '
43 ignore=$ignore'|: At top level:'
44 ignore=$ignore'|support .long long.'
45 ignore=$ignore'|In file included from'
46 ignore=$ignore'| from'
47 ignore=$ignore'|use of C99 long long'
48 ignore=$ignore'|ISO C forbids conversion'
49 ignore=$ignore'|marked deprecated'
50 ignore=$ignore'|is deprecated'
51 ignore=$ignore'|warn_unused_result'
52 ignore=$ignore'|expanded from macro'
54 grep -v '__p9l_autolib_' $1 |
56 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
57 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
72 -Wno-unknown-pragmas \
78 -Wno-unneeded-internal-declaration \
80 -fno-caret-diagnostics \
96 -qsuppress=1506-1300 \
99 cflags="$ngflags -g -qfullpath"
102 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
104 *DragonFly*gcc*|*BSD*gcc*) usegcc ;;
105 *DragonFly*clang|*BSD*clang*) useclang ;;
108 cflags="$ngflags -g3 -m64"
112 cflags="$ngflags -g3 -m32"
115 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
116 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
118 case "${CC9:-gcc}" in
125 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
127 cflags="-mt -g -O -c -xCC -D__sun__"
130 s=`echo $u$v | tr '. ' '__'`
131 cflags="$cflags -D__${s}__"
136 s=`echo $u$v | tr '. ' '__'`
138 cflags="$cflags -D__sun__ -D__${s}__"
141 cflags="$ngflags -g -D__AIX__"
144 echo 9c does not know how to compile on "$tag" 1>&2
148 # N.B. Must use temp file to avoid pipe; pipe loses status.
149 xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
150 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp