From nobody Mon Apr 29 13:34:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490375958405614.1711725775427; Fri, 24 Mar 2017 10:19:18 -0700 (PDT) Received: from localhost ([::1]:34202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crSrt-0007Ys-8F for importer@patchew.org; Fri, 24 Mar 2017 13:19:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crSr6-0007Fd-Pz for qemu-devel@nongnu.org; Fri, 24 Mar 2017 13:18:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crSr2-0001Zr-Fc for qemu-devel@nongnu.org; Fri, 24 Mar 2017 13:18:28 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:13687) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1crSr2-0001Ym-95 for qemu-devel@nongnu.org; Fri, 24 Mar 2017 13:18:24 -0400 X-IronPort-AV: E=Sophos;i="5.36,215,1486425600"; d="scan'208";a="424583353" From: Paul Durrant To: , Date: Fri, 24 Mar 2017 17:18:17 +0000 Message-ID: <1490375897-1181-1-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Subject: [Qemu-devel] [PATCH] xen: limit pkg-config to PKG_CONFIG_PATH for xen libraries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , Juergen Gross , Paul Durrant , Stefano Stabellini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- Cc: Anthony Perard Cc: Stefano Stabellini Cc: Juergen Gross --- 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 =20 +xen_query_pkg_config() { + PKG_CONFIG_LIBDIR=3D ${pkg_config_exe} "$@" +} + if test "$xen" !=3D "no" ; then xen_libs=3D"-lxenstore -lxenctrl -lxenguest" xen_stable_libs=3D"-lxenforeignmemory -lxengnttab -lxenevtchn" @@ -1997,9 +2001,9 @@ EOF xen=3Dno =20 # 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=3D"$(printf '%d%02d%02d' \ - $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" + $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )" xen=3Dyes =20 elif @@ -2216,8 +2220,8 @@ EOF if test $xen_ctrl_version -ge 40900 ; then xen_pc=3D"xencontrol xenstore xenguest xenforeignmemory xengnttab xe= nevtchn" xen_pc=3D"$xen_pc xendevicemodel" - xen_libs=3D"$($pkg_config --libs $xen_pc)" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" + xen_libs=3D"$(xen_query_pkg_config --libs $xen_pc)" + QEMU_CFLAGS=3D"$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)" elif test $xen_ctrl_version -ge 40701 ; then libs_softmmu=3D"$xen_stable_libs $libs_softmmu" fi --=20 2.1.4