blob: 6718a4a27c2a4cdddf484ab494799b8d6408b2ec (
plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
From a2b1b01045f908815090904239f24eb696d9dbd2 Mon Sep 17 00:00:00 2001
From: Mark Asselstine <mark.asselstine@windriver.com>
Date: Thu, 5 Jan 2017 16:51:02 -0500
Subject: [PATCH] configure.ac: allow PYTHON values to be passed via env
This allows the recipe to specify specific values instead of them
being 'discovered' which may lead to host contamination or similar
issues.
Updated for 4.9.0: Jeremy Puhlman
Upstream-Status: Pending
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
configure.ac | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/configure.ac b/configure.ac
index f994dd7..8774010 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,26 +106,38 @@ fi
AC_SUBST(PYTHON)
+if test -z "${PYTHON_VERSION}"; then
PYTHON_VERSION=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("VERSION"))'`
+fi
+if test -z "${PYTHON_LDVERSION}"; then
PYTHON_LDVERSION=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("LDVERSION") or "")'`
+fi
if test x"${PYTHON_LDVERSION}" = x""; then
PYTHON_LDVERSION=${PYTHON_VERSION}
fi
+if test -z "${PYTHON_INCLUDEPY}"; then
CPPFLAGS1=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write("-I" + sysconfig.get_config_var("INCLUDEPY"))'`
+else
+CPPFLAGS1="${PYTHON_INCLUDEPY}"
+fi
+if test -z "${PYTHON_CFLAGS}"; then
CPPFLAGS2=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(" ".join(filter(lambda x: x.startswith("-D"), \
sysconfig.get_config_var("CFLAGS").split())))'`
+else
+CPPFLAGS2="${PYTHON_CFLAGS}"
+fi
if test "${ENABLE_EMBEDDED}" != "yes"; then
CPPFLAGS3="-DMOD_WSGI_DISABLE_EMBEDDED"
@@ -137,21 +149,41 @@ CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"
AC_SUBST(CPPFLAGS)
+if test -z "${PYTHON_LIBDIR}"; then
PYTHONLIBDIR=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBDIR"))'`
+else
+PYTHONLIBDIR="${PYTHON_LIBDIR}"
+fi
+if test -z "${PYTHON_CFGDIR}"; then
PYTHONCFGDIR=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_path("platstdlib") +"/config")'`
+else
+PYTHONCFGDIR="${PYTHON_CFGDIR}"
+fi
+if test -z "${PYTHON_FRAMEWORKDIR}"; then
PYTHONFRAMEWORKDIR=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'`
+else
+PYTHONFRAMEWORKDIR="${PYTHON_FRAMEWORKDIR}"
+fi
+if test -z "${PYTHON_FRAMEWORKPREFIX}"; then
PYTHONFRAMEWORKPREFIX=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'`
+else
+PYTHONFRAMEWORKPREFIX="${PYTHON_FRAMEWORKPREFIX}"
+fi
+if test -z "${PYTHON_FRAMEWORK}"; then
PYTHONFRAMEWORK=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORK"))'`
+else
+PYTHONFRAMEWORK="${PYTHON_FRAMEWORK}"
+fi
if test "${PYTHON_LDVERSION}" != "${PYTHON_VERSION}"; then
PYTHONCFGDIR="${PYTHONCFGDIR}-${PYTHON_LDVERSION}"
@@ -179,12 +211,20 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \
LDLIBS1="-lpython${PYTHON_VERSION}"
fi
+ if test -z "${PYTHON_LIBS}"; then
LDLIBS2=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBS"))'`
+ else
+ LDLIBS2="${PYTHON_LIBS}"
+ fi
+ if test -z "${PYTHON_SYSLIBS}"; then
LDLIBS3=`${PYTHON} -c 'from sys import stdout; \
import sysconfig; \
stdout.write(sysconfig.get_config_var("SYSLIBS"))'`
+ else
+ LDLIBS3="${PYTHON_SYSLIBS}"
+ fi
else
LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}"
--
2.25.1
|