All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Ian Jackson" <iwj@xenproject.org>, "Wei Liu" <wl@xen.org>
Subject: [PATCH] autoconf: fix handling absolute $PYTHON path
Date: Wed,  2 Jun 2021 05:32:06 +0200	[thread overview]
Message-ID: <20210602033206.720860-1-marmarek@invisiblethingslab.com> (raw)

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 <marmarek@invisiblethingslab.com>
---
 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])
-- 
2.26.3



             reply	other threads:[~2021-06-02  3:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  3:32 Marek Marczykowski-Górecki [this message]
2021-07-27 12:40 ` [PATCH] autoconf: fix handling absolute $PYTHON path Marek Marczykowski-Górecki
2021-07-27 13:56 ` Ian Jackson
2021-07-27 15:29   ` Marek Marczykowski-Górecki
2021-07-27 15:48     ` Andrew Cooper
2021-07-27 15:54     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210602033206.720860-1-marmarek@invisiblethingslab.com \
    --to=marmarek@invisiblethingslab.com \
    --cc=iwj@xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.