From: thurston Date: Sat, 4 Apr 2009 21:59:32 +0000 (+0000) Subject: Automake support for Ragel from Flameeyes. X-Git-Tag: 2.0_alpha~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0d62799e89d3b4b398bbf93b29bf2929a9f6815;p=external%2Fragel.git Automake support for Ragel from Flameeyes. git-svn-id: http://svn.complang.org/ragel/trunk@779 052ea7fc-9027-0410-9066-f65837a77df0 --- diff --git a/contrib/ragel.m4 b/contrib/ragel.m4 new file mode 100644 index 0000000..8b9b913 --- /dev/null +++ b/contrib/ragel.m4 @@ -0,0 +1,43 @@ +dnl Check for presence of the Ragel State Machine generator. +dnl +dnl This macro checks for the presence of the ragel tool in the system, +dnl and whether the ragel tool is absolutely needed for a complete +dnl build. +dnl +dnl To check for the need for Ragel, you have to provide the relative +dnl path of a source file generated through Ragel: if the file is +dnl present in the source tree, a missing ragel command will not cause +dnl the configure to abort. + +AC_DEFUN([_RAGEL_VARS], [ + AC_ARG_VAR([RAGEL], [Ragel generator command]) + AC_ARG_VAR([RAGELFLAGS], [Ragel generator flags]) +]) + +AC_DEFUN([CHECK_RAGEL], [ + AC_REQUIRE([_RAGEL_VARS]) + AC_CHECK_PROG([RAGEL], [ragel], [ragel], [no]) + + dnl We set RAGEL to false so that it would execute the "false" + dnl command if needed. + AS_IF([test x"$RAGEL" = x"no"], [RAGEL=false]) + + dnl Only test the need if not found + AS_IF([test x"$RAGEL" = x"false"], [ + AC_MSG_CHECKING([whether we need ragel to regenerate sources]) + AS_IF([test -a ${srcdir}/$1], [ragel_needed=no], [ragel_needed=yes]) + AC_MSG_RESULT([$ragel_needed]) + + AS_IF([test x"$ragel_needed" = x"yes"], + [AC_MSG_ERROR([dnl +You need Ragel to build from GIT checkouts. +You can find Ragel at http://www.complang.org/ragel/dnl + ])]) + ]) +]) + +AC_DEFUN([CHECK_RAGEL_AM], [ + CHECK_RAGEL([$1]) + + AM_CONDITIONAL([HAVE_RAGEL], [test x"$RAGEL" != x"false"]) +]) diff --git a/contrib/ragel.make b/contrib/ragel.make new file mode 100644 index 0000000..f7a71b5 --- /dev/null +++ b/contrib/ragel.make @@ -0,0 +1,6 @@ +# -*- Makefile -*- + +SUFFIXES = .rl + +.rl.c: + $(RAGEL) $(RAGELFLAGS) -C $< -o $@