blob: d7450368069c2e73ac22b70916f2957fe279b0fe [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Don't search /usr and so on for libraries by default to avoid host contamination.
2
3Upstream-Status: Inappropriate (As the code stands, this is a hack)
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
7index bac90fb..a63d796 100644
8--- a/numpy/distutils/system_info.py
9+++ b/numpy/distutils/system_info.py
10@@ -191,41 +191,12 @@ if sys.platform == 'win32':
11 default_x11_lib_dirs = []
12 default_x11_include_dirs = []
13 else:
14- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
15- '/opt/local/lib', '/sw/lib'], platform_bits)
16- default_include_dirs = ['/usr/local/include',
17- '/opt/include', '/usr/include',
18- # path of umfpack under macports
19- '/opt/local/include/ufsparse',
20- '/opt/local/include', '/sw/include',
21- '/usr/include/suitesparse']
22- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
23-
24- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
25- '/usr/lib'], platform_bits)
26- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
27- '/usr/include']
28-
29- if os.path.exists('/usr/lib/X11'):
30- globbed_x11_dir = glob('/usr/lib/*/libX11.so')
31- if globbed_x11_dir:
32- x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
33- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
34- default_x11_include_dirs.extend(['/usr/lib/X11/include',
35- '/usr/include/X11'])
36-
37- import subprocess as sp
38- try:
39- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
40- stderr=open(os.devnull, 'w'))
41- except OSError:
42- pass # gcc is not installed
43- else:
44- triplet = str(p.communicate()[0].decode().strip())
45- if p.returncode == 0:
46- # gcc supports the "-print-multiarch" option
47- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
48- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
49+ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
50+ default_include_dirs = ['/deaddir/include']
51+ default_src_dirs = ['.', '/deaddir/src']
52+
53+ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
54+ default_x11_include_dirs = ['/deaddir/include']
55
56 if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
57 default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))