Adjust script so that MIT_SCHEME_EXE is just the executable name, not
authorChris Hanson <org/chris-hanson/cph>
Fri, 6 Nov 2009 22:01:45 +0000 (14:01 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 6 Nov 2009 22:01:45 +0000 (14:01 -0800)
a partial shell command.  Figure out stage library directory using
wildcard, since it now has an arch-specific suffix.  Allow override of
default stage0 dirs.

etc/run-three-stages

index 3f7659e73bdda305c9ad9c5a2587389f913064df..6d8a03844004110a5c847f4652c91c05a08d29f4 100755 (executable)
@@ -48,11 +48,11 @@ fi
 
 case $(uname -s) in
     Darwin)
-       DEFAULT_STAGE0=macosx
+       : {DEFAULT_STAGE0:=macosx}
        : ${COPY:="cp -pR"}
        ;;
     Linux)
-       DEFAULT_STAGE0=linux
+       : {DEFAULT_STAGE0:=linux}
        : ${COPY:="cp -a"}
        ;;
     *)
@@ -67,10 +67,10 @@ run_stage ()
     local STAGE=stage${N}
 
     echo "**************** ${STAGE} ****************"
-    export MIT_SCHEME_EXE=$(find_stage stage$((N-1)))
-    rm -rf "${STAGE}"
-    ${COPY} src "${STAGE}"
-    (set -e; cd "${STAGE}"; ./Setup.sh; ./configure; make)
+    find_stage stage$((N-1))
+    rm -rf ${STAGE}
+    ${COPY} src ${STAGE}
+    (set -e; cd ${STAGE}; ./Setup.sh; ./configure; make)
     if ! [[ -f ${STAGE}/lib/all.com ]]; then
        echo "${STAGE} failed"
        exit 1
@@ -92,7 +92,8 @@ find_build_stage ()
 {
     local STAGE=$(pwd)/${1}
     if [[ -x ${STAGE}/microcode/scheme && ${STAGE}/lib/all.com ]]; then
-       echo "${STAGE}/microcode/scheme --library ${STAGE}/lib"
+       export MIT_SCHEME_EXE=${STAGE}/microcode/scheme
+       export MITSCHEME_LIBRARY_PATH=${STAGE}/lib
        return 0
     else
        return 1
@@ -102,8 +103,10 @@ find_build_stage ()
 find_dist_stage ()
 {
     local STAGE=$(pwd)/${1}
-    if [[ -x ${STAGE}/bin/scheme && -f ${STAGE}/lib/mit-scheme/all.com ]]; then
-       echo "${STAGE}/bin/scheme --library ${STAGE}/lib/mit-scheme"
+    local LIBDIR=${STAGE}/lib/mit-scheme*
+    if [[ -x ${STAGE}/bin/mit-scheme && -f ${LIBDIR}/all.com ]]; then
+       export MIT_SCHEME_EXE=${STAGE}/bin/mit-scheme
+       export MITSCHEME_LIBRARY_PATH=${LIBDIR}
        return 0
     else
        return 1