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="$cflags -ggdb"
28 cflags="$cflags $CC9FLAGS"
33 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
34 # which multiplies single errors as a result of its expansion.
35 # The "Cursor. is deprecated" kills off warnings from Apple
36 # about using SetCursor/InitCursor. (Okay, they're deprecated,
37 # but you could at least tell us what to use instead, Apple!)
39 ignore=': error: .Each undeclared identifier'
40 ignore=$ignore'|: error: for each function it appears'
41 ignore=$ignore'|is dangerous, better use'
42 ignore=$ignore'|is almost always misused'
43 ignore=$ignore'|: In function '
44 ignore=$ignore'|: At top level:'
45 ignore=$ignore'|support .long long.'
46 ignore=$ignore'|In file included from'
47 ignore=$ignore'| from'
48 ignore=$ignore'|use of C99 long long'
49 ignore=$ignore'|ISO C forbids conversion'
50 ignore=$ignore'|marked deprecated'
51 ignore=$ignore'|is deprecated'
52 ignore=$ignore'|warn_unused_result'
53 ignore=$ignore'|expanded from macro'
55 grep -v '__p9l_autolib_' $1 |
57 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
58 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
73 -Wno-unknown-pragmas \
79 -Wno-unneeded-internal-declaration \
81 -fno-caret-diagnostics \
85 cflags="$cflags $CC9FLAGS"
99 -qsuppress=1506-1300 \
100 -qsuppress=1506-342 \
102 cflags="$cflags -g -qfullpath"
103 cflags="$cflags $CC9FLAGS"
106 tag="${SYSNAME:-`uname`}-${CC9:-cc}"
108 *DragonFly*gcc*|*BSD*gcc*) usegcc ;;
109 *DragonFly*clang|*BSD*clang*) useclang ;;
112 cflags="$cflags -g3 -m64"
114 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
116 case "${CC9:-gcc}" in
123 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
125 cflags="-mt -g -O -c -xCC -D__sun__"
128 s=`echo $u$v | tr '. ' '__'`
129 cflags="$cflags -D__${s}__"
134 s=`echo $u$v | tr '. ' '__'`
136 cflags="$cflags -D__sun__ -D__${s}__"
139 cflags="$cflags -g -D__AIX__"
142 echo 9c does not know how to compile on "$tag" 1>&2
146 # N.B. Must use temp file to avoid pipe; pipe loses status.
147 xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
148 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp