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: Juergen Gross X-Patchwork-Id: 9628311 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 280BF604AA for ; Thu, 16 Mar 2017 14:22:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 166FF2793A for ; Thu, 16 Mar 2017 14:22:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A00227C0B; Thu, 16 Mar 2017 14:22:21 +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 922B027C14 for ; Thu, 16 Mar 2017 14:22:20 +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 1coWG3-0001K8-Qf; Thu, 16 Mar 2017 14:20:03 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coWG2-0001BS-QR for xen-devel@lists.xenproject.org; Thu, 16 Mar 2017 14:20:02 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 94/AA-13971-21F9AC85; Thu, 16 Mar 2017 14:20:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRWlGSWpSXmKPExsVyuP0Ov67g/FM RBnuualh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBlXvlxiL/jMW7Fn5S72BsaZ3F2MnBwSAkYS byf+YwKxhQQWMkqs7wgBsdkEVCU2XD/FCmKLCFhJbG/ZztjFyMXBLNDGKLG6dRMbSEJYwEPi/ MdudhCbBajhd/9DsAZeAROJ9/86GSEWyEssPH8EbAGngKnEscMXWSCWmUis2XWdZQIj9wJGhl WMGsWpRWWpRbqGZnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXrJ+bmbGIH+ZQCCHYznT3s eYpTkYFIS5dUyPxUhxJeUn1KZkVicEV9UmpNafIhRhoNDSYLXYR5QTrAoNT21Ii0zBxhoMGkJ Dh4lEd7KuUBp3uKCxNzizHSI1ClGY445s3e/YeLYcfTIGyYhlrz8vFQpcd7ZIKUCIKUZpXlwg 2ARcIlRVkqYlxHoNCGegtSi3MwSVPlXjOIcjErCvIdApvBk5pXA7XsFdAoT0ClvP5wAOaUkES El1cCosZK3V/zf8z9xjz8xiuTte6Vb3BCm3rW+uLhHdOlHq/SH4kv3zgzcUVx0J+Oi7axps1b E+No5nV0Wd+ay070L0Zul//ye+bhz1rcgq57W9B+6rRF+31SnPrNvFG88KCv85sn0NoFDtv0R L83D69XXzKrTdio7eO2Knojc1Esl3erVAccc29cqsRRnJBpqMRcVJwIAkzE6w3sCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1489674001!89943467!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8849 invoked from network); 16 Mar 2017 14:20:01 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-9.tower-206.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 16 Mar 2017 14:20:01 -0000 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> Cc: anthony.perard@citrix.com, Juergen Gross , sstabellini@kernel.org, kraxel@redhat.com, paul.durrant@citrix.com Subject: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-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 <