configure: Reject incompatible XenServer version.
authorBen Pfaff <blp@nicira.com>
Tue, 22 Feb 2011 22:47:19 +0000 (14:47 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 23 Feb 2011 00:40:57 +0000 (16:40 -0800)
Suggested-by: Andrew Evans <aevans@nicira.com>
acinclude.m4
configure.ac

index 6a829d596416fa72ae97f50b1ff6bbe3d474f964..e2bd2c6ff496ba581d4099f644fef0b78a71257d 100644 (file)
@@ -306,3 +306,29 @@ AC_DEFUN([OVS_CONDITIONAL_CC_OPTION],
     [$1], [ovs_have_cc_option=yes], [ovs_have_cc_option=no])
    AM_CONDITIONAL([$2], [test $ovs_have_cc_option = yes])])
 dnl ----------------------------------------------------------------------
+
+dnl Check for too-old XenServer.
+AC_DEFUN([OVS_CHECK_XENSERVER_VERSION],
+  [AC_CACHE_CHECK([XenServer release], [ovs_cv_xsversion],
+    [if test -e /etc/redhat-release; then
+       ovs_cv_xsversion=`sed -n 's/^XenServer DDK release \([[^-]]*\)-.*/\1/p' /etc/redhat-release`
+     fi
+     if test -z "$ovs_cv_xsversion"; then
+       ovs_cv_xsversion=none
+     fi])
+  case $ovs_cv_xsversion in
+    none)
+      ;;
+
+    [[1-9]][[0-9]]* |                    dnl XenServer 10 or later
+    [[6-9]]* |                           dnl XenServer 6 or later
+    5.[[7-9]]* |                         dnl XenServer 5.7 or later
+    5.6.[[1-9]][[0-9]][[0-9]][[0-9]]* |  dnl XenServer 5.6.1000 or later
+    5.6.[[2-9]][[0-9]][[0-9]]* |         dnl XenServer 5.6.200 or later
+    5.6.1[[0-9]][[0-9]])                 dnl Xenserver 5.6.100 or later
+      ;;
+
+    *)
+      AC_MSG_ERROR([This appears to be XenServer $ovs_cv_xsversion, but only XenServer 5.6.100 or later is supported.  (If you are really using a supported version of XenServer, you may override this error message by specifying 'ovs_cv_xsversion=5.6.100' on the "configure" command line.)])
+      ;;
+  esac])
index 47d09076e74622ac3d074d754839e5a32081a975..04834c28a92444a8c640d6bb554ecf92b5aade05 100644 (file)
@@ -65,6 +65,7 @@ OVS_CHECK_MALLOC_HOOKS
 OVS_CHECK_VALGRIND
 OVS_CHECK_SOCKET_LIBS
 OVS_CHECK_LINKER_SECTIONS
+OVS_CHECK_XENSERVER_VERSION
 
 OVS_ENABLE_OPTION([-Wall])
 OVS_ENABLE_OPTION([-Wno-sign-compare])