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 \
24 # want to put -fno-optimize-sibling-calls here but
25 # that option only works with gcc3+ it seems
26 cflags="$ngflags -ggdb"
31 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
32 # which multiplies single errors as a result of its expansion.
33 # The "Cursor. is deprecated" kills off warnings from Apple
34 # about using SetCursor/InitCursor. (Okay, they're deprecated,
35 # but you could at least tell us what to use instead, Apple!)
37 ignore=': error: .Each undeclared identifier'
38 ignore=$ignore'|: error: for each function it appears'
39 ignore=$ignore'|is dangerous, better use'
40 ignore=$ignore'|is almost always misused'
41 ignore=$ignore'|: In function '
42 ignore=$ignore'|: At top level:'
43 ignore=$ignore'|support .long long.'
44 ignore=$ignore'|In file included from'
45 ignore=$ignore'| from'
46 ignore=$ignore'|use of C99 long long'
47 ignore=$ignore'|ISO C forbids conversion'
48 ignore=$ignore'|marked deprecated'
49 ignore=$ignore'|is deprecated'
50 ignore=$ignore'|warn_unused_result'
51 ignore=$ignore'|expanded from macro'
53 grep -v '__p9l_autolib_' $1 |
55 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
56 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
71 -Wno-unknown-pragmas \
77 -Wno-unneeded-internal-declaration \
79 -fno-caret-diagnostics \
84 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
86 *DragonFly*gcc*|*BSD*gcc*) usegcc ;;
87 *DragonFly*clang|*BSD*clang*) useclang ;;
90 cflags="$ngflags -g3 -m64"
94 cflags="$ngflags -g3 -m32"
97 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
98 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
100 case "${CC9:-gcc}" in
106 case "${SYSVERSION:-`uname -r`}" in
108 cflags="$cflags -D__Linux24__"
111 cflags="$cflags -D__Linux26__"
115 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
117 cflags="-mt -g -O -c -xCC -D__sun__"
120 s=`echo $u$v | tr '. ' '__'`
121 cflags="$cflags -D__${s}__"
126 s=`echo $u$v | tr '. ' '__'`
128 cflags="$cflags -D__sun__ -D__${s}__"
131 cflags="$ngflags -g -D__AIX__"
134 echo 9c does not know how to compile on "$tag" 1>&2
138 # N.B. Must use temp file to avoid pipe; pipe loses status.
139 xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
140 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp