Make the m4 test in microcode/configure.ac less strict.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 25 Apr 2010 15:24:54 +0000 (11:24 -0400)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 25 Apr 2010 15:24:54 +0000 (11:24 -0400)
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...)

src/microcode/configure.ac
src/microcode/makegen/Makefile.in.in
src/microcode/makegen/m4.sh

index 205b4e582f30404901d48ea3bb0ed30fd2e4ab66..a2126d7f2b04f08aae42009f2eb81fd7a79fbc5a 100644 (file)
@@ -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])
index 4e4bd6512bc7b95110a6564b54741228c21147c9..6279a7f6ab9ffbcf70737291a414bbb9060e6df5 100644 (file)
@@ -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
index bf01c4490fe7948af847f90c51402f6c92635b50..00011c84f515f51a587dddd132df547bb7817f21 100755 (executable)
 
 set -e
 
+if [ $# -le 1 ]; then
+  printf 'Usage: %s m4 <file/definition> ...\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