1 From 5855e029370e5636e3eb2283eaa8d11248744eac Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:32:23 +0100
4 Subject: [PATCH] distutils/sysconfig: use sysconfigdata
6 In order to make the use of sysconfig cross-compilation compatible,
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11 Lib/distutils/sysconfig.py | 37 ++++---------------------------------
12 1 file changed, 4 insertions(+), 33 deletions(-)
14 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
15 index 573724d..721edec 100644
16 --- a/Lib/distutils/sysconfig.py
17 +++ b/Lib/distutils/sysconfig.py
18 @@ -414,40 +414,11 @@ def expand_makefile_vars(s, vars):
22 - """Initialize the module as appropriate for POSIX systems."""
24 - # load the installed Makefile:
26 - filename = get_makefile_filename()
27 - parse_makefile(filename, g)
28 - except OSError as msg:
29 - my_msg = "invalid Python installation: unable to open %s" % filename
30 - if hasattr(msg, "strerror"):
31 - my_msg = my_msg + " (%s)" % msg.strerror
33 - raise DistutilsPlatformError(my_msg)
35 - # load the installed pyconfig.h:
37 - filename = get_config_h_filename()
38 - with open(filename) as file:
39 - parse_config_h(file, g)
40 - except OSError as msg:
41 - my_msg = "invalid Python installation: unable to open %s" % filename
42 - if hasattr(msg, "strerror"):
43 - my_msg = my_msg + " (%s)" % msg.strerror
45 - raise DistutilsPlatformError(my_msg)
47 - # On AIX, there are wrong paths to the linker scripts in the Makefile
48 - # -- these paths are relative to the Python source, but when installed
49 - # the scripts are in another directory.
51 - g['LDSHARED'] = g['BLDSHARED']
53 + # _sysconfigdata is generated at build time, see the sysconfig module
54 + from _sysconfigdata import build_time_vars
59 + _config_vars.update(build_time_vars)
62 """Initialize the module as appropriate for NT"""