-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
0606-autoconf-fix-handling-absolute-PYTHON-path.patch
55 lines (49 loc) · 1.99 KB
/
0606-autoconf-fix-handling-absolute-PYTHON-path.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From a2c4f630467fdcfa76d3a1b8ac3ef32727eb15c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
Date: Wed, 2 Jun 2021 05:24:09 +0200
Subject: [PATCH] autoconf: fix handling absolute $PYTHON path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 <[email protected]>
---
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 bb60857b030a..c3b38052ae69 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 sysconfig; \
diff --git a/tools/configure.ac b/tools/configure.ac
index be58f06be450..d4f03d4ba15b 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -382,7 +382,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], [7])
--
2.44.0