2 dnl Copyright (C) 2000, 2006 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.3 (supports frozen files).
10 # Also, check whether --error-output (through 1.4.x) or --debugfile (2.0)
11 # is supported, and AC_SUBST M4_DEBUGFILE accordingly.
12 AC_DEFUN([AC_PROG_GNU_M4],
13 [AC_PATH_PROGS([M4], [gm4 gnum4 m4], [m4])
14 AC_CACHE_CHECK([whether m4 supports frozen files], [ac_cv_prog_gnu_m4],
16 if test x"$M4" != x; then
17 case `$M4 --help < /dev/null 2>&1` in
18 *reload-state*) ac_cv_prog_gnu_m4=yes ;;
21 if test $ac_cv_prog_gnu_m4 = yes ; then
22 AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
23 [case `$M4 --help < /dev/null 2>&1` in
24 *debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
25 *) ac_cv_prog_gnu_m4_debugfile=--error-output ;;
27 AC_SUBST([M4_DEBUGFILE], $ac_cv_prog_gnu_m4_debugfile)