From b66d5b5cc9946c39694fe70faab356ab3de54a20 Mon Sep 17 00:00:00 2001 From: wlestes Date: Fri, 2 Mar 2012 21:38:31 +0000 Subject: fix test for m4 to accept an m4 with -P and not jus tGNU m4; patch from Tim Landsheet scfc_de on sourceforge --- configure.in | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 6125877..cbbb754 100644 --- a/configure.in +++ b/configure.in @@ -47,22 +47,16 @@ AC_PROG_INSTALL AC_PATH_PROG(BISON, bison,bison) AC_PATH_PROG(HELP2MAN, help2man, help2man) -# Check for a GNU m4 that supports --prefix-builtins - -AC_PATH_PROGS(M4, gm4 gnum4 m4, m4) - -if test x"$M4" != x; then - AC_MSG_CHECKING([for GNU m4]) - case `$M4 --help < /dev/null 2>&1` in - *prefix-builtins*) AC_MSG_RESULT(yes) ;; - *) AC_MSG_RESULT(no) ; - AC_MSG_ERROR([GNU M4 1.4 is required]) ;; - esac -else - AC_MSG_ERROR([GNU M4 1.4 is required]) ; -fi - -AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.]) +# Check for a m4 that supports -P + +AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4], +[AC_PATH_PROGS_FEATURE_CHECK([M4], [gm4 gnum4 m4], + [[m4out=`echo 'm''4_divnum' | $ac_path_M4 -P`] + [test "x$m4out" = x0 \ + && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], + [AC_MSG_ERROR([could not find m4 that supports -P])])]) +AC_SUBST([M4], [$ac_cv_path_M4]) +AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.]) AC_PATH_PROG(INDENT, indent, indent) # if INDENT is set to 'indent' then we didn't find indent -- cgit v1.2.1