diff mbox

[nft,2/5] build: use AC_PROG_YACC and AM_PROG_LEX

Message ID 1415298349-985-3-git-send-email-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Pablo Neira Ayuso Nov. 6, 2014, 6:25 p.m. UTC
To check for bison and flex installed on the system.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 configure.ac |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index e68d59f..ee9cf6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,21 @@  AC_PROG_CC
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL
 AC_PROG_SED
+AM_PROG_LEX
+AC_PROG_YACC
+
+if test -z "$ac_cv_prog_YACC"
+then
+        echo "*** Error: No suitable bison/yacc found. ***"
+        echo "    Please install the 'bison' package."
+        exit 1
+fi
+if test -z "$ac_cv_prog_LEX"
+then
+        echo "*** Error: No suitable flex/lex found. ***"
+        echo "    Please install the 'flex' package."
+        exit 1
+fi
 
 AC_CHECK_PROG(CONFIG_MAN1, [docbook2x-man], [y], [n])
 if test "$CONFIG_MAN1" == "y"
@@ -49,18 +64,6 @@  then
 	AC_MSG_WARN([dblatex not found, no PDF manpages will be built])
 fi
 
-AC_PATH_PROG(LEX, [flex])
-if test -z "$LEX"
-then
-	AC_MSG_ERROR([No suitable version of flex found])
-fi
-
-AC_PATH_PROG(YACC, [bison])
-if test -z "$YACC"
-then
-	AC_MSG_ERROR([No suitable version of bison found])
-fi
-
 # Checks for libraries.
 PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
 PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.2])