Don't copy precompiled binaries to the output files. Instead unpack
authorChris Hanson <org/chris-hanson/cph>
Sat, 3 Mar 2001 05:28:05 +0000 (05:28 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 3 Mar 2001 05:28:05 +0000 (05:28 +0000)
the source archive and build the binaries from source.  This is
partially necessary because we want to compile the microcode in a
portable way.  The locally-compiled microcode is dynamically linked to
libraries that might not be available on all target systems.

v7/dist/make-dist-files

index c3d955a22f736df7d3556e2e1a0d6d65bca7a614..af924097d4066273f966d682d02d1f6d1082b8c8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $Id: make-dist-files,v 1.12 2001/02/23 05:19:03 cph Exp $
+# $Id: make-dist-files,v 1.13 2001/03/03 05:28:05 cph Exp $
 #
 # Copyright (c) 2000-2001 Massachusetts Institute of Technology
 #
@@ -18,6 +18,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+set -e
+
 TYPE=$1
 DESTINATION=$2
 
@@ -36,51 +38,73 @@ esac
 
 . /scheme/v7/dist/release-prefix
 
-BUILD_DIR="`pwd`/build-$$"
-BINDIR=${BUILD_DIR}/usr/local/bin
-AUXDIR=${BUILD_DIR}/usr/local/lib/mit-scheme
+SRC_FILE="$(get_release_prefix)-src.tar.gz"
+if [ ! -f "${SRC_FILE}" ]; then
+    echo "No source file: ${SRC_FILE}."
+    exit 1
+fi
+
+BUILD_DIR="$(pwd)/$(get_release_prefix)"
+IMAGE_DIR="$(pwd)/image-$$"
+BINDIR="${IMAGE_DIR}/usr/local/bin"
+AUXDIR="${IMAGE_DIR}/usr/local/lib/mit-scheme"
 
 MKINSTALLDIRS="/scheme/v7/src/mkinstalldirs"
 INSTALL="install"
 INSTALL_DATA="${INSTALL} -m 644"
 
+rm -rf ${BUILD_DIR} ${IMAGE_DIR}
+tar xzf "${SRC_FILE}"
+
+cd "${BUILD_DIR}/src"
+./configure --enable-static-libs=yes --with-mcrypt=no
+make
+make install DESTDIR="${IMAGE_DIR}"
+${MKINSTALLDIRS} "${AUXDIR}/doc/."
+${INSTALL_DATA} COPYING "${AUXDIR}/doc/."
+
+cd "${BUILD_DIR}/doc"
+./configure
+make
+make install-info-gz DESTDIR="${IMAGE_DIR}" \
+    infodir=/usr/local/lib/mit-scheme/edwin/info
+make install-html DESTDIR="${IMAGE_DIR}"
+
 rm -rf ${BUILD_DIR}
-(
-    cd /scheme/v7/linux
-    make install DESTDIR=${BUILD_DIR}
-)
-(
-    cd /scheme/v7/doc
-    make install-info-gz DESTDIR=${BUILD_DIR} \
-       infodir=/usr/local/lib/mit-scheme/edwin/info
-    make install-html DESTDIR=${BUILD_DIR}
-)
-
-${MKINSTALLDIRS} ${AUXDIR}/doc
-${INSTALL_DATA} /scheme/v7/src/COPYING ${AUXDIR}/doc/.
-
-${INSTALL_DATA} /usr/local/info/dir ${AUXDIR}/edwin/info/.
-${INSTALL_DATA} /usr/local/info/r4rs.* ${AUXDIR}/edwin/info/.
-${INSTALL_DATA} /usr/local/info/r5rs.* ${AUXDIR}/edwin/info/.
-
-BANDS="runtime.com compiler.com edwin.com all.com 6001.com"
+
+${INSTALL_DATA} /usr/local/info/dir "${AUXDIR}/edwin/info/."
+${INSTALL_DATA} /usr/local/info/r4rs.* "${AUXDIR}/edwin/info/."
+${INSTALL_DATA} /usr/local/info/r5rs.* "${AUXDIR}/edwin/info/."
+
+ALL_BANDS="runtime.com compiler.com edwin.com all.com 6001.com"
 case ${TYPE} in
 std)
