1 dnl Check for presence of the Ragel State Machine generator.
3 dnl This macro checks for the presence of the ragel tool in the system,
4 dnl and whether the ragel tool is absolutely needed for a complete
7 dnl To check for the need for Ragel, you have to provide the relative
8 dnl path of a source file generated through Ragel: if the file is
9 dnl present in the source tree, a missing ragel command will not cause
10 dnl the configure to abort.
12 AC_DEFUN([_RAGEL_VARS], [
13 AC_ARG_VAR([RAGEL], [Ragel generator command])
14 AC_ARG_VAR([RAGELFLAGS], [Ragel generator flags])
17 AC_DEFUN([CHECK_RAGEL], [
18 AC_REQUIRE([_RAGEL_VARS])
19 AC_CHECK_PROG([RAGEL], [ragel], [ragel], [no])
21 dnl We set RAGEL to false so that it would execute the "false"
22 dnl command if needed.
23 AS_IF([test x"$RAGEL" = x"no"], [RAGEL=false])
25 dnl Only test the need if not found
26 AS_IF([test x"$RAGEL" = x"false"], [
27 AC_MSG_CHECKING([whether we need ragel to regenerate sources])
28 AS_IF([test -a ${srcdir}/$1], [ragel_needed=no], [ragel_needed=yes])
29 AC_MSG_RESULT([$ragel_needed])
31 AS_IF([test x"$ragel_needed" = x"yes"],
33 You need Ragel to build from development sources.
34 You can find Ragel at http://www.complang.org/ragel/dnl
39 AC_DEFUN([CHECK_RAGEL_AM], [
42 AM_CONDITIONAL([HAVE_RAGEL], [test x"$RAGEL" != x"false"])