INSTALL: fix compiler detection on FreeBSD+clang (#177)

This commit is contained in:
Francis Conti 2018-11-13 21:23:40 -08:00 committed by Russ Cox
parent 000c1a3b19
commit 9c38253d1d

41
INSTALL
View file

@ -15,9 +15,9 @@ x-c)
doinstall=true doinstall=true
;; ;;
x-r) x-r)
shift shift
PLAN9_TARGET=$1 export PLAN9_TARGET PLAN9_TARGET=$1 export PLAN9_TARGET
;; ;;
*) *)
echo 'usage: INSTALL [-b | -c] [-r path]' 1>&2 echo 'usage: INSTALL [-b | -c] [-r path]' 1>&2
exit 1 exit 1
@ -42,23 +42,27 @@ echo "* Resetting $PLAN9/config"
rm -f config rm -f config
( (
echo "* Compiler version:"
9c -v 2>&1 | grep -v 'Configured with:' | grep -i version | sed 's/^/ /'
if [ `uname` = FreeBSD ]; then if [ `uname` = FreeBSD ]; then
echo "* Running on FreeBSD, adjusting linker flags" case `cc -v 2>&1` in
echo "LDFLAGS='-L/usr/local/lib'" >> $PLAN9/config *clang*)
echo "CC9=clang" >> $PLAN9/config
;;
*)
;;
esac
echo "* Running on FreeBSD, adjusting linker flags"
echo "LDFLAGS='-L/usr/local/lib'" >> $PLAN9/config
fi fi
if [ `uname` = DragonFly ]; then if [ `uname` = DragonFly ]; then
echo "* Running on DragonFly BSD, adjusting linker flags" echo "* Running on DragonFly BSD, adjusting linker flags"
echo "LDFLAGS='-L/usr/local/lib -pthread'" >> $PLAN9/config echo "LDFLAGS='-L/usr/local/lib -pthread'" >> $PLAN9/config
echo "CFLAGS='-pthread'" >> $PLAN9/config echo "CFLAGS='-pthread'" >> $PLAN9/config
fi fi
if [ `uname` = OpenBSD ]; then if [ `uname` = OpenBSD ]; then
echo "* Running on OpenBSD, adjusting linker flags" echo "* Running on OpenBSD, adjusting linker flags"
echo "LDFLAGS='-L/usr/X11R6/lib -pthread'" >> $PLAN9/config echo "LDFLAGS='-L/usr/X11R6/lib -pthread'" >> $PLAN9/config
fi fi
if [ `uname` = Linux ]; then if [ `uname` = Linux ]; then
@ -80,8 +84,8 @@ fi
if [ `uname` = SunOS ]; then if [ `uname` = SunOS ]; then
# On Solaris x86, uname -p cannot be trusted. # On Solaris x86, uname -p cannot be trusted.
echo "* Running on Solaris: checking architecture..." echo "* Running on Solaris: checking architecture..."
case "$(isainfo -n)" in case "$(isainfo -n)" in
*amd64*) *amd64*)
echo " x86-64 found." echo " x86-64 found."
echo "OBJTYPE=x86_64" >>$PLAN9/config echo "OBJTYPE=x86_64" >>$PLAN9/config
@ -92,7 +96,7 @@ if [ `uname` = SunOS ]; then
echo "OBJTYPE=386" >>$PLAN9/config echo "OBJTYPE=386" >>$PLAN9/config
echo "CC9=gcc" >>$PLAN9/config # defaults to gcc on Solaris/i386 echo "CC9=gcc" >>$PLAN9/config # defaults to gcc on Solaris/i386
;; ;;
*sparc*) *sparc*)
echo " Sparc found." echo " Sparc found."
echo "OBJTYPE=sparc" >>$PLAN9/config echo "OBJTYPE=sparc" >>$PLAN9/config
;; ;;
@ -118,7 +122,7 @@ if [ `uname` = Darwin ]; then
echo "OBJTYPE=386" >>$PLAN9/config echo "OBJTYPE=386" >>$PLAN9/config
;; ;;
*ppc*) *ppc*)
echo " power found." echo " power found."
echo "OBJTYPE=power" >>$PLAN9/config echo "OBJTYPE=power" >>$PLAN9/config
;; ;;
esac esac
@ -147,6 +151,9 @@ if [ -f LOCAL.config ]; then
cat LOCAL.config >>config cat LOCAL.config >>config
fi fi
echo "* Compiler version:"
9c -v 2>&1 | grep -v 'Configured with:' | grep -i version | sed 's/^/ /'
cd src cd src
if $dobuild; then if $dobuild; then
if [ ! -x ../bin/mk ]; then if [ ! -x ../bin/mk ]; then