X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=install.sh;h=6e11bd1e7bb8074eed663f31ab18026f238c61cf;hb=f8893c7c658bf9d9e0757c63e47af2fdea810f04;hp=5fab6a2968d67b316a60dcb28d5b9e2b20950cc5;hpb=edc8da40fb17de047e290ed6bd819e096e435dc9;p=sbcl.git diff --git a/install.sh b/install.sh index 5fab6a2..6e11bd1 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ # Install SBCL files into the usual places. -function ensure_dirs () +ensure_dirs () { for j in $*; do test -d $j || mkdir $j @@ -10,6 +10,7 @@ function ensure_dirs () } INSTALL_ROOT=${INSTALL_ROOT-/usr/local} +MAN_DIR=${MAN_DIR-$INSTALL_ROOT/share/man} 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. @@ -19,27 +20,36 @@ if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then 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 +export SBCL_HOME INSTALL_ROOT +ensure_dirs $BUILD_ROOT$INSTALL_ROOT $BUILD_ROOT$INSTALL_ROOT/bin \ + $BUILD_ROOT$INSTALL_ROOT/lib \ + $MAN_DIR $MAN_DIR/man1 \ + $BUILD_ROOT$SBCL_HOME $BUILD_ROOT$SBCL_HOME/systems \ + $BUILD_ROOT$SBCL_HOME/site-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 +# move old versions out of the way. Safer than copying: don't want to +# break any running instances that have these files mapped +test -f $BUILD_ROOT$INSTALL_ROOT/bin/sbcl && \ + mv $BUILD_ROOT$INSTALL_ROOT/bin/sbcl $BUILD_ROOT$INSTALL_ROOT/bin/sbcl.old +test -f $BUILD_ROOT$SBCL_HOME/sbcl.core && \ + mv $BUILD_ROOT$SBCL_HOME/sbcl.core $BUILD_ROOT$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/ +cp src/runtime/sbcl $BUILD_ROOT$INSTALL_ROOT/bin/ +cp output/sbcl.core $BUILD_ROOT$SBCL_HOME/sbcl.core +cp doc/sbcl.1 $MAN_DIR/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 + +. ./find-gnumake.sh +find_gnumake + 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 + test -d $i && test -f $i/test-passed || continue; + INSTALL_DIR=$SBCL_HOME/`basename $i ` + export INSTALL_DIR + ensure_dirs $BUILD_ROOT$INSTALL_DIR && $GNUMAKE -C $i install done