plan9port/INSTALL

124 lines
2.7 KiB
Text
Raw Normal View History

2004-02-29 22:53:01 +00:00
#!/bin/sh
2005-12-30 18:52:40 +00:00
dobuild=true
doinstall=true
case "x$1" in
x)
;;
x-b)
dobuild=true
doinstall=false
;;
x-c)
dobuild=false
doinstall=true
;;
*)
echo 'usage: INSTALL [-b | -c]' 1>&2
exit 1
esac
2004-02-29 22:53:01 +00:00
PLAN9=`pwd` export PLAN9
PATH=/bin:/usr/bin:$PLAN9/bin:$PATH export PATH
2004-02-29 22:53:01 +00:00
2005-11-26 15:39:46 +00:00
echo "* Resetting $PLAN9/config"
2005-02-02 22:08:10 +00:00
rm -f config
2005-01-14 18:02:48 +00:00
(
2008-05-10 17:34:32 +00:00
echo "* Compiler version:"
9c -v 2>&1 | grep -i version | sed 's/^/ /'
if [ `uname` = Linux ]; then
# On Linux, we use the kernel version to decide whether
# to use pthreads or not. On 2.6 versions that aren't
# linking with NPTL by default, pretend to be an older kernel.
2005-11-26 15:39:46 +00:00
echo "* Running on Linux: checking for NPTL..."
2005-01-17 21:38:20 +00:00
gcc lib/linux-isnptl.c -lpthread
2005-01-23 01:55:42 +00:00
if ./a.out >/dev/null
then
echo " NPTL found."
2005-01-21 20:21:12 +00:00
echo "SYSVERSION=2.6.x" >$PLAN9/config
else
echo " NPTL not found."
2005-01-21 20:21:12 +00:00
echo "SYSVERSION=2.4.x" >$PLAN9/config
fi
2005-01-17 21:32:55 +00:00
rm -f ./a.out
fi
2005-02-02 22:08:10 +00:00
if [ -f LOCAL.config ]; then
echo Using LOCAL.config options:
sed 's/^/ /' LOCAL.config
cat LOCAL.config >>config
fi
2004-02-29 22:53:01 +00:00
cd src
2005-12-30 18:52:40 +00:00
if $dobuild; then
if [ ! -x ../bin/mk ]; then
echo "* Building mk..."
../dist/buildmk 2>&1 | sed 's/^[+] //'
fi
if [ ! -x ../bin/mk ]; then
echo "* Error: mk failed to build."
2005-11-28 21:14:44 +00:00
exit 1
fi
2005-12-30 18:52:40 +00:00
echo "* Building everything (be patient)..."
mk clean
mk libs-nuke
mk all || exit 1
if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme ]; then
echo "* Warning: not all binaries built successfully."
fi
echo "* Installing everything in $PLAN9/bin..."
mk install || exit 1
if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme -o ! -x $PLAN9/bin/sam ]; then
2005-11-28 21:14:44 +00:00
echo " "
2005-12-30 18:52:40 +00:00
echo "* Warning: not all binaries built successfully."
2005-11-28 21:14:44 +00:00
fi
2005-12-30 18:52:40 +00:00
echo "* Cleaning up..."
mk clean
2005-11-28 21:14:44 +00:00
fi
2005-12-30 18:52:40 +00:00
if $doinstall; then
if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/sam ]; then
# Cleanname and sam are needed for moveplan9.sh and the man updates.
if [ ! -x $PLAN9/bin/cleanname ]; then
echo " "
echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
exit 1
fi
if [ ! -x $PLAN9/bin/sam ]; then
echo " "
echo "* Installation failed: $PLAN9/bin/sam does not exist."
exit 1
fi
echo "* NOT renaming hard-coded /usr/local/plan9 paths."
echo "* NOT building web manual."
else
echo "* Renaming hard-coded /usr/local/plan9 paths..."
cd $PLAN9
sh lib/moveplan9.sh
echo "* Building web manual..."
(
cd $PLAN9/dist
echo cd `pwd`';' mk man
mk man
)
fi
if [ -x LOCAL.INSTALL ]; then
echo "* Running local modifications..."
echo cd `pwd`';' ./LOCAL.INSTALL
./LOCAL.INSTALL
fi
echo "* Done. "
echo " "
echo "* Add these to your profile environment."
echo " PLAN9=$PLAN9 export PLAN9"
echo ' PATH=$PATH:$PLAN9/bin export PATH'
2005-01-18 20:17:42 +00:00
fi
2006-07-24 19:05:01 +00:00
) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk -v 'copy='install.sum
2004-02-29 22:53:01 +00:00