From 44362487adc81cb786867d174f43684d56b030bb Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 27 Dec 2014 18:11:55 +0100 Subject: [PATCH] Check for bison instead of yacc Bail out if we need it but can't find it. Part of #774 --- configure.ac | 2 +- m4/pdns_check_bison.m4 | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 m4/pdns_check_bison.m4 diff --git a/configure.ac b/configure.ac index 19cda8696..1b36736a6 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_CANONICAL_HOST AC_PROG_CC AM_PROG_CC_C_O -AC_PROG_YACC +PDNS_CHECK_BISON AM_PROG_LEX AC_PROG_INSTALL AC_PROG_MAKE_SET diff --git a/m4/pdns_check_bison.m4 b/m4/pdns_check_bison.m4 new file mode 100644 index 000000000..7f1c83c13 --- /dev/null +++ b/m4/pdns_check_bison.m4 @@ -0,0 +1,15 @@ +AC_DEFUN([PDNS_CHECK_BISON], [ + AC_REQUIRE([AC_PROG_YACC]) + AC_REQUIRE([AC_PROG_EGREP]) + + AC_CACHE_CHECK([if bison is the parser generator],[pdns_cv_prog_bison],[ + AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '], + [pdns_cv_prog_bison=yes], [pdns_cv_prog_bison=no]) + ]) + + AS_IF([test "x$pdns_cv_prog_bison" = "xno"], [ + AS_IF([test ! -f "${srcdir}/pdns/bindparser.cc"], + [AC_MSG_ERROR([bison is missing and you don't have ${srcdir}/pdns/bindparser.cc. Please install bison])] + )] + ) +]) -- 2.40.0