#!/bin/sh
-# $Id: make-dist-files,v 1.14 2001/03/05 20:49:02 cph Exp $
+# $Id: make-dist-files,v 1.15 2001/03/09 17:40:37 cph Exp $
#
# Copyright (c) 2000-2001 Massachusetts Institute of Technology
#
. /scheme/v7/dist/release-prefix
-SRC_FILE="$(get_release_prefix)-src.tar.gz"
+TL_DIR="$(pwd)"
+BUILD_DIR="${TL_DIR}/$(get_release_prefix)"
+IMAGE_DIR="${BUILD_DIR}-image"
+BINDIR="${IMAGE_DIR}/usr/local/bin"
+AUXDIR="${IMAGE_DIR}/usr/local/lib/mit-scheme"
+SRC_FILE="${BUILD_DIR}-src.tar.gz"
+STAMP_BUILD="${TL_DIR}/stamp-build"
+STAMP_IMAGE="${TL_DIR}/stamp-image"
+
if [ ! -f "${SRC_FILE}" ]; then
echo "No source file: ${SRC_FILE}."
exit 1
fi
-BUILD_DIR="$(pwd)/$(get_release_prefix)"
-IMAGE_DIR="${BUILD_DIR}-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"
# It takes a lot of work to build the image.
# Don't throw it away needlessly.
-if [ ! -d "${IMAGE_DIR}" ]; then
+
+if [ ! -f "${STAMP_BUILD}" ];then
rm -rf "${BUILD_DIR}"
+
tar xzf "${SRC_FILE}"
cd "${BUILD_DIR}/src"
./configure --enable-static-libs=yes --with-mcrypt=no
make
+
+ cd "${BUILD_DIR}/doc"
+ ./configure
+ make
+
+ touch "${STAMP_BUILD}"
+fi
+
+if [ ! -f "${STAMP_IMAGE}" ]; then
+ rm -rf ${IMAGE_DIR}
+
+ cd "${BUILD_DIR}/src"
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}
-
${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/."
#
find ${IMAGE_DIR} -type f -print | xargs chmod og-w
find ${IMAGE_DIR} -type d -print | xargs chmod og-w
+
+ touch "${STAMP_IMAGE}"
fi
+
make_tarfile ()
{
- tarfile="${1}.tar.gz"
- [ -e "${tarfile}" ] && rm -f "${tarfile}"
- (cd ${IMAGE_DIR}/usr/local; tar cvzf "../../../${tarfile}" *)
- chmod 444 "${tarfile}"
+ TARFILE="${TL_DIR}/${1}.tar.gz"
+ [ -e "${TARFILE}" ] && rm -f "${TARFILE}"
+ (cd ${IMAGE_DIR}/usr/local; tar cvzf "${TARFILE}" *)
+ chmod 444 "${TARFILE}"
}
if [ "${DESTINATION}" = "" ]; then
make_tarfile "${DESTINATION}"
fi
-rm -rf "${IMAGE_DIR}"
+rm -rf "${STAMP_BUILD}" "${BUILD_DIR}" "${STAMP_IMAGE}" "${IMAGE_DIR}"