提交 50ced5b3 编写于 作者: S Stefan Weil 提交者: Stefan Hajnoczi

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: NStefan Weil <sw@weilnetz.de>
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 84972cbb
...@@ -1317,10 +1317,30 @@ fi ...@@ -1317,10 +1317,30 @@ fi
if test "$xen" != "no" ; then if test "$xen" != "no" ; then
xen_libs="-lxenstore -lxenctrl -lxenguest" 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 cat > $TMPC <<EOF
#include <xenctrl.h> #include <xenctrl.h>
#include <xs.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 <stdint.h>
#include <xen/hvm/hvm_info_table.h> #include <xen/hvm/hvm_info_table.h>
#if !defined(HVM_MAX_VCPUS) #if !defined(HVM_MAX_VCPUS)
...@@ -1336,7 +1356,8 @@ int main(void) { ...@@ -1336,7 +1356,8 @@ int main(void) {
return 0; return 0;
} }
EOF EOF
if compile_prog "" "$xen_libs" ; then compile_prog "" "$xen_libs"
) ; then
xen_ctrl_version=410 xen_ctrl_version=410
xen=yes xen=yes
...@@ -1407,10 +1428,10 @@ EOF ...@@ -1407,10 +1428,10 @@ EOF
xen_ctrl_version=330 xen_ctrl_version=330
xen=yes xen=yes
# Xen not found or unsupported # Xen version unsupported
else else
if test "$xen" = "yes" ; then if test "$xen" = "yes" ; then
feature_not_found "xen" feature_not_found "xen (unsupported version)"
fi fi
xen=no xen=no
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册