[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen ver
From: |
Juergen Gross |
Subject: |
[Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version |
Date: |
Thu, 16 Mar 2017 15:19:53 +0100 |
Instead of trying to guess the Xen version to use by compiling various
test programs first just ask the system via pkg-config. Only if it
can't return the version fall back to the test program scheme.
Signed-off-by: Juergen Gross <address@hidden>
---
configure | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/configure b/configure
index aabf098..b43fbd5 100755
--- a/configure
+++ b/configure
@@ -1983,26 +1983,12 @@ EOF
fi
xen=no
- # Xen unstable
- elif
- cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_DEVICEMODEL_API
-#define __XEN_TOOLS__
-#include <xendevicemodel.h>
-int main(void) {
- xendevicemodel_handle *xd;
-
- xd = xendevicemodel_open(0, 0);
- xendevicemodel_close(xd);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
- then
- xen_stable_libs="$xen_stable_libs -lxendevicemodel"
- xen_ctrl_version=40900
+ # Xen version via pkg-config (Xen 4.9.0 and newer)
+ elif $pkg_config --exists xencontrol ; then
+ xen_ctrl_version="$(printf '%d%02d%02d' \
+ $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
xen=yes
+
elif
cat > $TMPC <<EOF &&
/*
@@ -2214,7 +2200,12 @@ EOF
fi
if test "$xen" = yes; then
- if test $xen_ctrl_version -ge 40701 ; then
+ if test $xen_ctrl_version -ge 40900 ; then
+ xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab
xenevtchn"
+ xen_pc="$xen_pc xendevicemodel"
+ xen_libs="$($pkg_config --libs $xen_pc)"
+ QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
+ elif test $xen_ctrl_version -ge 40701 ; then
libs_softmmu="$xen_stable_libs $libs_softmmu"
fi
libs_softmmu="$xen_libs $libs_softmmu"
--
2.10.2
- [Qemu-devel] [PATCH 0/2] xen: use pkg-config for configure, Juergen Gross, 2017/03/16
- [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version,
Juergen Gross <=
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Stefano Stabellini, 2017/03/16
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Juergen Gross, 2017/03/17
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Stefano Stabellini, 2017/03/17
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Juergen Gross, 2017/03/21
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Stefano Stabellini, 2017/03/21
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Juergen Gross, 2017/03/22
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Stefano Stabellini, 2017/03/22
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Paul Durrant, 2017/03/24
- Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Paul Durrant, 2017/03/24
- Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version, Juergen Gross, 2017/03/24