summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2013-10-04 17:21:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-18 11:00:15 +0200
commit11e7475402861ab2719cfefce35a405298946b71 (patch)
tree976565dde4da42647c29a4d68b857a9caf3418c3
parentf2422ab90d92104915b93e96f647a89bbf55ad30 (diff)
Check for minimum version of flex (2.5.35)
since at least 5c2ba4aad61ce2c7c661202ae7ed26e1859c5216 flex 2.5.35 or newer is required, but linux baseline (CentOS 5.9) shippes with older one. Fail in configure/autogen instead of during make Signed-off-by: Stephan Bergmann <sbergman@redhat.com> ...and gracefully cope with Mac OS X flex --version returning "flex 2.5.35 Apple(flex-31)", so just look for the first run of d.d.d when determining the version number Change-Id: Ia5a324474aaa1a45910f50b4a78ab6ce6279575e
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index efbebc2ef5a3..65013ae15053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9711,6 +9711,12 @@ fi
AC_PATH_PROG(FLEX, flex)
if test -z "$FLEX"; then
AC_MSG_ERROR([no flex found in \$PATH, install it])
+else
+ AC_MSG_CHECKING([the flex version])
+ _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
+ if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
+ AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
+ fi
fi
AC_SUBST([FLEX])
dnl ***************************************