I've often seen people asking for help compiling Wget because a file, css.c cannot be found. This occurs because Flex is required to generate that file. However, configure does not attempt to check if flex is installed on the system.

I believe that even if a dependency is documented in the README files, the configure script **MUST** check for it before continuing. Hence, I'd like to push this patch which checks for the existence of flex before continuing.

--
Thanking You,
Darshit Shah
From 57a5cef8556f497511c2320f8f8295fae23a4c6b Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Sun, 23 Nov 2014 16:39:19 +0530
Subject: [PATCH] Check for flex in configure

---
 ChangeLog    |  4 ++++
 configure.ac | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e7dbd6a..28ef3bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-23  Darshit Shah  <[email protected]>
+
+	* configure.ac: Add test for flex before compiling
+
 2014-11-22  Darshit Shah  <[email protected]>
 
 	* build-aux/build_info.pl: Include version.h in the final C file generated
diff --git a/configure.ac b/configure.ac
index 43949a2..64e7437 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,18 @@ AS_IF([test "x$ENABLE_ASSERTION" != xyes], [
   ],
   [])
 
+
+dnl
+dnl Check for Build Time Dependencies
+dnl
+dnl Check for flex before the compiler since it is logically required before the
+dnl C compiler kicks in.
+dnl
+AC_CHECK_PROG(HAVE_FLEX, flex, yes, no)
+AS_IF([test "x$HAVE_FLEX" != xyes], [
+       AC_MSG_ERROR([Flex is required to compile GNU Wget. Please install flex before continuing.])
+])
+
 dnl
 dnl Find the compiler
 dnl
-- 
2.1.3

Attachment: pgpkPazpKV3m6.pgp
Description: PGP signature

Reply via email to