3 test -f $PLAN9/config && . $PLAN9/config
16 -Wno-unknown-pragmas \
17 -fno-omit-frame-pointer \
20 # want to put -fno-optimize-sibling-calls here but
21 # that option only works with gcc3+ it seems
22 cflags="$ngflags -ggdb"
27 # The uniq at the end is for gcc's strcmp/etc. built-in nonsense,
28 # which multiplies single errors as a result of its expansion.
29 # The "Cursor. is deprecated" kills off warnings from Apple
30 # about using SetCursor/InitCursor. (Okay, they're deprecated,
31 # but you could at least tell us what to use instead, Apple!)
33 ignore=': error: .Each undeclared identifier'
34 ignore=$ignore'|: error: for each function it appears'
35 ignore=$ignore'|is dangerous, better use'
36 ignore=$ignore'|is almost always misused'
37 ignore=$ignore'|: In function '
38 ignore=$ignore'|: At top level:'
39 ignore=$ignore'|support .long long.'
40 ignore=$ignore'|In file included from'
41 ignore=$ignore'| from'
42 ignore=$ignore'|use of C99 long long'
43 ignore=$ignore'|ISO C forbids conversion'
44 ignore=$ignore'|is deprecated'
45 ignore=$ignore'|warn_unused_result'
47 grep -v '__p9l_autolib_' $1 |
49 sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
50 $(which uniq) 1>&2 # avoid built-in uniq on SunOS
65 -Wno-unknown-pragmas \
71 -fno-caret-diagnostics \
76 tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
78 *FreeBSD*gcc*) usegcc ;;
79 *FreeBSD*clang*) useclang ;;
80 *DragonFly*|*BSD*) usegcc ;;
81 *Darwin-x86_64*clang*)
83 cflags="$ngflags -g3 -m64"
85 *Darwin-x86_64*) usegcc
86 cflags="$ngflags -g3 -no-cpp-precomp -m64" ;;
89 cflags="$ngflags -g3 -m32"
92 cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
93 *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
101 case "${SYSVERSION:-`uname -r`}" in
103 cflags="$cflags -D__Linux24__"
106 cflags="$cflags -D__Linux26__"
110 *OSF1*) cc=${CC9:-cc}; cflags="-g -O -c" ;;
112 cflags="-mt -g -O -c -xCC -D__sun__"
115 s=`echo $u$v | tr '. ' '__'`
116 cflags="$cflags -D__${s}__"
121 s=`echo $u$v | tr '. ' '__'`
123 cflags="$cflags -D__sun__ -D__${s}__"
126 cflags="$ngflags -g -D__AIX__"
129 echo 9c does not know how to compile on "$tag" 1>&2
133 # N.B. Must use temp file to avoid pipe; pipe loses status.
134 xtmp=/tmp/9c.$$.$USER.out
135 $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp