4 # Install SBCL files into the usual places.
10 echo "Enter \"$0 --help\" for list of valid options."
17 # Split --foo=bar into --foo and bar.
20 # For ease of scripting skip valued options with empty
22 optarg
=`expr "X$option" : '[^=]*=\(.*\)'` || optarg_ok
=false
23 option
=`expr "X$option" : 'X\([^=]*=\).*'`
32 $optarg_ok || bad_option
"Bad argument for --prefix="
37 --prefix=<path> Specify the install location.
39 See ./INSTALL for more information
44 bad_option
"Unknown command-line option to $0: \"$option\""
53 test -d "$j" || mkdir
-p "$j"
57 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
59 OLD_RUNTIME
=sbcl.exe.old
65 # Before doing anything else, make sure we have an SBCL to install
66 if [ -f src
/runtime
/$RUNTIME ]; then
67 if [ -f output
/sbcl.core
]; then
70 echo "output/sbcl.core not found, aborting installation."
71 echo 'See ./INSTALL, the "SOURCE DISTRIBUTION" section'
75 echo "src/runtime/$RUNTIME not found, aborting installation."
76 echo 'See ./INSTALL, the "SOURCE DISTRIBUTION" section'
81 DEFAULT_INSTALL_ROOT
=$SBCL_PREFIX
83 INSTALL_ROOT
=${INSTALL_ROOT:-$DEFAULT_INSTALL_ROOT}
84 MAN_DIR
=${MAN_DIR:-"$INSTALL_ROOT"/share/man}
85 INFO_DIR
=${INFO_DIR:-"$INSTALL_ROOT"/share/info}
86 DOC_DIR
=${DOC_DIR:-"$INSTALL_ROOT"/share/doc/sbcl}
88 # Does the environment look sane?
89 if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then
90 echo SBCL_HOME environment variable is
set, and conflicts with INSTALL_ROOT.
91 echo Aborting installation. Unset one or
reset the other
, then try again
92 echo INSTALL_ROOT
="$INSTALL_ROOT"
93 echo SBCL_HOME
="$SBCL_HOME"
97 SBCL_HOME
="$INSTALL_ROOT"/lib
/sbcl
98 export SBCL_HOME INSTALL_ROOT
99 ensure_dirs
"$BUILD_ROOT$INSTALL_ROOT" "$BUILD_ROOT$INSTALL_ROOT"/bin \
100 "$BUILD_ROOT$INSTALL_ROOT"/lib \
101 "$BUILD_ROOT$MAN_DIR" "$BUILD_ROOT$MAN_DIR"/man1 \
102 "$BUILD_ROOT$INFO_DIR" "$BUILD_ROOT$DOC_DIR" \
103 "$BUILD_ROOT$DOC_DIR"/html \
104 "$BUILD_ROOT$SBCL_HOME"
106 # move old versions out of the way. Safer than copying: don't want to
107 # break any running instances that have these files mapped
108 test -f "$BUILD_ROOT$INSTALL_ROOT"/bin
/$RUNTIME && \
109 mv "$BUILD_ROOT$INSTALL_ROOT"/bin
/$RUNTIME \
110 "$BUILD_ROOT$INSTALL_ROOT"/bin
/$OLD_RUNTIME
111 test -f "$BUILD_ROOT$SBCL_HOME"/sbcl.core
&& \
112 mv "$BUILD_ROOT$SBCL_HOME"/sbcl.core
"$BUILD_ROOT$SBCL_HOME"/sbcl.core.old
114 cp src
/runtime
/$RUNTIME "$BUILD_ROOT$INSTALL_ROOT"/bin
/
115 cp output
/sbcl.core
"$BUILD_ROOT$SBCL_HOME"/sbcl.core
116 test -f src
/runtime
/libsbcl.so
&& \
117 cp src
/runtime
/libsbcl.so
"$BUILD_ROOT$INSTALL_ROOT"/lib
/
119 cp src
/runtime
/sbcl.mk
"$BUILD_ROOT$SBCL_HOME"/sbcl.mk
120 for i
in $
(grep '^LIBSBCL=' src
/runtime
/sbcl.mk | cut
-d= -f2-) ; do
121 cp "src/runtime/$i" "$BUILD_ROOT$SBCL_HOME/$i"
126 ensure_dirs
"$BUILD_ROOT$SBCL_HOME/contrib/"
127 cp obj
/sbcl-home
/contrib
/* "$BUILD_ROOT$SBCL_HOME/contrib/"
130 echo "SBCL has been installed:"
131 echo " binary $BUILD_ROOT$INSTALL_ROOT/bin/$RUNTIME"
132 echo " core and contribs in $BUILD_ROOT$INSTALL_ROOT/lib/sbcl/"
134 # Installing manual & misc bits of documentation
136 # Locations based on FHS 2.3.
137 # See: <http://www.pathname.com/fhs/pub/fhs-2.3.html>
139 # share/ architecture independent read-only things
140 # share/man/ manpages, should be the same as man/
141 # share/info/ info files
142 # share/doc/ misc documentation
145 echo "Documentation:"
149 $CP doc
/sbcl
.1 "$BUILD_ROOT$MAN_DIR"/man
1/ && echo " man $BUILD_ROOT$MAN_DIR/man1/sbcl.1"
152 for info
in doc
/manual
/*.info
154 test -e $info && $CP $info "$BUILD_ROOT$INFO_DIR"/ \
155 && BN
=`basename $info` \
156 && DIRFAIL
=`install-info --info-dir="$BUILD_ROOT$INFO_DIR" \
157 "$BUILD_ROOT$INFO_DIR"/$BN > /dev/null 2>&1 \
158 || echo "(could not add to system catalog)"` \
159 && echo " info $BUILD_ROOT$INFO_DIR/`basename $info` [$BUILD_ROOT$INFO_DIR/dir] $DIRFAIL"
162 for info
in doc
/manual
/*.info-
*
164 test -e $info && $CP $info "$BUILD_ROOT$INFO_DIR"/ \
165 && echo " info $BUILD_ROOT$INFO_DIR/`basename $info`"
169 for pdf
in doc
/manual
/*.pdf
171 test -e $pdf && $CP $pdf "$BUILD_ROOT$DOC_DIR"/ \
172 && echo " pdf $BUILD_ROOT$DOC_DIR/`basename $pdf`"
176 for html
in doc
/manual
/sbcl
doc
/manual
/asdf
178 test -d $html && $CP -R -L $html "$BUILD_ROOT$DOC_DIR"/html \
179 && echo " html $BUILD_ROOT$DOC_DIR/html/`basename $html`/index.html"
182 for html
in doc
/manual
/sbcl.html
doc
/manual
/asdf.html
184 test -e $html && $CP $html "$BUILD_ROOT$DOC_DIR"/ \
185 && echo " html $BUILD_ROOT$DOC_DIR/`basename $html`"
188 for f
in BUGS CREDITS COPYING NEWS
190 test -e $f && $CP $f "$BUILD_ROOT$DOC_DIR"/