From patchwork Thu Mar 16 14:19:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9628305 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 65BB5604AA for ; Thu, 16 Mar 2017 14:20:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55C4F285EB for ; Thu, 16 Mar 2017 14:20:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49E0F28658; Thu, 16 Mar 2017 14:20:33 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 01CC8285EB for ; Thu, 16 Mar 2017 14:20:31 +0000 (UTC) Received: from localhost ([::1]:43800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWGT-0002cX-FF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Mar 2017 10:20:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coWG7-0002Xj-2Q for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coWG3-0008Ud-Sq for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:60566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1coWG3-0008SY-Lp for qemu-devel@nongnu.org; Thu, 16 Mar 2017 10:20:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 10528AD70; Thu, 16 Mar 2017 14:20:01 +0000 (UTC) From: Juergen Gross To: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org Date: Thu, 16 Mar 2017 15:19:53 +0100 Message-Id: <20170316141953.16161-3-jgross@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170316141953.16161-1-jgross@suse.com> References: <20170316141953.16161-1-jgross@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version 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@citrix.com, Juergen Gross , sstabellini@kernel.org, kraxel@redhat.com, paul.durrant@citrix.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 < -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 <