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"
31 cflags="$cflags -DPLAN9PORT_ASAN"
37 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
38 # which multiplies single errors as a result of its expansion.
39 # The "Cursor. is deprecated" kills off warnings from Apple
40 # about using SetCursor/InitCursor. (Okay, they're deprecated,
41 # but you could at least tell us what to use instead, Apple!)
43 ignore=': error: .Each undeclared identifier'
44 ignore=$ignore'|: error: for each function it appears'
45 ignore=$ignore'|is dangerous, better use'
46 ignore=$ignore'|is almost always misused'
47 ignore=$ignore'|: In function '
48 ignore=$ignore'|: At top level:'
49 ignore=$ignore'|support .long long.'
50 ignore=$ignore'|In file included from'
51 ignore=$ignore'| from'
52 ignore=$ignore'|use of C99 long long'
53 ignore=$ignore'|ISO C forbids conversion'
54 ignore=$ignore'|marked deprecated'
55 ignore=$ignore'|is deprecated'
56 ignore=$ignore'|warn_unused_result'
57 ignore=$ignore'|expanded from macro'
59 grep -v '__p9l_autolib_' $1 |
61 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
62 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
77 -Wno-unknown-pragmas \
83 -Wno-unneeded-internal-declaration \
85 -fno-caret-diagnostics \
88 cflags="$cflags $CC9FLAGS"
92 cflags="$cflags -DPLAN9PORT_ASAN"
103 -qsuppress=1506-236 \
104 -qsuppress=1506-358 \
105 -qsuppress=1500-010 \
106 -qsuppress=1506-224 \
107 -qsuppress=1506-1300 \
108 -qsuppress=1506-342 \
110 cflags="$cflags -g -qfullpath"
111 cflags="$cflags $CC9FLAGS"
114 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
116 *DragonFly*gcc*|*BSD*gcc*) usegcc ;;
117 *DragonFly*clang|*BSD*clang*) useclang ;;
120 cflags="$cflags -g3 -m64"
124 cflags="$cflags -g3 -m32"
127 cflags="$cflags -g3 -no-cpp-precomp -m32" ;;
128 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
130 case "${CC9:-gcc}" in
137 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
139 cflags="-mt -g -O -c -xCC -D__sun__"
142 s=`echo $u$v | tr '. ' '__'`
143 cflags="$cflags -D__${s}__"
148 s=`echo $u$v | tr '. ' '__'`
150 cflags="$cflags -D__sun__ -D__${s}__"
153 cflags="$cflags -g -D__AIX__"
156 echo 9c does not know how to compile on "$tag" 1>&2
160 # N.B. Must use temp file to avoid pipe; pipe loses status.
161 xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
162 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp