]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Better checks for M4 in configure.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 21 May 2009 22:26:30 +0000 (00:26 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 21 May 2009 22:26:30 +0000 (00:26 +0200)
aclocal.m4
configure.in

index 584173d1cddbbcd9b7e9263511d8f929139696c9..f3b89530cf904564e297170497478cb227f42677 100644 (file)
@@ -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
+])#
index 542dd15457512177ea2120335828fb0898699245..6ba79c393b24f93c1ff40e4305bc3c5770f02a63 100644 (file)
@@ -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