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
|
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -558,6 +558,12 @@ def get_config_vars(*args):
# the init-function.
_CONFIG_VARS['userbase'] = _getuserbase()
+ multiarch = get_config_var('MULTIARCH')
+ if multiarch:
+ _CONFIG_VARS['multiarchsubdir'] = '/' + multiarch
+ else:
+ _CONFIG_VARS['multiarchsubdir'] = ''
+
# Always convert srcdir to an absolute path
srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
if os.name == 'posix':
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -112,6 +112,9 @@ def get_python_inc(plat_specific=0, pref
incdir = os.path.join(get_config_var('srcdir'), 'Include')
return os.path.normpath(incdir)
python_dir = 'python' + get_python_version() + build_flags
+ if not python_build and plat_specific:
+ import sysconfig
+ return sysconfig.get_path('platinclude')
return os.path.join(prefix, "include", python_dir)
elif os.name == "nt":
if python_build:
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -794,6 +794,7 @@ Modules/signalmodule.o: $(srcdir)/Module
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
$(CC) -c $(PY_CORE_CFLAGS) \
+ $(if $(MULTIARCH),-DMULTIARCH='"$(MULTIARCH)"') \
-DSOABI='"$(SOABI)"' \
-o $@ $(srcdir)/Python/dynload_shlib.c
@@ -1477,7 +1478,7 @@ inclinstall:
LIBPL= @LIBPL@
# pkgconfig directory
-LIBPC= $(LIBDIR)/pkgconfig
+LIBPC= $(LIBDIR)/$(MULTIARCH)/pkgconfig
libainstall: @DEF_MAKE_RULE@ python-config
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
|