]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Get Linux version from <linux/version.h>, not `uname -r`.
authorMartin Mares <mj@ucw.cz>
Sat, 20 May 2000 11:00:14 +0000 (11:00 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 20 May 2000 11:00:14 +0000 (11:00 +0000)
aclocal.m4
configure.in

index 4ec84d5bc15ac78f8d336b6f8e8917e7b57f11a9..584173d1cddbbcd9b7e9263511d8f929139696c9 100644 (file)
@@ -128,3 +128,20 @@ if test "$bird_cv_struct_ip_mreqn" = yes ; then
        AC_DEFINE(HAVE_STRUCT_IP_MREQN)
 fi
 ])
+
+AC_DEFUN(BIRD_CHECK_LINUX_VERSION,
+[AC_CACHE_CHECK([Linux kernel version], bird_cv_sys_linux_version, [
+AC_REQUIRE_CPP()dnl
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+#include <linux/version.h>
+VERSION: UTS_RELEASE
+EOF
+bird_cv_sys_linux_version=`eval "$ac_cpp conftest.$ac_ext" 2>&AC_FD_CC | sed '/^VERSION/!d;s/^VERSION: "//;s/".*//'`
+rm -rf conftest*
+if test -z "$bird_cv_sys_linux_version" ; then
+       AC_MSG_RESULT([unknown])
+       AC_MSG_ERROR([Cannot determine kernel version])
+fi
+])])
index 6d58e7c58b9334630ad065706773c090c016abf3..2ddb7abc92c4ed498489d00ae24a988f070f0fc9 100644 (file)
@@ -50,7 +50,35 @@ else
 fi
 
 AC_CANONICAL_HOST
-AC_MSG_CHECKING([which OS configuration should we use])
+
+AC_PROG_CC
+if test -z "$GCC" ; then
+       AC_MSG_ERROR([This program requires the GNU C Compiler.])
+       fi
+AC_MSG_CHECKING([what CFLAGS should we use])
+if test "$ac_test_CFLAGS" != set ; then
+       if test "$enable_warnings" = yes ; then
+               WARNS=""
+       else
+               WARNS=" -Wno-unused"
+       fi
+       CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-parentheses$WARNS"
+fi
+if test "$with_sysinclude" != no -a -n "$with_sysinclude"; then
+       CPPFLAGS="$CPPFLAGS -I$with_sysinclude"
+fi
+AC_MSG_RESULT($CFLAGS)
+
+AC_PROG_CPP
+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
+
 if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then
        if test -f $with_sysconfig ; then
                sysdesc=$with_sysconfig
@@ -64,19 +92,24 @@ elif test -f sysconfig.h ; then
        sysdesc=sysconfig
 else
        case "$ip:$host_os" in
-               ipv4:linux*)    case `uname -r` in
+               ipv4:linux*)    BIRD_CHECK_LINUX_VERSION
+                               case $bird_cv_sys_linux_version in
                                        1.*|2.0.*)      sysdesc=linux-20 ;;
                                        *)              sysdesc=linux-22 ;;
                                        esac
                                ;;
-               ipv6:linux*)    sysdesc=linux-v6
+               ipv6:linux*)    BIRD_CHECK_LINUX_VERSION
+                               case $bird_cv_sys_linux_version in
+                                       1.*|2.0.*)      AC_MSG_ERROR([This version of Linux doesn't support IPv6.]) ;;
+                                       *)              sysdesc=linux-v6 ;;
+                                       esac
                                ;;
-               *)              AC_MSG_RESULT(unknown)
-                               AC_MSG_ERROR([Cannot determine correct system configuration.])
+               *)              AC_MSG_ERROR([Cannot determine correct system configuration. Please use --with-sysconfig to set it manually.])
                                ;;
                esac
        sysdesc=$srcdir/sysdep/cf/$sysdesc.h
 fi
+AC_MSG_CHECKING([which OS configuration should we use])
 AC_MSG_RESULT($sysdesc)
 if ! test -f $sysdesc ; then
        AC_MSG_ERROR([The system configuration file is missing.])
@@ -102,34 +135,6 @@ for a in $protocols ; do
 AC_MSG_RESULT(ok)
 AC_SUBST(protocols)
 
-AC_PROG_CC
-if test -z "$GCC" ; then
-       AC_MSG_ERROR([This program requires the GNU C Compiler.])
-       fi
-AC_MSG_CHECKING([what CFLAGS should we use])
-if test "$ac_test_CFLAGS" != set ; then
-       if test "$enable_warnings" = yes ; then
-               WARNS=""
-       else
-               WARNS=" -Wno-unused"
-       fi
-       CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-parentheses$WARNS"
-fi
-if test "$with_sysinclude" != no -a -n "$with_sysinclude"; then
-       CPPFLAGS="$CPPFLAGS -I$with_sysinclude"
-fi
-AC_MSG_RESULT($CFLAGS)
-
-AC_PROG_CPP
-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
-
 case $sysdesc in
        */linux-22*|*/linux-v6*)
                AC_CHECK_HEADER(linux/rtnetlink.h,,[AC_MSG_ERROR([Appropriate version of Linux kernel headers not found.])])