qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xenproject.com
Cc: Paul Durrant <paul.durrant@citrix.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>
Subject: [Qemu-devel] [PATCH] xen: limit pkg-config to PKG_CONFIG_PATH for xen libraries
Date: Fri, 24 Mar 2017 17:18:17 +0000	[thread overview]
Message-ID: <1490375897-1181-1-git-send-email-paul.durrant@citrix.com> (raw)

The Xen tools Makefile has been modified to set PKG_CONFIG_PATH such that
use of pkg-config in QEMU configure finds the newly built Xen libraries.
However, because older versions of Xen do not set PKG_CONFIG_PATH in the
Makefile, the QEMU configure script will pick up any Xen libraries that may
be installed in the build system rather than the newly built ones. Thus,
if Xen 4.9 is built and installed it becomes impossible to build tools for
an older version of Xen on the same system (without manual de-installtion).

This patch modifies configure to set PKG_CONFIG_LIBDIR to empty when
looking for Xen libraries to ensure the search is limited only to
PKG_CONFIG_PATH. This makes sure that, for versions of Xen prior to 4.9,
pkg-config fails to find the Xen libraries an approriately falls back to
previous methods of probing.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
---
 configure | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index fdf47e4..6ef5980 100755
--- a/configure
+++ b/configure
@@ -1974,6 +1974,10 @@ fi
 ##########################################
 # xen probe
 
+xen_query_pkg_config() {
+    PKG_CONFIG_LIBDIR= ${pkg_config_exe} "$@"
+}
+
 if test "$xen" != "no" ; then
   xen_libs="-lxenstore -lxenctrl -lxenguest"
   xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
@@ -1997,9 +2001,9 @@ EOF
     xen=no
 
   # Xen version via pkg-config (Xen 4.9.0 and newer)
-  elif $pkg_config --exists xencontrol ; then
+  elif xen_query_pkg_config --exists xencontrol; then
     xen_ctrl_version="$(printf '%d%02d%02d' \
-      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
+      $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes
 
   elif
@@ -2216,8 +2220,8 @@ EOF
     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)"
+      xen_libs="$(xen_query_pkg_config --libs $xen_pc)"
+      QEMU_CFLAGS="$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)"
     elif test $xen_ctrl_version -ge 40701 ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
-- 
2.1.4

                 reply	other threads:[~2017-03-24 17:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490375897-1181-1-git-send-email-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).