summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2007-09-08 14:48:49 +0000
committerEric Blake <ebb9@byu.net>2007-09-08 14:48:49 +0000
commitf3aee13bfac4e3fdaf79d2a94158594210e62e02 (patch)
tree5d8ad745c93e6d65c7d4e05d03391d210558e6f6 /m4
parent5b84fb17165ce5107398da99cc05f6c039b622fe (diff)
downloadautoconf-f3aee13bfac4e3fdaf79d2a94158594210e62e02.tar.gz
Improve M4 path searching during configure.
* lib/autoconf/programs.m4 (AC_PATH_PROGS_FEATURE_CHECK): New macro. (_AC_PATH_PROG_FEATURE_CHECK): Rename... (_AC_PATH_PROGS_FEATURE_CHECK): ...to this, add defaulted action parameter, and kill side effects. (_AC_PROG_GREP, AC_PROG_SED): Adjust callers. (_AC_FEATURE_CHECK_LENGTH): Kill extra whitespace. * m4/m4.m4 (AC_PROG_GNU_M4): Don't stop searching until working m4 is found. (AC_PATH_PROGS_FEATURE_CHECK): Add backwards compatibility hack to allow bootstrapping with autoconf 2.61. * configure.ac (M4): AC_PROG_GNU_M4 now exits on failure. * configure: Regenerate. * doc/autoconf.texi (Generic Programs): Document new macro. * tests/mktests.sh (au_exclude_script): Exclude auto-testing new macro. * tests/semantics.at (AC_PATH_PROGS_FEATURE_CHECK): New test. * NEWS: Document the change. * THANKS: Update. Reported by Hans Aberg.
Diffstat (limited to 'm4')
-rw-r--r--m4/m4.m441
1 files changed, 25 insertions, 16 deletions
diff --git a/m4/m4.m4 b/m4/m4.m4
index 70b99f89..70f30767 100644
--- a/m4/m4.m4
+++ b/m4/m4.m4
@@ -1,4 +1,4 @@
-# m4.m4 serial 3
+# m4.m4 serial 4
dnl Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,20 +12,29 @@ dnl with or without modifications, as long as this notice is preserved.
# Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
# is supported, and AC_SUBST M4_DEBUGFILE accordingly.
AC_DEFUN([AC_PROG_GNU_M4],
-[AC_PATH_PROGS([M4], [gm4 gnum4 m4], [m4])
-AC_CACHE_CHECK([whether m4 supports accurate traces], [ac_cv_prog_gnu_m4],
-[ac_cv_prog_gnu_m4=no
-dnl Creative quoting here to avoid raw dnl and ifdef in configure.
-if test x"$M4" != x \
- && test -z "`echo if'def(mac,bug)d'nl | $M4 --trace=mac 2>&1`" ; then
- ac_cv_prog_gnu_m4=yes
-fi])
-if test $ac_cv_prog_gnu_m4 = yes ; then
+ [AC_ARG_VAR([M4], [Location of GNU M4 1.4.5 or later. Defaults to the first
+ program of `m4', `gm4', or `gnum4' on PATH that meets Autoconf needs.])
+ AC_CACHE_CHECK([for GNU M4 that supports accurate traces], [ac_cv_path_M4],
+ [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4 gnum4],
+ [dnl Creative quoting here to avoid raw dnl and ifdef in configure.
+ test -z "`echo if'def(mac,bug)d'nl | $ac_path_M4 --trace=mac 2>&1`" \
+ && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:],
+ [AC_MSG_ERROR([no acceptable m4 could be found in \$PATH.
+GNU M4 1.4.5 or later is required; 1.4.8 is recommended])])])
+ M4=$ac_cv_path_M4
AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
- [case `$M4 --help < /dev/null 2>&1` in
- *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
- *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
- esac])
- AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)
-fi
+ [case `$M4 --help < /dev/null 2>&1` in
+ *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
+ *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
+ esac])
+ AC_SUBST([M4_DEBUGFILE], [$ac_cv_prog_gnu_m4_debugfile])
])
+
+# Compatibility for bootstrapping with Autoconf 2.61.
+dnl FIXME - replace this with AC_PREREQ([2.62]) after the release.
+# AC_PATH_PROGS_FEATURE_CHECK was added the same time the slightly broken,
+# undocumented _AC_PATH_PROG_FEATURE_CHECK was deleted.
+m4_ifndef([AC_PATH_PROGS_FEATURE_CHECK],
+ [m4_define([AC_PATH_PROGS_FEATURE_CHECK],
+ [_AC_PATH_PROG_FEATURE_CHECK([$1], [$2], [$3], [$5])
+])])