void-packages/srcpkgs/python/patches/sysconfig.patch
newbluemoon 1a9e85068b python: restore previous distutils.sysconfig CFLAGS handling
CFLAGS retrieved via get_config_vars() had been
overwritten in Lib/distutils/sysconfig.py’s
function customize_compiler() when the CFLAGS
environment variable had been set. With 2.7.17
the flags are appended which leads to using host
CFLAGS when cross compiling.

The patch restores the old behaviour.
2019-11-20 17:55:32 +01:00

22 lines
1.1 KiB
Diff

--- Lib/distutils/sysconfig.py 2019-10-19 20:38:44.000000000 +0200
+++ Lib/distutils/sysconfig.py 2019-03-02 19:17:42.000000000 +0100
@@ -181,8 +171,8 @@
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
- (cc, cxx, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
- get_config_vars('CC', 'CXX', 'CFLAGS',
+ (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
+ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO', 'AR',
'ARFLAGS')
@@ -206,7 +196,7 @@
if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
- cflags = cflags + ' ' + os.environ['CFLAGS']
+ cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']