diff options
author | Ben Pfaff <blp@nicira.com> | 2011-06-22 10:15:23 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-06-22 14:05:53 -0700 |
commit | 71fe9970f7bc88a20b307e55f924c21029af98f2 (patch) | |
tree | 4ff0679e702c04fb79796d2e290025ff58029221 /acinclude.m4 | |
parent | 8a2d6596f2cb43c097957ed6e003eb5225dd5003 (diff) |
configure: Do not reject Linux 3.0 at configure time.
Until now, the configure script has rejected any version of Linux other
than 2.6. In preparation for Linux 3.0, this allows newer versions also.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 61d15552..59c0c745 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -112,17 +112,27 @@ AC_DEFUN([OVS_CHECK_LINUX], [ AC_MSG_RESULT([$KSRC]) AC_MSG_CHECKING([for kernel version]) + version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"` patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"` sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC/Makefile"` - if test -z "$patchlevel" || test -z "$sublevel"; then + if test X"$version" = X || test X"$patchlevel" = X; then AC_ERROR([cannot determine kernel version]) + elif test X"$sublevel" = X; then + kversion=$version.$patchlevel + else + kversion=$version.$patchlevel.$sublevel fi - AC_MSG_RESULT([2.$patchlevel.$sublevel]) - if test "2.$patchlevel" != '2.6'; then + AC_MSG_RESULT([$kversion]) + + if test "$version" -ge 3; then + : # Linux 3.x + elif test "$version" = 2 && test "$patchlevel" -ge 6; then + : # Linux 2.6.x + else if test "$KBUILD" = "$KSRC"; then - AC_ERROR([Linux kernel in $KBUILD is not version 2.6]) + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6 or later is required]) else - AC_ERROR([Linux kernel in build tree $KBUILD (source tree $KSRC) is not version 2.6]) + AC_ERROR([Linux kernel in build tree $KBUILD (source tree $KSRC) is version $kversion, but version 2.6 or later is required]) fi fi if test ! -e "$KBUILD"/include/linux/version.h || \ |