X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=install.sh;h=5fab6a2968d67b316a60dcb28d5b9e2b20950cc5;hb=8d404ad80075771ffb783fda8a7328982a67f820;hp=5cad78c4decfe8f204eab9562cd629832b04d0b5;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/install.sh b/install.sh index 5cad78c..5fab6a2 100644 --- a/install.sh +++ b/install.sh @@ -2,6 +2,44 @@ # Install SBCL files into the usual places. -cp src/runtime/sbcl /usr/local/bin/ -cp output/sbcl.core /usr/local/lib/ -cp doc/sbcl.1 /usr/local/man/man1/ +function ensure_dirs () +{ + for j in $*; do + test -d $j || mkdir $j + done; +} + +INSTALL_ROOT=${INSTALL_ROOT-/usr/local} +SBCL_SOURCE=`pwd` +if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then + echo SBCL_HOME environment variable is set, and conflicts with INSTALL_ROOT. + echo Aborting installation. Unset one or reset the other, then try again + echo INSTALL_ROOT="$INSTALL_ROOT" + echo SBCL_HOME="$SBCL_HOME" + exit 1 +fi +SBCL_HOME=$INSTALL_ROOT/lib/sbcl +export SBCL_HOME +ensure_dirs $INSTALL_ROOT $INSTALL_ROOT/bin $INSTALL_ROOT/lib \ + $INSTALL_ROOT/man $INSTALL_ROOT/man/man1 \ + $SBCL_HOME $SBCL_HOME/systems + +test -a $INSTALL_ROOT/bin/sbcl && \ + cp $INSTALL_ROOT/bin/sbcl $INSTALL_ROOT/bin/sbcl.old +test -a $SBCL_HOME/sbcl.core && \ + cp $SBCL_HOME/sbcl.core $SBCL_HOME/sbcl.core.old + +cp src/runtime/sbcl $INSTALL_ROOT/bin/ +cp output/sbcl.core $SBCL_HOME/sbcl.core +cp doc/sbcl.1 $INSTALL_ROOT/man/man1/ + +# installing contrib + +SBCL="`pwd`/src/runtime/sbcl --noinform --core `pwd`/output/sbcl.core --userinit /dev/null --sysinit /dev/null --disable-debugger" +SBCL_BUILDING_CONTRIB=1 +export SBCL SBCL_BUILDING_CONTRIB +for i in contrib/*; do + test -d $i || continue; + export INSTALL_DIR=$SBCL_HOME/`basename $i ` + make -C $i test && ensure_dirs $INSTALL_DIR && make -C $i install +done