]> granicus.if.org Git - flex/commitdiff
fix test for m4 to accept an m4 with -P and not jus tGNU m4; patch from Tim Landsheet...
authorWill Estes <wlestes@users.sourceforge.net>
Fri, 2 Mar 2012 21:38:31 +0000 (21:38 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Fri, 2 Mar 2012 21:38:31 +0000 (21:38 +0000)
configure.in

index 6125877b329779c4acb0af74071fecf4f710deae..cbbb75480acd0bc6dc6d763621a35259f07544b4 100644 (file)
@@ -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