From patchwork Wed Jun 2 03:32:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 12292761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C36E7C4708F for ; Wed, 2 Jun 2021 03:32:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F13C6128A for ; Wed, 2 Jun 2021 03:32:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F13C6128A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.135413.251544 (Exim 4.92) (envelope-from ) id 1loHcC-0007zW-TV; Wed, 02 Jun 2021 03:32:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 135413.251544; Wed, 02 Jun 2021 03:32:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loHcC-0007zP-PP; Wed, 02 Jun 2021 03:32:20 +0000 Received: by outflank-mailman (input) for mailman id 135413; Wed, 02 Jun 2021 03:32:19 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1loHcB-0007zJ-5e for xen-devel@lists.xenproject.org; Wed, 02 Jun 2021 03:32:19 +0000 Received: from out5-smtp.messagingengine.com (unknown [66.111.4.29]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 17626843-21af-4aeb-8a31-52243b95928c; Wed, 02 Jun 2021 03:32:17 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C5FD65C0182; Tue, 1 Jun 2021 23:32:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 01 Jun 2021 23:32:16 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Jun 2021 23:32:15 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 17626843-21af-4aeb-8a31-52243b95928c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=JAel1Y 62j7V265HvG19jOnr5m/PUQDTrK9g934SuVcg=; b=QkXfu7vMoI4hol3jr7cBzk +c5KS4BFTB6D+9JN2V1cxVcz3bOnKy/giPr6e3wWwtqLTQ+e+VS0JKy91X/lNZy+ FObXdAMxl8ahldESq3MEcpaxrajjXmAMXqXz3vJ73rKQvmWnR5dTiT52hnXd9OCa TfPajsfmeFEvU4xCakhJoehi8ECsV28EtFZmN11F5ZZgI3p3adGXTp8niAX7mQGD 2Rr4tgksioZK/dNi2s13wXF7r/SkQ4b9Thf8NDAnhUCKeJJNJrEF8gPplhTfQsne kjk5Sl0babZ4KhtOGu83yjRRc4nAn4w/1+ISa+5Nhr24PYcyaPpnoTULZfXDWH2w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeliedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtohfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetgeet keeukeffhfejueeludehtedtkeeuiedtgffgtdfhveefueeiiefhudehgeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Ian Jackson , Wei Liu Subject: [PATCH] autoconf: fix handling absolute $PYTHON path Date: Wed, 2 Jun 2021 05:32:06 +0200 Message-Id: <20210602033206.720860-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Organization: Invisible Things Lab Don't strip full path from $PYTHON variable. This is especially relevant, if it points outside of $PATH. This is the case for RPM build on CentOS 8 (%{python3} macro points at /usr/libexec/platform-python). For this reason, adjust also python-config handling - AC_PATH_PROG doesn't work on already absolute path, so make it conditional. Signed-off-by: Marek Marczykowski-Górecki --- m4/python_devel.m4 | 6 +++++- tools/configure.ac | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/m4/python_devel.m4 b/m4/python_devel.m4 index bbf1e0354b2b..676489b8e978 100644 --- a/m4/python_devel.m4 +++ b/m4/python_devel.m4 @@ -2,7 +2,11 @@ AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [ ac_previous_cppflags=$CPPFLAGS ac_previous_ldflags=$LDFLAGS ac_previous_libs=$LIBS -AC_PATH_PROG([pyconfig], [$PYTHON-config], [no]) +AS_IF([echo "$PYTHON" | grep -q "^/"], [ + pyconfig="$PYTHON-config" +], [ + AC_PATH_PROG([pyconfig], [$PYTHON-config], [no]) +]) AS_IF([test x"$pyconfig" = x"no"], [ dnl For those that don't have python-config CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \ diff --git a/tools/configure.ac b/tools/configure.ac index 6414fcbb445e..ebf1265643b3 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -368,7 +368,6 @@ AS_IF([test -z "$PYTHON"], [AC_CHECK_PROGS([PYTHON], [python3 python python2], e AS_IF([test "$PYTHON" = "err"], [AC_MSG_ERROR([No python interpreter found])]) AS_IF([echo "$PYTHON" | grep -q "^/"], [], [AC_PATH_PROG([PYTHON], [$PYTHON])]) PYTHONPATH=$PYTHON -PYTHON=`basename $PYTHONPATH` AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON]) AX_CHECK_PYTHON_VERSION([2], [6])