From 995eac166a22b61054be0ccc8901db04f49a1ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 10 Mar 2014 18:14:16 +0100 Subject: [PATCH] eolian: generate eo_lexer.c with ragel if available --- configure.ac | 5 +++++ src/Makefile_Eolian.am | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index 0d7e4646fb..0b0dac3ded 100644 --- a/configure.ac +++ b/configure.ac @@ -330,6 +330,11 @@ fi AM_CONDITIONAL([EFL_ENABLE_COVERAGE], [test "${want_coverage}" = "yes"]) +# ragel + +AC_CHECK_PROG([have_ragel], [ragel], [yes], [no]) +AM_CONDITIONAL([EFL_HAVE_RAGEL], [test "${have_ragel}" = "yes"]) + #### Checks for libraries # check unit testing library diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am index 871ffffb2f..6807557b52 100644 --- a/src/Makefile_Eolian.am +++ b/src/Makefile_Eolian.am @@ -42,3 +42,16 @@ bin_eolian_eolian_gen_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@ include Makefile_Eolian_Helper.am EXTRA_DIST += lib/eolian/eo_lexer.rl + +if EFL_HAVE_RAGEL +SUFFIXES += .rl + +AM_V_RAGEL = $(am__v_RAGEL_@AM_V@) +am__v_RAGEL_ = $(am__v_RAGEL_@AM_DEFAULT_V@) +am__v_RAGEL_0 = @echo " RAGEL " $@; + +.rl.c: + $(AM_V_RAGEL) ragel -o $@ $< + +lib/eolian/eo_lexer.c: lib/eolian/eo_lexer.rl +endif