From: Taylor R Campbell Date: Mon, 9 Aug 2010 16:44:03 +0000 (+0000) Subject: Set -u in the setup scripts and make them more robust to interrupts. X-Git-Tag: 20101212-Gtk~113 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=73a1e63c0ff1fff24563651c1e8685c11a2b6e9e;p=mit-scheme.git Set -u in the setup scripts and make them more robust to interrupts. --- diff --git a/src/Setup.sh b/src/Setup.sh index 575df1bf3..7e52efe46 100755 --- a/src/Setup.sh +++ b/src/Setup.sh @@ -25,10 +25,21 @@ # Utility to set up the MIT/GNU Scheme build directories. # The working directory must be the top-level source directory. -set -e +set -eu : ${MIT_SCHEME_EXE:=mit-scheme} +configure=done + +clean () +{ + if [ "x${configure}" != xdone ]; then + rm -f configure + fi +} + +trap clean EXIT INT TERM + # Please keep the following messages synchronized with the messages in # these files: # @@ -56,8 +67,10 @@ EOF fi if [ ! -x configure ]; then + configure=clean echo "autoconf" autoconf --include=microcode + configure=done fi . etc/functions.sh @@ -87,5 +100,5 @@ done for SUBDIR in ${INSTALLED_SUBDIRS} ${OTHER_SUBDIRS}; do echo "setting up ${SUBDIR}" maybe_link ${SUBDIR}/Setup.sh ../etc/Setup.sh - (cd ${SUBDIR} && ./Setup.sh "$@") + (cd ${SUBDIR} && ./Setup.sh ${@:+"${@}"}) done diff --git a/src/compiler/Setup.sh b/src/compiler/Setup.sh index 18e2e1792..1330c53dc 100755 --- a/src/compiler/Setup.sh +++ b/src/compiler/Setup.sh @@ -25,11 +25,11 @@ # Utility to set up the MIT/GNU Scheme compiler directory. # The working directory must be the compiler directory. -set -e +set -eu . ../etc/functions.sh -../etc/Setup.sh "${@}" +../etc/Setup.sh ${@:+"${@}"} for N in 1 2 3; do maybe_link machines/vax/dinstr${N}.scm instr${N}.scm diff --git a/src/etc/Setup.sh b/src/etc/Setup.sh index acfbdb7eb..b26d884a2 100755 --- a/src/etc/Setup.sh +++ b/src/etc/Setup.sh @@ -25,7 +25,7 @@ # Utility to set up an MIT/GNU Scheme build directory. # The working directory must be the build directory. -set -e +set -eu . ../etc/functions.sh diff --git a/src/microcode/Setup.sh b/src/microcode/Setup.sh index 3c3e6703f..00dac413c 100755 --- a/src/microcode/Setup.sh +++ b/src/microcode/Setup.sh @@ -25,17 +25,42 @@ # Program to set up MIT/GNU Scheme microcode from CVS for distribution. # Requires `gcc' and `scheme'. -set -e +set -eu + +autoheader=done +autoconf=done +makeinit=done + +clean () +{ + if [ "x${autoheader}" != xdone ]; then + rm -f config.h.in + fi + if [ "x${autoconf}" != xdone ]; then + rm -f configure + fi + if [ "x${makeinit}" != xdone ]; then + rm -f Makefile.deps Makefile.in + fi +} + +trap clean EXIT INT TERM if [ ! -f config.h.in ]; then + autoheader=clean echo "autoheader" autoheader + autoheader=done fi if [ ! -x configure ]; then + autoconf=clean echo "autoconf" autoconf + autoconf=done fi -( cd cmpauxmd && make "${@}" ) +( cd cmpauxmd && make ${@:+"${@}"} ) if [ ! -f Makefile.in ]; then - makegen/makeinit.sh "${@}" + makeinit=clean + makegen/makeinit.sh ${@:+"${@}"} + makeinit=done fi