OSSP CVS Repository

ossp - Check-in [2210]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2210
Date: 2002-Jul-01 19:50:15 (local)
2002-Jul-01 17:50:15 (UTC)
User:rse
Branch:
Comment: Upgrade tool checks to new strategy which supports the new OpenPKG "flex" package.
Tickets:
Inspections:
Files:
ossp-pkg/l2/configure.ac      1.20 -> 1.21     42 inserted, 10 deleted

ossp-pkg/l2/configure.ac 1.20 -> 1.21

--- configure.ac 2002/03/14 15:29:23     1.20
+++ configure.ac 2002/07/01 17:50:15     1.21
@@ -47,22 +47,54 @@
 dnl # check for developer tools:
 dnl # GNU Bison and GNU Flex
 if test ".$enable_maintainer" = .yes; then
-    AC_PATH_PROG(BISON, bison, NA)
+    dnl # check for GNU Bison >= 1.30
+    bison_version=""
+    for prog in bison bison-beta bison-alpha bison-snap; do
+        AC_PATH_PROG(BISON, $prog, NA) 
+        if test ".$BISON" != .NA; then
+            bison_version=`($BISON --version | head -1 | sed -e 's;^[[^0-9]]*\([[0-9]][[0-9.]]*\).*;\1;') 2>/dev/null`
+            case "$bison_version" in
+                1.3[[0-9]] | 1.[[4-9]] ) break ;;
+                * ) BISON="NA"; unset ac_cv_path_BISON ;;
+            esac
+        else
+            unset ac_cv_path_BISON
+        fi
+    done
     if test ".$BISON" = .NA; then
-        AC_ERROR([require GNU Bison])
+        if test ".$bison_version" != .; then
+            AC_ERROR([found GNU Bison version $bison_version; require version >= 1.30])
+        else
+            AC_ERROR([require GNU Bison version >= 1.30])
+        fi
     fi
-    AC_PATH_PROG(FLEX,  flex,  NA) 
+    dnl # check for GNU Flex >= 2.5.6
+    flex_version=""
+    for prog in flex flex-beta flex-alpha flex-snap; do
+        AC_PATH_PROG(FLEX, $prog, NA) 
+        if test ".$FLEX" != .NA; then
+            flex_version=`($FLEX --version | head -1 | sed -e 's;^[[^0-9]]*\([[0-9]][[0-9.]]*\).*;\1;') 2>/dev/null`
+            case "$flex_version" in
+                2.5.[[6-9]] | 2.5.1[[0-9]] | 2.[[6-9]].* ) break ;;
+                * ) FLEX="NA"; unset ac_cv_path_FLEX ;;
+            esac
+        else
+            unset ac_cv_path_FLEX
+        fi
+    done
     if test ".$FLEX" = .NA; then
-        AC_ERROR([require GNU Flex])
+        if test ".$flex_version" != .; then
+            AC_ERROR([found GNU Flex version $flex_version; require version >= 2.5.6])
+        else
+            AC_ERROR([require GNU Flex version >= 2.5.6])
+        fi
     fi
-    flex_version=`(flex --version 2>/dev/null | awk '{ print $3; }')`
-    case "$flex_version" in
-        2.[[5-6]].[[6-9]] ) ;;
-        * ) AC_ERROR([found GNU Flex version $flex_version; require version >= 2.5.6 (DEVELOPER VERSION!)]) ;;
-    esac
 else
+    dnl # disable the use of the tools, but still allow manual override
+    test ".$BISON" = . && BISON=true
     AC_PATH_PROG(BISON, bison, true)
-    AC_PATH_PROG(FLEX,  flex,  true) 
+    test ".$FLEX"  = . && FLEX=true
+    AC_PATH_PROG(FLEX, flex, true)
 fi
 
 AC_CHECK_LIB(nsl, gethostname)

CVSTrac 2.0.1