Another pass on getting scmutils right.
authorChris Hanson <org/chris-hanson/cph>
Tue, 10 Apr 2001 19:31:13 +0000 (19:31 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 10 Apr 2001 19:31:13 +0000 (19:31 +0000)
v7/dist/make-dist-files

index 57b8ae82f0984bac2f4b65a83ed60be29d3c1827..819b2e293d3f64c725b711a0edb96469ff19a28a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $Id: make-dist-files,v 1.18 2001/04/06 20:58:43 cph Exp $
+# $Id: make-dist-files,v 1.19 2001/04/10 19:31:13 cph Exp $
 #
 # Copyright (c) 2000-2001 Massachusetts Institute of Technology
 #
@@ -54,6 +54,12 @@ IMAGE_DIR="${BUILD_DIR}-image"
 BINDIR="${IMAGE_DIR}/usr/local/bin"
 AUXDIR="${IMAGE_DIR}/usr/local/lib/mit-scheme"
 
+MECH_SOURCE="/sw/scmutils"
+MECH_BUILD="${BUILD_DIR}/scmutils"
+MECH_IMAGE="${IMAGE_DIR}/usr/local/scmutils"
+STAMP_BUILD_MECH="${TL_DIR}/stamp-build-mech"
+STAMP_IMAGE_MECH="${TL_DIR}/stamp-image-mech"
+
 if [ ! -f "${SRC_FILE}" ]; then
     echo "No source file: ${SRC_FILE}."
     exit 1
@@ -135,70 +141,105 @@ if [ ! -f "${STAMP_IMAGE}" ]; then
        ;;
     esac
 
-    #
-    # Scmutils
-    #
-    if [ "${TYPE}" = "scmutils" ]; then
-       MECH_SOURCE="/sw/scmutils"
-       MECH_DEST="${IMAGE_DIR}/usr/local/scmutils"
-       ${MKINSTALLDIRS} "${MECH_DEST}"
-
-       for DIR in $(cd ${MECH_SOURCE};find src -type d -print); do
-           ${MKINSTALLDIRS} "${MECH_DEST}/${DIR}"
-           for FILE in ${MECH_SOURCE}/${DIR}/*.doc; do
-               [ -f ${FILE} ] \
-                   && ${INSTALL_DATA} "${FILE}" "${MECH_DEST}/${DIR}/."
-           done
-           for SUFFIX in scm c; do
-               for FILE in ${MECH_SOURCE}/${DIR}/*.${SUFFIX}; do
-                   if [ -f "${FILE}" ]; then
-                       TFILE="${MECH_DEST}/${DIR}/$(basename "${FILE}")"
-                       rm -f "${TFILE}"
-                       cat "${DIST_DIR}/copyright.${SUFFIX}" "${FILE}" \
-                           > "${TFILE}"
-                       chtime "${FILE}" "${TFILE}"
-                   fi
-               done
-           done
+    find "${IMAGE_DIR}" -type f -print | xargs chmod og-w
+    find "${IMAGE_DIR}" -type d -print | xargs chmod og-w
+
+    touch "${STAMP_IMAGE}"
+fi
+
+if  [ "${TYPE}" = "scmutils" ] && [ ! -f "${STAMP_BUILD_MECH}" ];then
+    rm -rf "${MECH_BUILD}"
+    cpx -qsE "${MECH_SOURCE}/src" "${MECH_BUILD}"
+    (
+       cd "${MECH_BUILD}"
+       "${BUILD_DIR}/src/microcode/scheme" \
+           -library "${BUILD_DIR}/src/lib" -compiler -heap 4000 <<EOF
+(load "compile")
+EOF
+       "${BUILD_DIR}/src/microcode/scheme" \
+           -library "${BUILD_DIR}/src/lib" -edwin -compiler -heap 4000 \
+           <<EOF
+(load "load")
+(disk-save "edwin-mechanics.com")
+EOF
+    )
+    (cd "${MECH_BUILD}/c-utils"; make)
+
+    touch "${STAMP_BUILD_MECH}"
+fi
+
+if [ "${TYPE}" = "scmutils" ] && [ ! -f "${STAMP_IMAGE_MECH}" ]; then
+    rm -f "${BINDIR}/edwin"
+    rm -f "${BINDIR}/mechanics"
+    rm -f "${AUXDIR}/edwin-mechanics.com"
+    ${INSTALL} "${MECH_SOURCE}/dist/edwin" "${BINDIR}/."
+    ${INSTALL} "${MECH_SOURCE}/dist/mechanics" "${BINDIR}/."
+    ${INSTALL_DATA} "${MECH_BUILD}/edwin-mechanics.com" "${AUXDIR}/."
+
+    rm -rf "${MECH_IMAGE}"
+    ${MKINSTALLDIRS} "${MECH_IMAGE}"
+
+    for DIR in $(cd "${MECH_SOURCE}";find src -type d -print); do
+       ${MKINSTALLDIRS} "${MECH_IMAGE}/${DIR}"
+       for FILE in ${MECH_SOURCE}/${DIR}/*.doc; do
+           [ -f "${FILE}" ] \
+               && ${INSTALL_DATA} "${FILE}" "${MECH_IMAGE}/${DIR}/."
        done
-       ${INSTALL_DATA} "${MECH_SOURCE}/src/copyrigh" \
-           "${MECH_DEST}/src/copyright"
-       ${INSTALL_DATA} "/scheme/v7/src/COPYING" "${MECH_DEST}/src/."
-       ${INSTALL_DATA} "${MECH_SOURCE}/src/general/binio/transcript" \
-           "${MECH_DEST}/src/general/binio/."
-       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
-           ${MKINSTALLDIRS} "${MECH_DEST}/${DIR}"
-           for FILE in ${MECH_SOURCE}/${DIR}/*.bci; do
-               [ -f ${FILE} ] \
-                   && ${INSTALL_DATA} "${FILE}" "${MECH_DEST}/${DIR}/."
+       for SUFFIX in scm c; do
+           for FILE in ${MECH_SOURCE}/${DIR}/*.${SUFFIX}; do
+               if [ -f "${FILE}" ]; then
+                   TFILE="${MECH_IMAGE}/${DIR}/$(basename "${FILE}")"
+                   rm -f "${TFILE}"
+                   cat "${DIST_DIR}/copyright.${SUFFIX}" "${FILE}" \
+                       > "${TFILE}"
+                   chtime "${FILE}" "${TFILE}"
+               fi
            done
        done
-       rm -rf "${MECH_DEST}/linux/commentary"
+    done
+    ${INSTALL_DATA} "${MECH_SOURCE}/src/copyrigh" "${MECH_IMAGE}/src/LICENSE"
+    ${INSTALL_DATA} "/scheme/v7/src/COPYING" "${MECH_IMAGE}/src/."
+    ${INSTALL_DATA} "${MECH_SOURCE}/src/general/binio/transcript" \
+       "${MECH_IMAGE}/src/general/binio/."
+    (
+       cd "${MECH_SOURCE}/src/c-utils"
+       for FILE in Makefile standard-map-ic.*;do
+           [ -f "${FILE}" ] \
+               && ${INSTALL_DATA} "${FILE}" "${MECH_IMAGE}/src/c-utils/."
+       done
+    )
 
-       ${INSTALL_DATA} "${MECH_SOURCE}/dist/edwin-mechanics.com" \
-           "${MECH_DEST}/linux/."
-       ln -s "../../scmutils/linux/edwin-mechanics.com" "${AUXDIR}/."
-       ${INSTALL_DATA} ${MECH_SOURCE}/linux/c-utils/* \
-           "${MECH_DEST}/linux/c-utils/."
+    for DIR in $(cd ${MECH_BUILD};find * -type d -print); do
+       ${MKINSTALLDIRS} "${MECH_IMAGE}/linux/${DIR}"
+       for FILE in ${MECH_BUILD}/${DIR}/*.bci; do
+           [ -f "${FILE}" ] \
+               && ${INSTALL_DATA} "${FILE}" "${MECH_IMAGE}/linux/${DIR}/."
+       done
+    done
+
+    for FILE in psraster texfigure texfigure-big xplot; do
+       ${INSTALL_DATA} "${MECH_BUILD}/c-utils/${FILE}" \
+           "${MECH_IMAGE}/linux/c-utils/."
+    done
+    for FILE in standard-map-ic.ps standard-map-ic.tex; do
+       ${INSTALL_DATA} "${MECH_SOURCE}/src/c-utils/${FILE}" \
+           "${MECH_IMAGE}/linux/c-utils/."
+    done
 
-       ${MKINSTALLDIRS} "${MECH_DEST}/manual"
-       ${INSTALL_DATA} "${MECH_SOURCE}/manual/refman.txt" \
-           "${MECH_DEST}/manual/."
+    ${MKINSTALLDIRS} "${MECH_IMAGE}/manual"
+    for FILE in beginner.txt graphing.txt refman.txt; do
+       ${INSTALL_DATA} "${MECH_SOURCE}/manual/${FILE}" \
+           "${MECH_IMAGE}/manual/."
+    done
 
-       ${INSTALL} "${MECH_SOURCE}/dist/mechanics" "${BINDIR}/."
-       ${INSTALL} "${MECH_SOURCE}/dist/edwin" "${BINDIR}/."
-    fi
+    for FILE in $(cat "${MECH_SOURCE}/dist/dist-exclude"); do
+       rm -rf "${MECH_IMAGE}/${FILE}"
+    done
 
-    #
-    # Adjust permissions
-    #
     find ${IMAGE_DIR} -type f -print | xargs chmod og-w
     find ${IMAGE_DIR} -type d -print | xargs chmod og-w
 
-    touch "${STAMP_IMAGE}"
+    touch "${STAMP_IMAGE_MECH}"
 fi
 
 if [ "${TYPE}" != "scmutils" ]; then