aboutsummaryrefslogtreecommitdiff
path: root/examples/python2.7/patches/distutils-sysconfig.diff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/python2.7/patches/distutils-sysconfig.diff')
-rw-r--r--examples/python2.7/patches/distutils-sysconfig.diff33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/python2.7/patches/distutils-sysconfig.diff b/examples/python2.7/patches/distutils-sysconfig.diff
new file mode 100644
index 0000000..ec1a84c
--- /dev/null
+++ b/examples/python2.7/patches/distutils-sysconfig.diff
@@ -0,0 +1,33 @@
+# DP: Allow setting BASECFLAGS, OPT and EXTRA_LDFLAGS (like, CC, CXX, CPP,
+# DP: CFLAGS, CPPFLAGS, CCSHARED, LDSHARED) from the environment.
+
+Index: b/Lib/distutils/sysconfig.py
+===================================================================
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -153,8 +153,8 @@
+ varies across Unices and is stored in Python's Makefile.
+ """
+ if compiler.compiler_type == "unix":
+- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
+- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
++ (cc, cxx, opt, cflags, extra_cflags, basecflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
++ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', 'EXTRA_CFLAGS', 'BASECFLAGS',
+ 'CCSHARED', 'LDSHARED', 'SO', 'AR',
+ 'ARFLAGS')
+
+@@ -200,8 +200,13 @@
+ cpp = cc + " -E" # not always
+ if 'LDFLAGS' in os.environ:
+ ldshared = ldshared + ' ' + os.environ['LDFLAGS']
++ if 'BASECFLAGS' in os.environ:
++ basecflags = os.environ['BASECFLAGS']
++ if 'OPT' in os.environ:
++ opt = os.environ['OPT']
++ cflags = ' '.join(str(x) for x in (basecflags, opt, extra_cflags) if x)
+ if 'CFLAGS' in os.environ:
+- cflags = opt + ' ' + os.environ['CFLAGS']
++ cflags = ' '.join(str(x) for x in (basecflags, opt, os.environ['CFLAGS'], extra_cflags) if x)
+ ldshared = ldshared + ' ' + os.environ['CFLAGS']
+ if 'CPPFLAGS' in os.environ:
+ cpp = cpp + ' ' + os.environ['CPPFLAGS']