]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Check for bison instead of yacc 2014/head
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 27 Dec 2014 17:11:55 +0000 (18:11 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 27 Dec 2014 17:11:55 +0000 (18:11 +0100)
Bail out if we need it but can't find it.
Part of #774

configure.ac
m4/pdns_check_bison.m4 [new file with mode: 0644]

index 19cda86960507ebef776fc4210b9c559fe326b15..1b36736a66971d9ca6ec0384b7307abee871af46 100644 (file)
@@ -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 (file)
index 0000000..7f1c83c
--- /dev/null
@@ -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])]
+    )]
+  )
+])