diff --git a/Makefile.am b/Makefile.am index 982da2d8f454db81761f704ee51d6e7f8632946f..4885799b9aee1c38a7963c5fd68e5ab5bbcd4d0a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,6 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = libtap src tests samples doc man patches AM_DISTCHECK_CONFIGURE_FLAGS = \ - --without-ragel \ --disable-code-coverage code_coverage_quiet = --quiet diff --git a/configure.ac b/configure.ac index 00a2e84b184c5cf8bc7ce5649d0d92dbb67cd6b3..e075bb06c1884870bf7cf499b2fc3fadd61ab91f 100644 --- a/configure.ac +++ b/configure.ac @@ -64,36 +64,11 @@ AS_IF([test "x$YACC_BISON" != "xbison"], [AC_MSG_ERROR([GNU bison needed for reentrant parsers, set the \$YACC variable before running configure])]) AC_PROG_INSTALL -# Check for Ragel -AC_ARG_WITH([ragel], - AC_HELP_STRING([--with-ragel=path], [Path to Ragel binary. [default=auto]]), - [with_ragel=$withval], - [with_ragel=auto]) - -AS_CASE([$with_ragel], - [yes|auto], [AC_PATH_PROG([RAGEL], [ragel], [false])], - [no], [RAGEL=false], - [*], [RAGEL=$with_ragel], -) - -AM_CONDITIONAL([HAVE_RAGEL], test "$RAGEL" != "false") - -# Set FSM type for Ragel +# Set zone parser type AC_ARG_ENABLE([fastparser], - AS_HELP_STRING([--disable-fastparser], [Don't use faster zone parser]), - [], - [enable_fastparser=yes]) - -AS_CASE([$enable_fastparser], - [no], [AC_SUBST([FSM_TYPE], [-T0])], - [yes], [AC_SUBST([FSM_TYPE], [-G2])], - [*], [ - AS_IF([test "$RAGEL" = "false"], - [AC_MSG_ERROR([Ragel is needed to generate different parsers])]) - AC_SUBST([FSM_TYPE], [$enable_fastparser]) - ]) -AM_CONDITIONAL([G2_PARSER], test "$enable_fastparser" = "yes") -AM_CONDITIONAL([T0_PARSER], test "$enable_fastparser" = "no") + AS_HELP_STRING([--disable-fastparser], [Use slower zone parser]), + [], [enable_fastparser=yes]) +AM_CONDITIONAL([FAST_PARSER], [test "$enable_fastparser" = yes]) # Systemd integration AC_ARG_ENABLE([systemd], @@ -398,9 +373,9 @@ echo " CFlags: ${CFLAGS} ${CPPFLAGS} LDFlags: ${LDFLAGS} Libs: ${LIBS} - Ragel: ${RAGEL} ${FSM_TYPE} + Fast zone parser: ${enable_fastparser} Utils with IDN: ${libidn} - Use systemd notifications: ${enable_systemd} + Systemd notifications: ${enable_systemd} Code coverage: ${enable_code_coverage} Continue with 'make' command" diff --git a/scripts/update-parser.sh b/scripts/update-parser.sh index e1fe5b68f4991950e2494a2c81188dda1867184f..bc965c9444e920387054adc284bea85fd75f5eb2 100755 --- a/scripts/update-parser.sh +++ b/scripts/update-parser.sh @@ -1,11 +1,16 @@ #!/bin/bash +IN="./scanner.rl" +OUT="./scanner.c" + pushd ../src/zscanner/ -ragel -T0 -s -o ./scanner.c ./scanner.rl -sed '/#line/d' ./scanner.c > ./scanner.c.t0 +ragel -T0 -s -o $OUT $IN +sed '/#line/d' $OUT > $OUT.t0 +rm $OUT -ragel -G2 -s -o ./scanner.c ./scanner.rl -sed '/#line/d' ./scanner.c > ./scanner.c.g2 +ragel -G2 -s -o $OUT $IN +sed '/#line/d' $OUT > $OUT.g2 +rm $OUT popd diff --git a/src/zscanner/Makefile.am b/src/zscanner/Makefile.am index e8cfdf48441a099d122aa6963d335848f4648016..65c9b9d7b5aa97efd5e3486decfccfb8df3d8d99 100644 --- a/src/zscanner/Makefile.am +++ b/src/zscanner/Makefile.am @@ -14,27 +14,15 @@ EXTRA_DIST = \ BUILT_SOURCES = scanner.c CLEANFILES = scanner.c -if HAVE_RAGEL -scanner.c: scanner.rl scanner_body.rl - $(RAGEL) $(FSM_TYPE) -o $@ $(srcdir)/scanner.rl -else - -if G2_PARSER +if FAST_PARSER scanner.c: scanner.c.g2 cp $(srcdir)/$@.g2 $@ -endif - -if T0_PARSER + @echo "NOTE: Compilation of scanner.c can take several minutes!" +else scanner.c: scanner.c.t0 cp $(srcdir)/$@.t0 $@ endif -endif #HAVE_RAGEL - -if G2_PARSER - @echo "NOTE: Compilation of scanner.c can take several minutes!" -endif - libzscanner_la_SOURCES = \ zscanner.h \ scanner.h \