summaryrefslogtreecommitdiff
path: root/debian/patches/deb-setup.diff
blob: 08ce316dd4ee5350fc67abca5b75d02d92e9e0eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths

Index: b/setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -262,8 +262,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)
 
         build_ext.build_extensions(self)
@@ -487,12 +489,7 @@ class PyBuildExt(build_ext):
             return ['m']
 
     def detect_modules(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_gcc_paths()