Add check bison version in configure.ac file.
authorManuele Conti <conti.ma@alice.it>
Mon, 30 Jul 2012 22:59:00 +0200
changeset 622 eaa49b276e17
parent 621 e3616f6b6959
child 623 3e991e4e1a37
Add check bison version in configure.ac file.
To build correctly matiec we need bison greater or equals than 2.4 version.
Now the "configure" script is able to check if system has correctly requirements.
configure.ac
--- a/configure.ac	Thu Aug 16 18:28:23 2012 +0100
+++ b/configure.ac	Mon Jul 30 22:59:00 2012 +0200
@@ -25,6 +25,21 @@
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_PROG_RANLIB
+AC_PROG_AWK
+
+# Check bison version, we need a version great or equal than 2.4 to build matiec.
+[[[ $(bison --version) =~ ([0-9][.][0-9]*) ]]] && version_bison="${BASH_REMATCH[[1]]}"
+
+AS_IF([awk -v ver="$version_bison" 'BEGIN { if (ver < 2.4) exit 1; }'],
+	[have_bison_correct=yes], [have_bison_correct=no])
+
+
+if test "x${have_bison_correct}" = xno; then
+  echo "------------------------------------------"
+  echo " Wrong bison version: $version_bison < 2.4 "
+  echo "------------------------------------------"
+  (exit 1); exit 1;
+fi
 
 # Checks for header files.
 AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h strings.h sys/timeb.h unistd.h])
@@ -47,6 +62,7 @@
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([clock_gettime memset pow strcasecmp strdup strtoul strtoull])
 
+
 AC_CONFIG_MACRO_DIR([config])
 
 AC_CONFIG_FILES([Makefile \