From: Matthias Klose Date: Thu, 17 Mar 2022 07:20:01 +0000 (+0000) Subject: deb-setup X-Git-Tag: archive/raspbian/3.9.11-1+rpi1^2~38 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5424227c16a9a14e401bd19a137e4bdc6ee99b54;p=python3.9.git deb-setup # DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths # DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths Gbp-Pq: Name deb-setup.diff --- diff --git a/setup.py b/setup.py index 0bec170..7fda091 100644 --- a/setup.py +++ b/setup.py @@ -440,8 +440,10 @@ class PyBuildExt(build_ext): # unfortunately, distutils doesn't let us provide separate C and C++ # compilers if compiler is not None: - (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') - args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + (ccshared, cppflags, cflags) = \ + sysconfig.get_config_vars('CCSHARED', 'CPPFLAGS', 'CFLAGS') + cppflags = ' '.join([f for f in cppflags.split() if not f.startswith('-I')]) + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cppflags + ' ' + cflags self.compiler.set_executables(**args) def build_extensions(self): @@ -733,12 +735,7 @@ class PyBuildExt(build_ext): add_dir_to_list(dir_list, directory) def configure_compiler(self): - # Ensure that /usr/local is always used, but the local build - # directories (i.e. '.' and 'Include') must be first. See issue - # 10520. - if not CROSS_COMPILING: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # On Debian /usr/local is always used, so we don't include it twice # only change this for cross builds for 3.3, issues on Mageia if CROSS_COMPILING: self.add_cross_compiling_paths()