aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2011-12-17 09:27:39 +0100
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-12-19 11:03:43 +0000
commit50ced5b3b108aba7f9b2c8e6f7de4e924f30f83b (patch)
tree4a5c68806d81a892a8f1f8cff33c02020db03d8d
parent84972cbb06046ad7b60e9c388509b9b96fa0510d (diff)
configure: Improve Xen autodetection for hosts without Xen
With this patch, it only takes one test (instead of four) to detect that there is no Xen support at all. For most build hosts, this will reduce the time configure needs. It will also reduce noisy output in config.log. Build hosts with Xen now need up to five (instead of up to four) tests. They get improved diagnostics when Xen support fails. Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-rwxr-xr-xconfigure29
1 files changed, 25 insertions, 4 deletions
diff --git a/configure b/configure
index 36ee84986..640e81536 100755
--- a/configure
+++ b/configure
@@ -1317,10 +1317,30 @@ fi
if test "$xen" != "no" ; then
xen_libs="-lxenstore -lxenctrl -lxenguest"
- # Xen unstable
+ # First we test whether Xen headers and libraries are available.
+ # If no, we are done and there is no Xen support.
+ # If yes, more tests are run to detect the Xen version.
+
+ # Xen (any)
cat > $TMPC <<EOF
#include <xenctrl.h>
#include <xs.h>
+int main(void) {
+ return 0;
+}
+EOF
+ if ! compile_prog "" "$xen_libs" ; then
+ # Xen not found
+ if test "$xen" = "yes" ; then
+ feature_not_found "xen"
+ fi
+ xen=no
+
+ # Xen unstable
+ elif (
+ cat > $TMPC <<EOF
+#include <xenctrl.h>
+#include <xs.h>
#include <stdint.h>
#include <xen/hvm/hvm_info_table.h>
#if !defined(HVM_MAX_VCPUS)
@@ -1336,7 +1356,8 @@ int main(void) {
return 0;
}
EOF
- if compile_prog "" "$xen_libs" ; then
+ compile_prog "" "$xen_libs"
+ ) ; then
xen_ctrl_version=410
xen=yes
@@ -1407,10 +1428,10 @@ EOF
xen_ctrl_version=330
xen=yes
- # Xen not found or unsupported
+ # Xen version unsupported
else
if test "$xen" = "yes" ; then
- feature_not_found "xen"
+ feature_not_found "xen (unsupported version)"
fi
xen=no
fi