0.9.11:
[sbcl/simd.git] / install.sh
bloba2399f00ece9b29dd97e2c1e471334bc89709814
1 #!/bin/sh
2 set -e
4 # Install SBCL files into the usual places.
6 ensure_dirs ()
8 for j in $*; do
9 test -d $j || mkdir -p $j
10 done;
13 INSTALL_ROOT=${INSTALL_ROOT-/usr/local}
14 MAN_DIR=${MAN_DIR-$INSTALL_ROOT/share/man}
15 INFO_DIR=${INFO_DIR-$INSTALL_ROOT/share/info}
16 DOC_DIR=${DOC_DIR-$INSTALL_ROOT/share/doc/sbcl}
18 # Does the environment look sane?
19 SBCL_SOURCE=`pwd`
20 if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then
21 echo SBCL_HOME environment variable is set, and conflicts with INSTALL_ROOT.
22 echo Aborting installation. Unset one or reset the other, then try again
23 echo INSTALL_ROOT="$INSTALL_ROOT"
24 echo SBCL_HOME="$SBCL_HOME"
25 exit 1
28 # Before doing anything else, make sure we have an SBCL to install
29 if [ -f src/runtime/sbcl ]; then
30 if [ -f output/sbcl.core ]; then
31 true
32 else
33 echo "output/sbcl.core not found, aborting installation."
34 exit 1
36 else
37 echo "src/runtime/sbcl not found, aborting installation."
38 exit 1
41 SBCL_HOME=$INSTALL_ROOT/lib/sbcl
42 export SBCL_HOME INSTALL_ROOT
43 ensure_dirs $BUILD_ROOT$INSTALL_ROOT $BUILD_ROOT$INSTALL_ROOT/bin \
44 $BUILD_ROOT$INSTALL_ROOT/lib \
45 $BUILD_ROOT$MAN_DIR $BUILD_ROOT$MAN_DIR/man1 \
46 $BUILD_ROOT$INFO_DIR $BUILD_ROOT$DOC_DIR \
47 $BUILD_ROOT$DOC_DIR/html \
48 $BUILD_ROOT$SBCL_HOME \
49 $BUILD_ROOT$SBCL_HOME/site-systems
51 # move old versions out of the way. Safer than copying: don't want to
52 # break any running instances that have these files mapped
53 test -f $BUILD_ROOT$INSTALL_ROOT/bin/sbcl && \
54 mv $BUILD_ROOT$INSTALL_ROOT/bin/sbcl $BUILD_ROOT$INSTALL_ROOT/bin/sbcl.old
55 test -f $BUILD_ROOT$SBCL_HOME/sbcl.core && \
56 mv $BUILD_ROOT$SBCL_HOME/sbcl.core $BUILD_ROOT$SBCL_HOME/sbcl.core.old
58 cp src/runtime/sbcl $BUILD_ROOT$INSTALL_ROOT/bin/
59 cp output/sbcl.core $BUILD_ROOT$SBCL_HOME/sbcl.core
61 # installing contrib
63 SBCL="`pwd`/src/runtime/sbcl --noinform --core `pwd`/output/sbcl.core --userinit /dev/null --sysinit /dev/null --disable-debugger"
64 SBCL_BUILDING_CONTRIB=1
65 export SBCL SBCL_BUILDING_CONTRIB
67 . ./find-gnumake.sh
68 find_gnumake
70 for i in contrib/*; do
71 test -d $i && test -f $i/test-passed || continue;
72 INSTALL_DIR=$SBCL_HOME/`basename $i `
73 export INSTALL_DIR
74 ensure_dirs $BUILD_ROOT$INSTALL_DIR && $GNUMAKE -C $i install
75 done
77 echo
78 echo "SBCL has been installed:"
79 echo " binary $BUILD_ROOT$INSTALL_ROOT/bin/sbcl"
80 echo " core and contribs in $BUILD_ROOT$INSTALL_ROOT/lib/sbcl/"
82 # Installing manual & misc bits of documentation
84 # Locations based on FHS 2.3.
85 # See: <http://www.pathname.com/fhs/pub/fhs-2.3.html>
87 # share/ architecture independent read-only things
88 # share/man/ manpages, should be the same as man/
89 # share/info/ info files
90 # share/doc/ misc documentation
92 echo
93 echo "Documentation:"
95 # man
96 cp doc/sbcl.1 $BUILD_ROOT$MAN_DIR/man1/ && echo " man $BUILD_ROOT$MAN_DIR/man1/sbcl.1"
98 # info
99 for info in doc/manual/*.info
101 cp $info $BUILD_ROOT$INFO_DIR/ \
102 && echo -n " info $BUILD_ROOT$INFO_DIR/`basename $info` $BUILD_ROOT$INFO_DIR/dir" \
103 && ( install-info $BUILD_ROOT$INFO_DIR/`basename $info` $BUILD_ROOT$INFO_DIR/dir > /dev/null 2>&1 \
104 || echo -n " (could not add to system catalog)" ) \
105 && echo
106 done
108 # pdf
109 for pdf in doc/manual/*.pdf
111 cp $pdf $BUILD_ROOT$DOC_DIR/ \
112 && echo " pdf $BUILD_ROOT$DOC_DIR/`basename $pdf`"
113 done
115 # html
116 for html in doc/manual/sbcl doc/manual/asdf
118 test -d $html && cp -R -L $html $BUILD_ROOT$DOC_DIR/html \
119 && echo " html $BUILD_ROOT$DOC_DIR/html/`basename $html`/index.html"
120 done
122 for f in BUGS SUPPORT CREDITS COPYING NEWS
124 cp $f $BUILD_ROOT$DOC_DIR/
125 done