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 echo "* Compiler version:"
30 9c -v 2>&1 | grep -v 'Configured with:' | grep -i version | sed 's/^/ /'
32 if [ `uname` = Linux ]; then
33 # On Linux, we use the kernel version to decide whether
34 # to use pthreads or not. On 2.6 versions that aren't
35 # linking with NPTL by default, pretend to be an older kernel.
36 echo "* Running on Linux: checking for NPTL..."
37 gcc lib/linux-isnptl.c -lpthread
41 echo "SYSVERSION=2.6.x" >$PLAN9/config
43 echo " NPTL not found."
44 echo "SYSVERSION=2.4.x" >$PLAN9/config
49 if [ -f LOCAL.config ]; then
50 echo Using LOCAL.config options:
51 sed 's/^/ /' LOCAL.config
52 cat LOCAL.config >>config
57 if [ ! -x ../bin/mk ]; then
58 echo "* Building mk..."
59 ../dist/buildmk 2>&1 | sed 's/^[+] //'
61 if [ ! -x ../bin/mk ]; then
62 echo "* Error: mk failed to build."
66 echo "* Building everything (be patient)..."
70 if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme ]; then
71 echo "* Warning: not all binaries built successfully."
73 echo "* Installing everything in $PLAN9/bin..."
75 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme -o ! -x $PLAN9/bin/sam ]; then
77 echo "* Warning: not all binaries built successfully."
79 echo "* Cleaning up..."
84 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/sam ]; then
85 # Cleanname and sam are needed for moveplan9.sh and the man updates.
86 if [ ! -x $PLAN9/bin/cleanname ]; then
88 echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
91 if [ ! -x $PLAN9/bin/sam ]; then
93 echo "* Installation failed: $PLAN9/bin/sam does not exist."
96 echo "* NOT renaming hard-coded /usr/local/plan9 paths."
97 echo "* NOT building web manual."
99 echo "* Renaming hard-coded /usr/local/plan9 paths..."
102 echo "* Building web manual..."
105 echo cd `pwd`';' mk man
110 if [ -x LOCAL.INSTALL ]; then
111 echo "* Running local modifications..."
112 echo cd `pwd`';' ./LOCAL.INSTALL
118 echo "* Add these to your profile environment."
119 echo " PLAN9=$PLAN9 export PLAN9"
120 echo ' PATH=$PATH:$PLAN9/bin export PATH'
122 ) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk -v 'copy='install.sum