-    rm -f ${AUXDIR}/6001.com
-    ;;
-6001)
-    for BAND in ${BANDS}; do
-       [ "${BAND}" = "6001.com" ] || rm -f ${AUXDIR}/${BAND}
+    for BAND in ${ALL_BANDS}; do
+       case "${BAND}" in
+       "runtime.com"|"all.com")
+           ;;
+       *)
+           rm -f "${AUXDIR}/${BAND}"
+           ;;
+       esac
     done
     ;;
 all)
-    for BAND in ${BANDS}; do
-       [ "${BAND}" = "all.com" ] || rm -f ${AUXDIR}/${BAND}
+    ;;
+6001)
+    for BAND in ${ALL_BANDS}; do
+       case "${BAND}" in
+       "6001.com")
+           ;;
+       *)
+           rm -f "${AUXDIR}/${BAND}"
+           ;;
+       esac
     done
     ;;
 scmutils)
-    for BAND in ${BANDS}; do
-       rm -f ${AUXDIR}/${BAND}
+    for BAND in ${ALL_BANDS}; do
+       rm -f "${AUXDIR}/${BAND}"
     done
     ;;
 esac
@@ -90,10 +114,10 @@ esac
 #
 if [ ${TYPE} = scmutils ]; then
     MECH_SOURCE=/sw/scmutils
-    MECH_DEST=${BUILD_DIR}/usr/local/scmutils
+    MECH_DEST=${IMAGE_DIR}/usr/local/scmutils
     ${MKINSTALLDIRS} ${MECH_DEST}
 
-    for DIR in `cd ${MECH_SOURCE};find src -type d -print`; do
+    for DIR in $(cd ${MECH_SOURCE};find src -type d -print); do
        ${MKINSTALLDIRS} ${MECH_DEST}/${DIR}
        for FILE in ${MECH_SOURCE}/${DIR}/*.scm \
                    ${MECH_SOURCE}/${DIR}/*.doc \
@@ -107,7 +131,7 @@ if [ ${TYPE} = scmutils ]; then
     rm -rf ${MECH_DEST}/src/commentary
     rm -rf ${MECH_DEST}/src/poly/zuras
 
-    for DIR in `cd ${MECH_SOURCE};find linux -type d -print`; do
+    for DIR in $(cd ${MECH_SOURCE};find linux -type d -print); do
        ${MKINSTALLDIRS} ${MECH_DEST}/${DIR}
        for FILE in ${MECH_SOURCE}/${DIR}/*.bci; do
            [ -f ${FILE} ] && ${INSTALL_DATA} ${FILE} ${MECH_DEST}/${DIR}/.
@@ -129,19 +153,19 @@ fi
 #
 # Adjust permissions
 #
-find ${BUILD_DIR} -type f -print | xargs chmod og-w
-find ${BUILD_DIR} -type d -print | xargs chmod og-w
+find ${IMAGE_DIR} -type f -print | xargs chmod og-w
+find ${IMAGE_DIR} -type d -print | xargs chmod og-w
 
 make_tarfile ()
 {
     tarfile=${1}.tar.gz
     rm -f ${tarfile}
-    (cd ${BUILD_DIR}/usr/local; tar cvzf ../../../${tarfile} *)
+    (cd ${IMAGE_DIR}/usr/local; tar cvzf ../../../${tarfile} *)
     chmod 444 ${tarfile}
 }
 
 if [ "${DESTINATION}" = "" ]; then
-  PRE="`get_release_prefix`-ix86"
+  PRE="$(get_release_prefix)-ix86"
   make_tarfile "${PRE}-gnu-linux"
   ${INSTALL} /scheme/v7/dist/freebsd-bin/* ${BINDIR}/.
   make_tarfile "${PRE}-freebsd"
@@ -149,4 +173,4 @@ else
   make_tarfile ${DESTINATION}
 fi
 
-rm -rf ${BUILD_DIR}
+rm -rf ${IMAGE_DIR}