summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-05-22 00:26:30 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-05-22 00:26:30 +0200
commit8de11deb9107b0bcfc7bf3922ee7edff3dbcd73a (patch)
tree4fbffa05b458e126b3a591a89461e1983b66ea09
parent6c84554b671fce473fe333ab3d8b548a0768882b (diff)
downloadbird-8de11deb9107b0bcfc7bf3922ee7edff3dbcd73a.tar
bird-8de11deb9107b0bcfc7bf3922ee7edff3dbcd73a.zip
Better checks for M4 in configure.
-rw-r--r--aclocal.m413
-rw-r--r--configure.in13
2 files changed, 22 insertions, 4 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 584173d..f3b8953 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -145,3 +145,16 @@ if test -z "$bird_cv_sys_linux_version" ; then
AC_MSG_ERROR([Cannot determine kernel version])
fi
])])
+
+# BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
+# copied autoconf internal _AC_PATH_PROG_FLAVOR_GNU
+m4_define([BIRD_CHECK_PROG_FLAVOR_GNU],
+[# Check for GNU $1
+case `"$1" --version 2>&1` in
+*GNU*)
+ $2;;
+m4_ifval([$3],
+[*)
+ $3;;
+])esac
+])#
diff --git a/configure.in b/configure.in
index 542dd15..6ba79c3 100644
--- a/configure.in
+++ b/configure.in
@@ -14,6 +14,9 @@ AC_ARG_ENABLE(ipv6,[ --enable-ipv6 enable building of IPv6 version (d
AC_ARG_WITH(sysconfig,[ --with-sysconfig=FILE use specified BIRD system configuration file])
AC_ARG_WITH(protocols,[ --with-protocols=LIST include specified routing protocols (default: all)],,[with_protocols="all"])
AC_ARG_WITH(sysinclude,[ --with-sysinclude=PATH search for system includes on specified place])
+AC_ARG_VAR([FLEX], [location of the Flex program])
+AC_ARG_VAR([BISON], [location of the Bison program])
+AC_ARG_VAR([M4], [location of the M4 program])
if test "$srcdir" = . ; then
# Building in current directory => create obj directory holding all objects
@@ -76,10 +79,12 @@ AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_PROG(FLEX, flex, flex)
AC_CHECK_PROG(BISON, bison, bison)
-AC_CHECK_PROGS(M4, gm4 m4, m4)
-if test -z "$FLEX" -o -z "$BISON" -o -z "$M4" ; then
- AC_MSG_ERROR([Some tools required for building BIRD are missing.])
- fi
+AC_CHECK_PROGS(M4, gm4 m4)
+
+test -z "$FLEX" && AC_MSG_ERROR([Flex is missing.])
+test -z "$BISON" && AC_MSG_ERROR([Bison is missing.])
+test -z "$M4" && AC_MSG_ERROR([M4 is missing.])
+BIRD_CHECK_PROG_FLAVOR_GNU([$M4], , [AC_MSG_ERROR([Provided M4 is not GNU M4.])])
if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then
if test -f $with_sysconfig ; then