Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I WANT A RECENT FLEX !!!
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 29 Jan 2005 05:50:13 +0000 (05:50 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 29 Jan 2005 05:50:13 +0000 (05:50 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@817 48e7efb5-ca39-0410-a469-dd3cf9ba447f

configure.ac

index 515da6e..98c1e12 100644 (file)
@@ -68,7 +68,33 @@ dnl A C_CHECK_FUNCS([memset strchr strerror usleep])
 # does not induce extra lib dependency
 AC_PROG_LEX
 if test "$LEX" != flex; then
 # does not induce extra lib dependency
 AC_PROG_LEX
 if test "$LEX" != flex; then
-  LEX="$SHELL $missing_dir/missing flex"
+  AC_MSG_NOTICE([Will not rebuild the parsers. I want flex.])
+  LEX="$SHELL $missing_dir/missing flex";
+else
+changequote(<<, >>)dnl because of the regexp [[:blank:]]  
+  FLEX_VERSION=`flex --version`;
+  FLEX_VER_MAJ=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/\..*//g'`;
+  FLEX_VER_MED=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/g'`;
+  FLEX_VER_MIN=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/.*\.//g'`;
+changequote([, ])dnl back to normality, there is no regexp afterward
+  if test $FLEX_VER_MAJ -lt 2 ; then
+    AC_MSG_NOTICE([Will not rebuild the parsers. Your flex is too old.])
+    LEX="$SHELL $missing_dir/missing flex";
+  else
+    if test $FLEX_VER_MAJ -eq 2 ; then
+      if test $FLEX_VER_MED -lt 5 ; then
+        AC_MSG_NOTICE([Will not rebuild the parsers. Your flex is too old.])
+        LEX="$SHELL $missing_dir/missing flex";
+      else
+        if test $FLEX_VER_MED -eq 5 ; then
+          if test $FLEX_VER_MIN -lt 31 ; then
+             AC_MSG_NOTICE([Will not rebuild the parsers. Your flex is too old.])
+             LEX="$SHELL $missing_dir/missing flex";
+          fi;
+        fi;
+      fi;
+    fi;
+  fi;
 fi
                
 # Can we rebuild the xml-lexers from the XML specification?
 fi
                
 # Can we rebuild the xml-lexers from the XML specification?