configure.ac
changeset 622 eaa49b276e17
parent 369 569e7d9e2406
child 642 2ca07e3b08d6
--- 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 \