18 echo 'usage: INSTALL [-b | -c]' 1>&2
22 PLAN9=`pwd` export PLAN9
23 PATH=/bin:/usr/bin:$PLAN9/bin:$PATH export PATH
25 echo "* Resetting $PLAN9/config"
29 if [ `uname` = Linux ]; then
30 # On Linux, we use the kernel version to decide whether
31 # to use pthreads or not. On 2.6 versions that aren't
32 # linking with NPTL by default, pretend to be an older kernel.
33 echo "* Running on Linux: checking for NPTL..."
34 gcc lib/linux-isnptl.c -lpthread
38 echo "SYSVERSION=2.6.x" >$PLAN9/config
40 echo " NPTL not found."
41 echo "SYSVERSION=2.4.x" >$PLAN9/config
46 if [ -f LOCAL.config ]; then
47 echo Using LOCAL.config options:
48 sed 's/^/ /' LOCAL.config
49 cat LOCAL.config >>config
54 if [ ! -x ../bin/mk ]; then
55 echo "* Building mk..."
56 ../dist/buildmk 2>&1 | sed 's/^[+] //'
58 if [ ! -x ../bin/mk ]; then
59 echo "* Error: mk failed to build."
63 echo "* Building everything (be patient)..."
67 if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme ]; then
68 echo "* Warning: not all binaries built successfully."
70 echo "* Installing everything in $PLAN9/bin..."
72 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme -o ! -x $PLAN9/bin/sam ]; then
74 echo "* Warning: not all binaries built successfully."
76 echo "* Cleaning up..."
81 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/sam ]; then
82 # Cleanname and sam are needed for moveplan9.sh and the man updates.
83 if [ ! -x $PLAN9/bin/cleanname ]; then
85 echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
88 if [ ! -x $PLAN9/bin/sam ]; then
90 echo "* Installation failed: $PLAN9/bin/sam does not exist."
93 echo "* NOT renaming hard-coded /usr/local/plan9 paths."
94 echo "* NOT building web manual."
96 echo "* Renaming hard-coded /usr/local/plan9 paths..."
99 echo "* Building web manual..."
102 echo cd `pwd`';' mk man
107 if [ -x LOCAL.INSTALL ]; then
108 echo "* Running local modifications..."
109 echo cd `pwd`';' ./LOCAL.INSTALL
115 echo "* Add these to your profile environment."
116 echo " PLAN9=$PLAN9 export PLAN9"
117 echo ' PATH=$PATH:$PLAN9/bin export PATH'
119 ) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk -v 'copy='install.sum