2004-02-29 22:53:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PLAN9=`pwd` export PLAN9
|
|
|
|
PATH=$PLAN9/bin:$PATH export PATH
|
|
|
|
|
2005-01-17 21:30:05 +00:00
|
|
|
echo "Resetting $PLAN9/config"
|
|
|
|
rm -f $PLAN9/config
|
|
|
|
|
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.
|
|
|
|
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-01-07 23:11:02 +00:00
|
|
|
echo "Building mk..."
|
2004-02-29 22:53:01 +00:00
|
|
|
cd src
|
|
|
|
make
|
2005-01-07 23:11:02 +00:00
|
|
|
echo "Building everything..."
|
2004-02-29 22:53:01 +00:00
|
|
|
mk clean
|
2005-01-14 18:00:26 +00:00
|
|
|
mk libs-nuke
|
|
|
|
mk all
|
2005-01-07 23:11:02 +00:00
|
|
|
echo "Installing everything..."
|
2005-01-14 18:02:48 +00:00
|
|
|
mk install
|
2005-01-07 23:11:02 +00:00
|
|
|
echo "Cleaning up..."
|
2004-04-19 23:03:46 +00:00
|
|
|
mk clean
|
2005-01-14 17:58:09 +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-01-14 17:58:09 +00:00
|
|
|
echo "Building web manual..."
|
|
|
|
cd $PLAN9/dist; mk man
|
2005-01-18 20:17:42 +00:00
|
|
|
if [ -x LOCAL.INSTALL ]; then
|
|
|
|
echo "Running local modifications..."
|
|
|
|
./LOCAL.INSTALL
|
|
|
|
fi
|
2005-01-14 17:58:09 +00:00
|
|
|
|
|
|
|
echo "Done. "
|
2005-01-07 23:11:02 +00:00
|
|
|
echo " "
|
|
|
|
echo "Add these to your profile environment."
|
|
|
|
echo " PLAN9=$PLAN9 export PLAN9"
|
|
|
|
echo ' PATH=$PATH:'"$PLAN9/bin export PATH"
|
2004-02-29 22:53:01 +00:00
|
|
|
|
2005-01-14 18:26:21 +00:00
|
|
|
) 2>&1 | tee install.log
|