]> granicus.if.org Git - pdns/commitdiff
Check for flex
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 27 Dec 2014 17:56:45 +0000 (18:56 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 12 Jan 2015 15:41:46 +0000 (16:41 +0100)
Bail out if we need it but can't find it.
Part of #774

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

index 6f6830b64d02c8539b306ffa78030a4aad3c8a0f..7f8314bd18bd31354233209a3132f6883ad2b884 100644 (file)
@@ -19,7 +19,7 @@ AC_CANONICAL_HOST
 AC_PROG_CC
 AM_PROG_CC_C_O
 PDNS_CHECK_BISON
-AM_PROG_LEX
+PDNS_CHECK_FLEX
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
diff --git a/m4/pdns_check_flex.m4 b/m4/pdns_check_flex.m4
new file mode 100644 (file)
index 0000000..e6f46d4
--- /dev/null
@@ -0,0 +1,15 @@
+AC_DEFUN([PDNS_CHECK_FLEX], [
+  AC_REQUIRE([AC_PROG_LEX])
+  AC_REQUIRE([AC_PROG_EGREP])
+
+  AC_CACHE_CHECK([if the lexer is flex],[pdns_cv_prog_flex],[
+    AS_IF([$LEX --version 2>/dev/null | $EGREP -q '^flex '],
+      [pdns_cv_prog_flex=yes], [pdns_cv_prog_flex=no])
+  ])
+
+  AS_IF([test "x$pdns_cv_prog_flex" = "xno"], [
+    AS_IF([test ! -f "${srcdir}/pdns/bindlexer.c"],
+      [AC_MSG_ERROR([flex is missing and you don't have ${srcdir}/pdns/bindlexer.c. Please install flex])]
+    )]
+  )
+])