3 Support staged installation.
5 --- src/clisp-link.in.orig 2010-05-25 23:54:54.000000000 +0400
6 +++ src/clisp-link.in 2010-07-09 00:17:46.000000000 +0400
9 set_dynamic_module_location() {
10 if test -z "${LIBDIR}"; then
11 - if touch ${CLISP_LIBDIR}/${DYNMOD}/.abazonk 2>/dev/null; then
12 - rm -f ${CLISP_LIBDIR}/${DYNMOD}/.abazonk
13 + if touch "${DESTDIR}${CLISP_LIBDIR}/${DYNMOD}/.abazonk" 2>/dev/null; then
14 + rm -f "${DESTDIR}${CLISP_LIBDIR}/${DYNMOD}/.abazonk"
15 LIBDIR=${CLISP_LIBDIR}
16 else # cf. src/m4/clisp.m4
17 CLISP_LIBDIR_USER=`clisp_eval '(and *user-lib-directory* (namestring *user-lib-directory*))'`
20 # create the REQUIRE file
21 reqfile=${dyndir}/${firstmod}.lisp
23 + rm -f "${DESTDIR}${reqfile}"
24 for f in ${TO_PRELOAD}; do
25 # preload files are not compiled
26 - echo "(cl:load (cl:merge-pathnames \"../${moduledir}/${f}\" cl:*load-truename*))" >> ${reqfile}
27 + echo "(cl:load (cl:merge-pathnames \"../${moduledir}/${f}\" cl:*load-truename*))" >> "${DESTDIR}${reqfile}"
29 # dll has SHREXT extension
30 DM="(sys::dynload-modules (cl:merge-pathnames \"${dll}\" cl:*load-truename*) (quote ("
31 for m in ${NEW_MODULES}; do
34 - echo ${DM}" )))" >> ${reqfile}
35 + echo ${DM}" )))" >> "${DESTDIR}${reqfile}"
36 if test -n "${TO_LOAD}"; then
37 - echo ";; for def-call-out to non-existent functions" >> ${reqfile}
38 - echo "(ext:appease-cerrors" >> ${reqfile}
39 + echo ";; for def-call-out to non-existent functions" >> "${DESTDIR}${reqfile}"
40 + echo "(ext:appease-cerrors" >> "${DESTDIR}${reqfile}"
41 for f in ${TO_LOAD}; do
42 # module files must be compiled
43 - echo " (cl:load (cl:merge-pathnames \"../${moduledir}/${f}.fas\" cl:*load-truename*))" >> ${reqfile}
44 + echo " (cl:load (cl:merge-pathnames \"../${moduledir}/${f}.fas\" cl:*load-truename*))" >> "${DESTDIR}${reqfile}"
46 - echo ")" >> ${reqfile}
47 + echo ")" >> "${DESTDIR}${reqfile}"
49 # create links to the REQUIRE file
50 for m in ${othermods}; do
51 - ln ${dyndir}/$m.lisp ${reqfile}
52 + ln ${dyndir}/$m.lisp "${DESTDIR}${reqfile}"
57 absolute_moduledir=`/bin/pwd`
59 prepare_dynamic_module # sets LIBDIR
60 - mkdir -p "${LIBDIR}/$moduledir"
61 + mkdir -p "${DESTDIR}${LIBDIR}/$moduledir"
62 # when running "CLISP=./clisp ./clisp-link install <modname>"
63 # in the build directory, avoid "cp: `...' and `...' are the same file"
64 - absolute_distribdir=`cd "${LIBDIR}/$moduledir"; /bin/pwd`
65 + absolute_distribdir=`cd "${DESTDIR}${LIBDIR}/$moduledir"; /bin/pwd`
66 test "${absolute_moduledir}" = "${absolute_distribdir}" || \
67 - make clisp-module-distrib LN=cp distribdir="${LIBDIR}/$moduledir"
68 + make clisp-module-distrib LN=cp distribdir="${DESTDIR}${LIBDIR}/$moduledir"
69 cd "$absolute_currentdir"