blob: 6bf7a674255d2afc3912f9cd795ef66987f0f63a [file] [log] [blame]
rscb4e0c542004-02-29 22:53:01 +00001#!/bin/sh
2
3PLAN9=`pwd` export PLAN9
4PATH=$PLAN9/bin:$PATH export PATH
5
rsc7a2c8852005-01-17 21:30:05 +00006echo "Resetting $PLAN9/config"
7rm -f $PLAN9/config
8
rsc95d46632005-01-14 18:02:48 +00009(
rsc7a2c8852005-01-17 21:30:05 +000010if [ `uname` = Linux ]; then
11 # On Linux, we use the kernel version to decide whether
12 # to use pthreads or not. On 2.6 versions that aren't
13 # linking with NPTL by default, pretend to be an older kernel.
14 echo "Running on Linux: checking for NPTL..."
rscd3380282005-01-17 21:38:20 +000015 gcc lib/linux-isnptl.c -lpthread
rsc7a2c8852005-01-17 21:30:05 +000016 if ./a.out
17 then
18 echo " NPTL found."
rsc7ca70592005-01-21 20:21:12 +000019 echo "SYSVERSION=2.6.x" >$PLAN9/config
rsc7a2c8852005-01-17 21:30:05 +000020 else
21 echo " NPTL not found."
rsc7ca70592005-01-21 20:21:12 +000022 echo "SYSVERSION=2.4.x" >$PLAN9/config
rsc7a2c8852005-01-17 21:30:05 +000023 fi
rscb04c42e2005-01-17 21:32:55 +000024 rm -f ./a.out
rsc7a2c8852005-01-17 21:30:05 +000025fi
rsc0070bb82005-01-07 23:11:02 +000026echo "Building mk..."
rscb4e0c542004-02-29 22:53:01 +000027cd src
28make
rsc0070bb82005-01-07 23:11:02 +000029echo "Building everything..."
rscb4e0c542004-02-29 22:53:01 +000030mk clean
rsc722c34e2005-01-14 18:00:26 +000031mk libs-nuke
32mk all
rsc0070bb82005-01-07 23:11:02 +000033echo "Installing everything..."
rsc95d46632005-01-14 18:02:48 +000034mk install
rsc0070bb82005-01-07 23:11:02 +000035echo "Cleaning up..."
rscb4a659b2004-04-19 23:03:46 +000036mk clean
rsc5319e9b2005-01-14 17:58:09 +000037echo "Renaming hard-coded /usr/local/plan9 paths..."
rsc0070bb82005-01-07 23:11:02 +000038cd $PLAN9
39sh lib/moveplan9.sh
rsc5319e9b2005-01-14 17:58:09 +000040echo "Building web manual..."
41cd $PLAN9/dist; mk man
rsc3b1a43f2005-01-18 20:17:42 +000042if [ -x LOCAL.INSTALL ]; then
43 echo "Running local modifications..."
44 ./LOCAL.INSTALL
45fi
rsc5319e9b2005-01-14 17:58:09 +000046
47echo "Done. "
rsc0070bb82005-01-07 23:11:02 +000048echo " "
49echo "Add these to your profile environment."
50echo " PLAN9=$PLAN9 export PLAN9"
51echo ' PATH=$PATH:'"$PLAN9/bin export PATH"
rscb4e0c542004-02-29 22:53:01 +000052
rsc5a2171b2005-01-14 18:26:21 +000053) 2>&1 | tee install.log