diff --git a/configure.ac b/configure.ac index f46b5f06..6589119c 100644 --- a/configure.ac +++ b/configure.ac @@ -38,25 +38,9 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) # Check for dependencies (C++, AR, Lex, Yacc and Make) AC_PROG_CXX AM_PROG_AR -AC_PROG_YACC -AC_PROG_LEX AC_PROG_MAKE_SET -AC_PATH_PROG([FLEX], [flex]) -test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build ModSecurity]) - -AC_PATH_PROG([BISON], [bison]) -test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build ModSecurity]) - -AC_PATH_PROG([YACC_INST], $YACC) -if test ! -f "$srcdir/gram.c"; then - if test -z "$YACC_INST"; then - AC_MSG_ERROR([yacc not found - unable to compile ModSecurity]) - fi -fi - - # Check if the compiler is c++11 compatible. # AX_CXX_COMPILE_STDCXX_11(,mandatory) @@ -261,6 +245,22 @@ AC_ARG_ENABLE(parser-generation, ) +if test $buildParser = true; then + AC_PROG_YACC + AC_PROG_LEX + AC_PATH_PROG([FLEX], [flex]) + test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build ModSecurity]) + + AC_PATH_PROG([BISON], [bison]) + test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build ModSecurity]) + + AC_PATH_PROG([YACC_INST], $YACC) + if test ! -f "$srcdir/gram.c"; then + if test -z "$YACC_INST"; then + AC_MSG_ERROR([yacc not found - unable to compile ModSecurity]) + fi + fi +fi # Decide if we want to build the tests or not. diff --git a/src/Makefile.am b/src/Makefile.am index 8e09559b..361740b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -287,7 +287,6 @@ libmodsecurity_la_LIBADD = \ $(GLOBAL_LDADD) \ $(CURL_LDADD) \ $(GEOIP_LDFLAGS) $(GEOIP_LDADD) \ - @LEXLIB@ \ $(PCRE_LDADD) \ $(YAJL_LDFLAGS) $(YAJL_LDADD) \ $(LMDB_LDFLAGS) $(LMDB_LDADD) \