AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX # lucene plugin needs this
-AC_CHECK_TOOL([FLEX],[flex],AC_ERROR(flex is required))
-AC_CHECK_TOOL([BISON],[bison],AC_ERROR(bison is required))
+AC_CHECK_TOOL([FLEX],[flex],[:])
+AC_CHECK_TOOL([BISON],[bison],[:])
+AS_IF([test "$BISON" = ":" && test ! -e src/lib/event-filter-parser.h],
+ AC_MSG_ERROR([Bison is required when building from git])
+])
+AS_IF([test "$FLEX" = ":" && test ! -e src/lib/event-filter-lexer.c],
+ AC_MSG_ERROR([flex is required when building from git])
+])
AC_HEADER_STDC
AC_C_INLINE
AC_PROG_LIBTOOL