[gnome-commander] Add error message when flex is missing at configure step, fixing #115



commit f503ee9b3ffcaaa440c2ee60b5619faafd47577b
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Wed Jan 26 21:49:40 2022 +0100

    Add error message when flex is missing at configure step, fixing #115
    
    Also add a warning if no version >= 2.0.0 could be identified

 configure.ac | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2f5494ec..bdd3df68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,9 +18,23 @@ AX_COMPILER_FLAGS
 AX_COMPILER_FLAGS_CXXFLAGS
 AX_CXX_COMPILE_STDCXX_11
 
+dnl ===================
+dnl Check for flex
+dnl ===================
+AC_PROG_LEX(noyywrap)
+AC_PATH_PROG(FLEX, flex)
+if test -z "$FLEX"; then
+   AC_MSG_ERROR([You need the 'flex' lexer generator to compile Gnome Commander])
+else
+   FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
+   AX_COMPARE_VERSION([2.0.0],[gt],[$FLEX_VERSION],
+      AC_MSG_WARN([Could not identify the version of the installed flex command.]))
+   AX_COMPARE_VERSION([2.0.0],[gt],[$FLEX_VERSION],
+      AC_MSG_WARN([Make sure to install the official 'flex' lexer generator to compile Gnome Commander 
correctly.]))
+fi
+
 AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_LEX(noyywrap)
 LT_INIT
 
 dnl ===================
@@ -161,7 +175,6 @@ if test "x$have_pdf" = "xyes"; then
    AC_DEFINE(HAVE_PDF, 1, [Define to 1 if you have PDF support])
 fi
 
-
 dnl =====================
 dnl     Google Test
 dnl =====================


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]