2 dnl Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 # Check for GNU M4, at least 1.4.5 (all earlier versions had a bug in
11 # http://lists.gnu.org/archive/html/bug-gnu-utils/2006-11/msg00096.html)
12 # Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
13 # is supported, and AC_SUBST M4_DEBUGFILE accordingly.
14 AC_DEFUN([AC_PROG_GNU_M4],
15 [AC_PATH_PROGS([M4], [gm4 gnum4 m4], [m4])
16 AC_CACHE_CHECK([whether m4 supports accurate traces], [ac_cv_prog_gnu_m4],
18 dnl Creative quoting here to avoid raw dnl and ifdef in configure.
20 && test -z "`echo if'def(mac,bug)d'nl | $M4 --trace=mac 2>&1`" ; then
23 if test $ac_cv_prog_gnu_m4 = yes ; then
24 AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
25 [case `$M4 --help < /dev/null 2>&1` in
26 *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
27 *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
29 AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)