Blob


1 #!/bin/sh
3 PLAN9=`pwd` export PLAN9
4 PATH=/bin:/usr/bin:$PLAN9/bin:$PATH export PATH
6 echo "* Resetting $PLAN9/config"
7 rm -f config
9 (
10 if [ `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..."
15 gcc lib/linux-isnptl.c -lpthread
16 if ./a.out >/dev/null
17 then
18 echo " NPTL found."
19 echo "SYSVERSION=2.6.x" >$PLAN9/config
20 else
21 echo " NPTL not found."
22 echo "SYSVERSION=2.4.x" >$PLAN9/config
23 fi
24 rm -f ./a.out
25 fi
27 if [ -f LOCAL.config ]; then
28 echo Using LOCAL.config options:
29 sed 's/^/ /' LOCAL.config
30 cat LOCAL.config >>config
31 fi
33 echo "* Building mk..."
34 cd src
35 make
36 echo "* Building everything (be patient)..."
37 mk clean
38 mk libs-nuke
39 mk all || exit 1
40 if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme ]; then
41 echo "* Warning: not all binaries built successfully."
42 fi
43 echo "* Installing everything..."
44 mk install || exit 1
45 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme ]; then
46 echo " "
47 echo "* Warning: not all binaries built successfully."
48 fi
49 if [ ! -x $PLAN9/bin/cleanname ]; then
50 echo " "
51 echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
52 exit 1
53 fi
54 echo "* Cleaning up..."
55 mk clean
56 echo "* Renaming hard-coded /usr/local/plan9 paths..."
57 cd $PLAN9
58 sh lib/moveplan9.sh
59 echo "* Building web manual..."
60 (
61 cd $PLAN9/dist
62 echo cd `pwd`';' mk man
63 mk man
64 )
65 if [ -x LOCAL.INSTALL ]; then
66 echo "* Running local modifications..."
67 echo ./LOCAL.INSTALL
68 ./LOCAL.INSTALL
69 fi
71 echo "* Done. "
72 echo " "
73 echo "* Add these to your profile environment."
74 echo " PLAN9=$PLAN9 export PLAN9"
75 echo ' PATH=$PATH:$PLAN9/bin export PATH'
77 ) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk | tee install.sum