]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
configure: Properly fail if bison or flex is missing
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 29 Jun 2020 06:55:15 +0000 (09:55 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 29 Jun 2020 06:55:15 +0000 (09:55 +0300)
If bison or flex is missing, and are needed, fail configure.

configure.ac

index 7703d0130b21847e99e42255ffdf84ca0f1d0dbb..884d42c124c3046fea7ab2f162bef52cb965b8a5 100644 (file)
@@ -297,8 +297,14 @@ AC_ISC_POSIX
 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