Provide os_context_float_register_addr on darwin-x86-64.
[sbcl.git] / install.sh
blobdc737e6773d01c9b19679688681aeb817b31784e
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 . output/prefix.def
14 DEFAULT_INSTALL_ROOT=$SBCL_PREFIX
16 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
17 RUNTIME=sbcl.exe
18 OLD_RUNTIME=sbcl.exe.old
19 else
20 RUNTIME=sbcl
21 OLD_RUNTIME=sbcl.old
23 INSTALL_ROOT=${INSTALL_ROOT-$DEFAULT_INSTALL_ROOT}
24 MAN_DIR=${MAN_DIR-"$INSTALL_ROOT"/share/man}
25 INFO_DIR=${INFO_DIR-"$INSTALL_ROOT"/share/info}
26 DOC_DIR=${DOC_DIR-"$INSTALL_ROOT"/share/doc/sbcl}
28 # Does the environment look sane?
29 if [ -n "$SBCL_HOME" -a "$INSTALL_ROOT/lib/sbcl" != "$SBCL_HOME" ];then
30 echo SBCL_HOME environment variable is set, and conflicts with INSTALL_ROOT.
31 echo Aborting installation. Unset one or reset the other, then try again
32 echo INSTALL_ROOT="$INSTALL_ROOT"
33 echo SBCL_HOME="$SBCL_HOME"
34 exit 1
37 # Before doing anything else, make sure we have an SBCL to install
38 if [ -f src/runtime/$RUNTIME ]; then
39 if [ -f output/sbcl.core ]; then
40 true
41 else
42 echo "output/sbcl.core not found, aborting installation."
43 exit 1
45 else
46 echo "src/runtime/$RUNTIME not found, aborting installation."
47 exit 1
50 SBCL_HOME="$INSTALL_ROOT"/lib/sbcl
51 export SBCL_HOME INSTALL_ROOT
52 ensure_dirs "$BUILD_ROOT$INSTALL_ROOT" "$BUILD_ROOT$INSTALL_ROOT"/bin \
53 "$BUILD_ROOT$INSTALL_ROOT"/lib \
54 "$BUILD_ROOT$MAN_DIR" "$BUILD_ROOT$MAN_DIR"/man1 \
55 "$BUILD_ROOT$INFO_DIR" "$BUILD_ROOT$DOC_DIR" \
56 "$BUILD_ROOT$DOC_DIR"/html \
57 "$BUILD_ROOT$SBCL_HOME"
59 # move old versions out of the way. Safer than copying: don't want to
60 # break any running instances that have these files mapped
61 test -f "$BUILD_ROOT$INSTALL_ROOT"/bin/$RUNTIME && \
62 mv "$BUILD_ROOT$INSTALL_ROOT"/bin/$RUNTIME \
63 "$BUILD_ROOT$INSTALL_ROOT"/bin/$OLD_RUNTIME
64 test -f "$BUILD_ROOT$SBCL_HOME"/sbcl.core && \
65 mv "$BUILD_ROOT$SBCL_HOME"/sbcl.core "$BUILD_ROOT$SBCL_HOME"/sbcl.core.old
67 cp src/runtime/$RUNTIME "$BUILD_ROOT$INSTALL_ROOT"/bin/
68 cp output/sbcl.core "$BUILD_ROOT$SBCL_HOME"/sbcl.core
69 cp src/runtime/sbcl.mk "$BUILD_ROOT$SBCL_HOME"/sbcl.mk
70 for i in $(grep '^LIBSBCL=' src/runtime/sbcl.mk | cut -d= -f2-) ; do
71 cp "src/runtime/$i" "$BUILD_ROOT$SBCL_HOME/$i"
72 done
74 # installing contrib
76 . ./sbcl-pwd.sh
77 sbcl_pwd
79 SBCL="$SBCL_PWD/src/runtime/sbcl --noinform --core $SBCL_PWD/output/sbcl.core --no-userinit --no-sysinit --disable-debugger"
80 SBCL_BUILDING_CONTRIB=1
81 export SBCL SBCL_BUILDING_CONTRIB SBCL_PWD
83 . ./find-gnumake.sh
84 find_gnumake
86 for i in `cd obj/asdf-cache ; echo *`; do
87 test -d obj/asdf-cache/$i && test -f obj/asdf-cache/$i/test-passed.test-report || continue;
88 INSTALL_DIR="$SBCL_HOME/contrib/"
89 export INSTALL_DIR
90 ensure_dirs "$BUILD_ROOT$INSTALL_DIR" && $GNUMAKE -C contrib/$i install < /dev/null
91 done
93 echo
94 echo "SBCL has been installed:"
95 echo " binary $BUILD_ROOT$INSTALL_ROOT/bin/$RUNTIME"
96 echo " core and contribs in $BUILD_ROOT$INSTALL_ROOT/lib/sbcl/"
98 # Installing manual & misc bits of documentation
100 # Locations based on FHS 2.3.
101 # See: <http://www.pathname.com/fhs/pub/fhs-2.3.html>
103 # share/ architecture independent read-only things
104 # share/man/ manpages, should be the same as man/
105 # share/info/ info files
106 # share/doc/ misc documentation
108 echo
109 echo "Documentation:"
111 # man
112 cp doc/sbcl.1 "$BUILD_ROOT$MAN_DIR"/man1/ && echo " man $BUILD_ROOT$MAN_DIR/man1/sbcl.1"
114 # info
115 for info in doc/manual/*.info
117 test -e $info && cp $info "$BUILD_ROOT$INFO_DIR"/ \
118 && BN=`basename $info` \
119 && DIRFAIL=`install-info --info-dir="$BUILD_ROOT$INFO_DIR" \
120 "$BUILD_ROOT$INFO_DIR"/$BN > /dev/null 2>&1 \
121 || echo "(could not add to system catalog)"` \
122 && echo " info $BUILD_ROOT$INFO_DIR/`basename $info` [$BUILD_ROOT$INFO_DIR/dir] $DIRFAIL"
123 done
125 for info in doc/manual/*.info-*
127 test -e $info && cp $info "$BUILD_ROOT$INFO_DIR"/ \
128 && echo " info $BUILD_ROOT$INFO_DIR/`basename $info`"
129 done
131 # pdf
132 for pdf in doc/manual/*.pdf
134 test -e $pdf && cp $pdf "$BUILD_ROOT$DOC_DIR"/ \
135 && echo " pdf $BUILD_ROOT$DOC_DIR/`basename $pdf`"
136 done
138 # html
139 for html in doc/manual/sbcl doc/manual/asdf
141 test -d $html && cp -R -L $html "$BUILD_ROOT$DOC_DIR"/html \
142 && echo " html $BUILD_ROOT$DOC_DIR/html/`basename $html`/index.html"
143 done
145 for html in doc/manual/sbcl.html doc/manual/asdf.html
147 test -e $html && cp $html "$BUILD_ROOT$DOC_DIR"/ \
148 && echo " html $BUILD_ROOT$DOC_DIR/`basename $html`"
149 done
151 for f in BUGS CREDITS COPYING NEWS
153 test -e $f && cp $f "$BUILD_ROOT$DOC_DIR"/
154 done