* doc/autoconf.texi (Particular Types): AC_TYPE_INT8_T does not
[autoconf.git] / m4 / m4.m4
blob70b99f898918524d467a811dfb36d9e5499e6eb0
1 # m4.m4 serial 3
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.
7 # AC_PROG_GNU_M4
8 # --------------
9 # Check for GNU M4, at least 1.4.5 (all earlier versions had a bug in
10 # trace support:
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],
17 [ac_cv_prog_gnu_m4=no
18 dnl Creative quoting here to avoid raw dnl and ifdef in configure.
19 if test x"$M4" != x \
20     && test -z "`echo if'def(mac,bug)d'nl | $M4 --trace=mac 2>&1`" ; then
21   ac_cv_prog_gnu_m4=yes
22 fi])
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 ;;
28   esac])
29   AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)