commit - 154140a22b1c697f6a3edb3e5913efded1be082a
commit + 9444b8e4bc847f8fd9d02466976b962288cedf31
blob - 320a1634c8d0885bbd5d514df95d674d5c55fe5c
blob + dd89929333c94bcb86c4b7052446274df3aead9f
--- bin/9c
+++ bin/9c
usegcc()
{
cc=${CC9:-gcc}
- ngflags=" \
+ cflags=" \
-O2 \
-c \
-Wall \
"
# want to put -fno-optimize-sibling-calls here but
# that option only works with gcc3+ it seems
- cflags="$ngflags -ggdb"
+ cflags="$cflags -ggdb"
+ cflags="$cflags $CC9FLAGS"
+ case "$cflags" in
+ *sanitize=address*)
+ cflags="$cflags -DPLAN9PORT_ASAN"
+ esac
}
quiet()
useclang()
{
cc=${CC9:-clang}
- ngflags=" \
+ cflags=" \
-O2 \
-c \
-Wall \
-fsigned-char \
-fno-caret-diagnostics \
"
- cflags="$ngflags -g"
+ cflags="$cflags -g"
+ cflags="$cflags $CC9FLAGS"
+
+ case "$cflags" in
+ *sanitize=address*)
+ cflags="$cflags -DPLAN9PORT_ASAN"
+ esac
}
usexlc()
{
cc=${CC9:-xlc_r}
- ngflags=" \
+ cflags=" \
-c \
-O0 \
-qmaxmem=-1 \
-qsuppress=1506-1300 \
-qsuppress=1506-342 \
"
- cflags="$ngflags -g -qfullpath"
+ cflags="$cflags -g -qfullpath"
+ cflags="$cflags $CC9FLAGS"
}
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}"
*DragonFly*clang|*BSD*clang*) useclang ;;
*Darwin-x86_64*)
useclang
- cflags="$ngflags -g3 -m64"
+ cflags="$cflags -g3 -m64"
;;
*Darwin*clang*)
useclang
- cflags="$ngflags -g3 -m32"
+ cflags="$cflags -g3 -m32"
;;
*Darwin*) usegcc
- cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
+ cflags="$cflags -g3 -no-cpp-precomp -m32" ;;
*HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
*Linux*) usegcc
case "${CC9:-gcc}" in
u=`uname`
v=`uname -r`
s=`echo $u$v | tr '. ' '__'`
- cflags="$ngflags -g"
+ cflags="$cflags -g"
cflags="$cflags -D__sun__ -D__${s}__"
;;
*AIX*) usexlc
- cflags="$ngflags -g -D__AIX__"
+ cflags="$cflags -g -D__AIX__"
;;
*)
echo 9c does not know how to compile on "$tag" 1>&2
blob - 398adbd8a823d397e2c866253b511ebb2b494435
blob + 875e103ab9776b8fefef19fb8a2e9095461f5258
--- bin/9l
+++ bin/9l
tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}"
case "$tag" in
*DragonFly*|*BSD*)
- ld=${CC9:-gcc}
+ ld="${CC9:-gcc} $CC9FLAGS"
userpath=true
extralibs="$extralibs -lutil"
;;
*OSF1*)
- ld=${CC9:-cc}
+ ld="${CC9:-cc} $CC9FLAGS"
userpath=true
extralibs="$extralibs -lutil"
nmflags="-B"
;;
*Linux*)
- ld=${CC9:-gcc}
+ ld="${CC9:-gcc} $CC9FLAGS"
userpath=true
extralibs="$extralibs -lutil -lresolv -lpthread"
;;
*Darwin*x86_64*)
- ld="${CC9:-gcc} -m64"
+ ld="${CC9:-gcc} -m64 $CC9FLAGS"
;;
*Darwin*)
- ld="${CC9:-gcc} -m32"
+ ld="${CC9:-gcc} -m32 $CC9FLAGS"
;;
*SunOS*)
- ld="${CC9:-cc} -g"
+ ld="${CC9:-cc} -g $CC9FLAGS"
extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
# Record paths to shared libraries to avoid needing LD_LIBRARY_PATH
for i in "$libsl $@"
esac
;;
*AIX*)
- ld="${CC9:-xlc_r} -g -O0"
+ ld="${CC9:-xlc_r} -g -O0 $CC9FLAGS"
nmflags="-A -B"
extralibs="$extralibs -lpthread"
;;
blob - 8fcc9e4187924ed23f84873c731036ede3722e5f
blob + 17411af26752688ab074c31466da68b293f83dc1
--- man/man1/install.1
+++ man/man1/install.1
contains a line
.B WSYSTYPE=nowsys
then the system is built without using X11.
+.B LOCAL.config
+may also list settings for
+.B CC9
+(the host C compiler)
+and
+.B CC9FLAGS
+(any additional flags to pass to the compiler).
+Values more complex than single words should be quoted
+with single quotes.
.PP
On most Linux systems, the X11 header packages need to be installed
to build using X11. On Debian. the required packages are