Commit c8c861be authored by Ondřej Surý's avatar Ondřej Surý

Use AM_CONDITIONAL(HAVE_RAGEL, ...) to rebuild ragel parser only if ragel is available

Change-Id: I904cf4ea0a99652f2a2370fde17af770b1273dc4
parent 6fd62c05
......@@ -61,8 +61,9 @@ AS_IF([test "x$YACC_BISON" != "xbison"],
AC_PROG_INSTALL
# Check for Ragel
AC_PATH_PROG([RAGEL], [ragel], [echo !UNPROCESSED! ragel])
AC_PATH_PROG([RAGEL], [ragel], [true])
AM_CONDITIONAL([HAVE_RAGEL], test "$RAGEL" != "true")
# Set FSM type for Ragel
AC_SUBST([FSM_TYPE], [-T0])
AC_ARG_ENABLE([fastparser],
......
......@@ -20,14 +20,22 @@ EXTRA_DIST = \
BUILT_SOURCES = \
knot/conf/libknotd_la-cf-lex.c \
knot/conf/libknotd_la-cf-parse.c \
knot/conf/libknotd_la-cf-parse.h \
zscanner/scanner.c
knot/conf/libknotd_la-cf-parse.h
CLEANFILES = \
knot/conf/libknotd_la-cf-lex.c \
knot/conf/libknotd_la-cf-parse.c \
knot/conf/libknotd_la-cf-parse.h
if HAVE_RAGEL
BUILT_SOURCES += zscanner/scanner.c
CLEANFILES += zscanner/scanner.c
zscanner/scanner.c: zscanner/scanner.rl zscanner/scanner_body.rl
$(RAGEL) $(FSM_TYPE) -s -o $@ $(srcdir)/zscanner/scanner.rl
endif
knotc_SOURCES = \
knot/ctl/knotc_main.c
......@@ -279,9 +287,6 @@ libknotd_la_SOURCES = \
knot/zone/zone-load.c \
knot/server/server.h
zscanner/scanner.c: zscanner/scanner.rl zscanner/scanner_body.rl
$(RAGEL) $(FSM_TYPE) -s -o $@ $(srcdir)/zscanner/scanner.rl
zscanner_tool_SOURCES = \
zscanner/test/zscanner-tool.c \
zscanner/test/tests.h \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment