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 "+ Mailing list: http://groups.google.com/group/plan9port-dev"
26 echo "+ Issue tracker: http://code.swtch.com/plan9port/issues/"
27 echo "+ Submitting changes: http://swtch.com/go/codereview"
29 echo "* Resetting $PLAN9/config"
33 echo "* Compiler version:"
34 9c -v 2>&1 | grep -v 'Configured with:' | grep -i version | sed 's/^/ /'
36 if [ `uname` = Linux ]; then
37 # On Linux, we use the kernel version to decide whether
38 # to use pthreads or not. On 2.6 versions that aren't
39 # linking with NPTL by default, pretend to be an older kernel.
40 echo "* Running on Linux: checking for NPTL..."
41 gcc lib/linux-isnptl.c -lpthread
45 echo "SYSVERSION=2.6.x" >$PLAN9/config
47 echo " NPTL not found."
48 echo "SYSVERSION=2.4.x" >$PLAN9/config
53 if [ -f LOCAL.config ]; then
54 echo Using LOCAL.config options:
55 sed 's/^/ /' LOCAL.config
56 cat LOCAL.config >>config
61 if [ ! -x ../bin/mk ]; then
62 echo "* Building mk..."
63 ../dist/buildmk 2>&1 | sed 's/^[+] //'
65 if [ ! -x ../bin/mk ]; then
66 echo "* Error: mk failed to build."
70 echo "* Building everything (be patient)..."
74 if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme ]; then
75 echo "* Warning: not all binaries built successfully."
77 echo "* Installing everything in $PLAN9/bin..."
79 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme -o ! -x $PLAN9/bin/sam ]; then
81 echo "* Warning: not all binaries built successfully."
83 echo "* Cleaning up..."
88 if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/sam ]; then
89 # Cleanname and sam are needed for moveplan9.sh and the man updates.
90 if [ ! -x $PLAN9/bin/cleanname ]; then
92 echo "* Installation failed: $PLAN9/bin/cleanname does not exist."
95 if [ ! -x $PLAN9/bin/sam ]; then
97 echo "* Installation failed: $PLAN9/bin/sam does not exist."
100 echo "* NOT renaming hard-coded /usr/local/plan9 paths."
101 echo "* NOT building web manual."
103 echo "* Renaming hard-coded /usr/local/plan9 paths..."
106 echo "* Building web manual..."
109 echo cd `pwd`';' mk man
114 if [ -x LOCAL.INSTALL ]; then
115 echo "* Running local modifications..."
116 echo cd `pwd`';' ./LOCAL.INSTALL
122 echo "* Add these to your profile environment."
123 echo " PLAN9=$PLAN9 export PLAN9"
124 echo ' PATH=$PATH:$PLAN9/bin export PATH'
126 ) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk -v 'copy='install.sum