#! /bin/sh # This script is for bootstrapping a new install. It should live in # /local/src or equivalent and must be run from that same directory. if [ ! \( -d c-publish -a -d ccwrapper -a -d makefiles -a -d makewrapper \) ]; then echo Incorrect current directory '(subdirs)'. 1>&2 exit 1 fi case ${LOCALROOT+set} in set) ;; *) lr="`pwd`" lr=${lr%/src} export LOCALROOT=$lr ;; esac d1="`pwd`" d2="`cd $LOCALROOT/src; pwd`" case "$d1" in "$d2") ;; *) echo Incorrect current directory '(not src)'. 1>&2 exit 1 ;; esac set -x cd $LOCALROOT rm -rf .bin .etc .include .lib .man .var bin etc include lib man var mkdir -p .bin .etc .include .lib .man .var bin etc include lib man var cd man mkdir -p man1 man2 man3 man4 man5 man6 man7 man8 man9 mkdir -p cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9 cd $LOCALROOT ln -s makefiles lib/make ln -s makewrapper bin/make ln -s ccwrapper bin/cc ln -s ccwrapper bin/gcc (cd src/makefiles && sh TRANSCRIPT) (cd src/makewrapper && sh TRANSCRIPT) ln -s $LOCALROOT/.bin/makewrapper*/makewrapper $LOCALROOT/bin/makewrapper ln -s $LOCALROOT/.lib/makefiles*/makefiles $LOCALROOT/lib/makefiles PATH=$LOCALROOT/bin:$PATH (cd src/ccwrapper && sh TRANSCRIPT) ln -s $LOCALROOT/.bin/ccwrapper*/ccwrapper $LOCALROOT/bin/ccwrapper (cd src/c-publish && sh TRANSCRIPT && $LOCALROOT/.bin/c-publish*/publish .) rm -f $LOCALROOT/bin/ccwrapper (cd src/ccwrapper && $LOCALROOT/bin/publish .) rm -f $LOCALROOT/bin/makewrapper (cd src/makewrapper && $LOCALROOT/bin/publish .) rm -f $LOCALROOT/lib/makefiles (cd src/makefiles && $LOCALROOT/bin/publish -L .)