distutils-sysconfig
authorMatthias Klose <doko@debian.org>
Tue, 8 Dec 2020 07:51:42 +0000 (07:51 +0000)
committerMatthias Klose <doko@debian.org>
Tue, 8 Dec 2020 07:51:42 +0000 (07:51 +0000)
# DP: Get CONFIGURE_CFLAGS, CONFIGURE_CPPFLAGS, CONFIGURE_LDFLAGS from
# DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set
# DP: in the environment.

# DP: Get CONFIGURE_CFLAGS, CONFIGURE_CPPFLAGS, CONFIGURE_LDFLAGS from
# DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set
# DP: in the environment.

Gbp-Pq: Name distutils-sysconfig.diff

Lib/distutils/sysconfig.py

index 6edad79ab05dd6299af2075be64d4f9f08f91295..6e7ddaa9b3093e4286d5cb5a91588f87277c6ece 100644 (file)
@@ -200,9 +200,11 @@ def customize_compiler(compiler):
                 _osx_support.customize_compiler(_config_vars)
                 _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
 
-        (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
+        (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags,
+         configure_cppflags, configure_cflags, configure_ldflags) = \
             get_config_vars('CC', 'CXX', 'CFLAGS',
-                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
+                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS',
+                            'CONFIGURE_CPPFLAGS', 'CONFIGURE_CFLAGS', 'CONFIGURE_LDFLAGS')
 
         if 'CC' in os.environ:
             newcc = os.environ['CC']
@@ -223,13 +225,22 @@ def customize_compiler(compiler):
             cpp = cc + " -E"           # not always
         if 'LDFLAGS' in os.environ:
             ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+        elif configure_ldflags:
+            ldshared = ldshared + ' ' + configure_ldflags
         if 'CFLAGS' in os.environ:
             cflags = cflags + ' ' + os.environ['CFLAGS']
             ldshared = ldshared + ' ' + os.environ['CFLAGS']
+        elif configure_cflags:
+            cflags = cflags + ' ' + configure_cflags
+            ldshared = ldshared + ' ' + configure_cflags
         if 'CPPFLAGS' in os.environ:
             cpp = cpp + ' ' + os.environ['CPPFLAGS']
             cflags = cflags + ' ' + os.environ['CPPFLAGS']
             ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
+        elif configure_cppflags:
+            cpp = cpp + ' ' + configure_cppflags
+            cflags = cflags + ' ' + configure_cppflags
+            ldshared = ldshared + ' ' + configure_cppflags
         if 'AR' in os.environ:
             ar = os.environ['AR']
         if 'ARFLAGS' in os.environ:
@@ -243,7 +254,7 @@ def customize_compiler(compiler):
             compiler=cc_cmd,
             compiler_so=cc_cmd + ' ' + ccshared,
             compiler_cxx=cxx,
-            linker_so=ldshared,
+            linker_so=ldshared + ' ' + ccshared,
             linker_exe=cc,
             archiver=archiver)