From: Taylor R Campbell Date: Sun, 25 Apr 2010 15:24:54 +0000 (-0400) Subject: Make the m4 test in microcode/configure.ac less strict. X-Git-Tag: 20100708-Gtk~67 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9f1e930c10dc31ec544a6a7bdb17cc050594f3ae;p=mit-scheme.git Make the m4 test in microcode/configure.ac less strict. Some luser might run `./configure M4=/usr/frobblethorpe/bin/m4'. This requires makegen/m4.sh to accept the m4 program as an argument. (Don't try to pass any extra arguments to the m4 program that way...) --- diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index 205b4e582..a2126d7f2 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -996,7 +996,7 @@ svm1) ;; *) AC_CHECK_PROG([M4], [m4], [m4]) - if test "x${M4}" != xm4; then + if test "x${M4}" = x; then AC_MSG_ERROR([m4 not found]) fi AC_CONFIG_LINKS([cmpauxmd.m4:cmpauxmd/${mit_scheme_native_code}.m4]) @@ -1033,6 +1033,7 @@ fi AC_SUBST([AS_FLAGS]) AC_SUBST([GC_HEAD_FILES]) AC_SUBST([M4_FLAGS]) +AC_SUBST([M4]) AC_SUBST([OPTIONAL_SOURCES]) AC_SUBST([OPTIONAL_OBJECTS]) AC_SUBST([PRBFISH_LIBS]) diff --git a/src/microcode/makegen/Makefile.in.in b/src/microcode/makegen/Makefile.in.in index 4e4bd6512..6279a7f6a 100644 --- a/src/microcode/makegen/Makefile.in.in +++ b/src/microcode/makegen/Makefile.in.in @@ -69,7 +69,7 @@ AUXDIR = $(libdir)/$(AUXDIR_NAME) CC = @CC@ CCLD = @CCLD@ -M4 = $(srcdir)/makegen/m4.sh +M4 = $(srcdir)/makegen/m4.sh @M4@ AS = as TAR = tar GZIP_ENV = --best diff --git a/src/microcode/makegen/m4.sh b/src/microcode/makegen/m4.sh index bf01c4490..00011c84f 100755 --- a/src/microcode/makegen/m4.sh +++ b/src/microcode/makegen/m4.sh @@ -26,6 +26,14 @@ set -e +if [ $# -le 1 ]; then + printf 'Usage: %s m4 ...\n' >&2 + exit 1 +fi + +M4="${1}" +shift + TMP_FILE="m4.tmp" clean () @@ -35,7 +43,7 @@ clean () run_m4 () { - m4 && clean + ${M4} && clean } trap clean EXIT INT QUIT TERM