2004-02-29 22:53:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PLAN9=`pwd` export PLAN9
|
2005-07-22 18:44:46 +00:00
|
|
|
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-17 21:30:05 +00:00
|
|
|
|
2005-01-14 18:02:48 +00:00
|
|
|
(
|
2005-01-17 21:30:05 +00:00
|
|
|
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
|
2005-01-17 21:30:05 +00:00
|
|
|
then
|
|
|
|
echo " NPTL found."
|
2005-01-21 20:21:12 +00:00
|
|
|
echo "SYSVERSION=2.6.x" >$PLAN9/config
|
2005-01-17 21:30:05 +00:00
|
|
|
else
|
|
|
|
echo " NPTL not found."
|
2005-01-21 20:21:12 +00:00
|
|
|
echo "SYSVERSION=2.4.x" >$PLAN9/config
|
2005-01-17 21:30:05 +00:00
|
|
|
fi
|
2005-01-17 21:32:55 +00:00
|
|
|
rm -f ./a.out
|
2005-01-17 21:30:05 +00:00
|
|
|
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
|
|
|
|
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Building mk..."
|
2004-02-29 22:53:01 +00:00
|
|
|
cd src
|
|
|
|
make
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Building everything (be patient)..."
|
2004-02-29 22:53:01 +00:00
|
|
|
mk clean
|
2005-01-14 18:00:26 +00:00
|
|
|
mk libs-nuke
|
2005-11-26 15:39:46 +00:00
|
|
|
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..."
|
|
|
|
mk install || exit 1
|
|
|
|
if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme ]; then
|
|
|
|
echo " "
|
|
|
|
echo "* Warning: not all binaries built successfully."
|
|
|
|
fi
|
|
|
|
if [ ! -x $PLAN9/bin/cleanname ]; then
|
|
|
|
echo " "
|
|
|
|
echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "* Cleaning up..."
|
2004-04-19 23:03:46 +00:00
|
|
|
mk clean
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Renaming hard-coded /usr/local/plan9 paths..."
|
2005-01-07 23:11:02 +00:00
|
|
|
cd $PLAN9
|
|
|
|
sh lib/moveplan9.sh
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Building web manual..."
|
|
|
|
(
|
|
|
|
cd $PLAN9/dist
|
|
|
|
echo cd `pwd`';' mk man
|
|
|
|
mk man
|
|
|
|
)
|
2005-01-18 20:17:42 +00:00
|
|
|
if [ -x LOCAL.INSTALL ]; then
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Running local modifications..."
|
|
|
|
echo ./LOCAL.INSTALL
|
2005-01-18 20:17:42 +00:00
|
|
|
./LOCAL.INSTALL
|
|
|
|
fi
|
2005-01-14 17:58:09 +00:00
|
|
|
|
2005-11-26 15:39:46 +00:00
|
|
|
echo "* Done. "
|
|
|
|
echo " "
|
|
|
|
echo "* Add these to your profile environment."
|
2005-01-07 23:11:02 +00:00
|
|
|
echo " PLAN9=$PLAN9 export PLAN9"
|
2005-11-26 15:39:46 +00:00
|
|
|
echo ' PATH=$PATH:$PLAN9/bin export PATH'
|
|
|
|
|
|
|
|
) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk | tee install.sum
|
2004-02-29 22:53:01 +00:00
|
|
|
|