From patchwork Fri Mar 24 17:20:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 9643405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9290160327 for ; Fri, 24 Mar 2017 17:23:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 834CE26E4E for ; Fri, 24 Mar 2017 17:23:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76E1626E4C; Fri, 24 Mar 2017 17:23:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EC64826E4C for ; Fri, 24 Mar 2017 17:23:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crSsp-0001Yj-P0; Fri, 24 Mar 2017 17:20:15 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crSso-0001YS-Ix for xen-devel@lists.xenproject.org; Fri, 24 Mar 2017 17:20:14 +0000 Received: from [85.158.143.35] by server-9.bemta-6.messagelabs.com id AF/97-14382-D4555D85; Fri, 24 Mar 2017 17:20:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXitHSDva5v6NU Ig653Ihbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a8ie/ZC1YLV3yafZWlgbFFoIuRk0NCwF+i 7+1OdhCbTUBHYurTS6wgtoiArUT/9+9ANhcHs8AyRok1kx8zdzFycAgLBEksuCcNUsMioCpx5 9spJhCbV8BN4uGki0wQM+Ukzh//yQxiCwmoSKyfOosNokZQ4uTMJywgNrOAhMTBFy+YJzByz0 KSmoUktYCRaRWjRnFqUVlqka6RuV5SUWZ6RkluYmaOrqGBmV5uanFxYnpqTmJSsV5yfu4mRmA wMADBDsbFawMPMUpyMCmJ8rptuxIhxJeUn1KZkVicEV9UmpNafIhRhoNDSYLXLuRqhJBgUWp6 akVaZg4wLGHSEhw8SiK8SiBp3uKCxNzizHSI1ClGXY45s3e/YRJiycvPS5US5/0TDFQkAFKUU ZoHNwIWI5cYZaWEeRmBjhLiKUgtys0sQZV/xSjOwagkzGsKsoonM68EbtMroCOYgI6YveEKyB EliQgpqQbG4EAp05uTf1San6jbO8noSPUnV+unbWmMa/q/fp8hGVSsvG5ew5qlv3ckZife3ah 2ve2cvn/S4TfHYv5diWxm2JL6ZkZU57LLPEu2TrwxMTkxfa592v9mgZ0WN95v2fy07FHongfl 03vvJC0OMT3HrKhqHaw843Gmx//SDWuOTEhL/NpW7fBXXYmlOCPRUIu5qDgRALoNDGWMAgAA X-Env-Sender: prvs=249263d75=Paul.Durrant@citrix.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1490376011!59566560!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4650 invoked from network); 24 Mar 2017 17:20:13 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 24 Mar 2017 17:20:13 -0000 X-IronPort-AV: E=Sophos;i="5.36,215,1486425600"; d="scan'208";a="424583603" From: Paul Durrant To: , Date: Fri, 24 Mar 2017 17:20:02 +0000 Message-ID: <1490376002-1223-1-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Anthony Perard , Juergen Gross , Paul Durrant , Stefano Stabellini Subject: [Xen-devel] [PATCH RESEND] xen: limit pkg-config to PKG_CONFIG_PATH for xen libraries X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 +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