From: Ben Pfaff Date: Wed, 22 Jun 2011 17:15:23 +0000 (-0700) Subject: configure: Do not reject Linux 3.0 at configure time. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71fe9970f7bc88a20b307e55f924c21029af98f2;p=openvswitch 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. --- 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 || \ diff --git a/datapath/linux-2.6/Makefile.main.in b/datapath/linux-2.6/Makefile.main.in index a868cb68..1edfc341 100644 --- a/datapath/linux-2.6/Makefile.main.in +++ b/datapath/linux-2.6/Makefile.main.in @@ -31,10 +31,6 @@ else KOBJ := $(KSRC) endif -ifneq ($(shell grep -c 'PATCHLEVEL = 6' $(KSRC)/Makefile),1) - $(error Linux kernel source in $(KSRC) not 2.6) -endif - VERSION_FILE := $(KOBJ)/include/linux/version.h ifeq (,$(wildcard $(VERSION_FILE))) $(error Linux kernel source not configured - missing version.h)