0.7.12.50
[sbcl.git] / install.sh
1 #!/bin/sh
2
3 # Install SBCL files into the usual places.
4
5 ensure_dirs () 
6 {
7     for j in $*; do 
8         test -d $j || mkdir $j
9     done;
10 }
11
12 INSTALL_ROOT=${INSTALL_ROOT-/usr/local}
13 SBCL_SOURCE=`pwd`
14 if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then
15    echo SBCL_HOME environment variable is set, and conflicts with INSTALL_ROOT.
16    echo Aborting installation.  Unset one or reset the other, then try again
17    echo INSTALL_ROOT="$INSTALL_ROOT"
18    echo SBCL_HOME="$SBCL_HOME"
19    exit 1
20 fi
21 SBCL_HOME=$INSTALL_ROOT/lib/sbcl
22 export SBCL_HOME
23 ensure_dirs $INSTALL_ROOT $INSTALL_ROOT/bin $INSTALL_ROOT/lib \
24     $INSTALL_ROOT/man $INSTALL_ROOT/man/man1 \
25     $SBCL_HOME $SBCL_HOME/systems
26
27 test -e $INSTALL_ROOT/bin/sbcl && \
28     cp $INSTALL_ROOT/bin/sbcl $INSTALL_ROOT/bin/sbcl.old
29 test -e $SBCL_HOME/sbcl.core && \
30     cp $SBCL_HOME/sbcl.core $SBCL_HOME/sbcl.core.old
31
32 cp src/runtime/sbcl $INSTALL_ROOT/bin/
33 cp output/sbcl.core $SBCL_HOME/sbcl.core
34 cp doc/sbcl.1 $INSTALL_ROOT/man/man1/
35
36 # installing contrib 
37
38 SBCL="`pwd`/src/runtime/sbcl --noinform --core `pwd`/output/sbcl.core --userinit /dev/null --sysinit /dev/null --disable-debugger"
39 SBCL_BUILDING_CONTRIB=1
40 export SBCL SBCL_BUILDING_CONTRIB
41
42 gnumake=${GNUMAKE:-gmake}
43 for i in contrib/*; do
44     test -d $i && test -f $i/test-passed || continue;
45     export INSTALL_DIR=$SBCL_HOME/`basename $i `
46     ensure_dirs $INSTALL_DIR && $gnumake -C $i install
47 done