Lines 89-94
def find_module_file(module, dirlist):
Link Here
|
89 |
log.info("WARNING: multiple copies of %s found"%module) |
89 |
log.info("WARNING: multiple copies of %s found"%module) |
90 |
return os.path.join(list[0], module) |
90 |
return os.path.join(list[0], module) |
91 |
|
91 |
|
|
|
92 |
def standard_include_dirs(): |
93 |
'Return the list of standard C include directories.' |
94 |
dirs = [] |
95 |
in_region = False |
96 |
cpp = os.environ.get('CPP') |
97 |
if not cpp: cpp = 'cpp' |
98 |
(stdin, stdout, stderr) = os.popen3('cpp -v', 'r') |
99 |
stdin.close() |
100 |
stdout.close() |
101 |
while True: |
102 |
line = stderr.readline() |
103 |
if not line: break |
104 |
if line == '#include <...> search starts here:\n': |
105 |
in_region = True |
106 |
continue |
107 |
if line == 'End of search list.\n': break |
108 |
if in_region: |
109 |
dirs.append(line.strip()) |
110 |
stderr.close() |
111 |
return dirs |
112 |
|
92 |
class PyBuildExt(build_ext): |
113 |
class PyBuildExt(build_ext): |
93 |
|
114 |
|
94 |
def build_extensions(self): |
115 |
def build_extensions(self): |
Lines 246-251
class PyBuildExt(build_ext):
Link Here
|
246 |
# Ensure that /usr/local is always used |
267 |
# Ensure that /usr/local is always used |
247 |
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
268 |
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
248 |
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
269 |
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
|
|
270 |
for dir in standard_include_dirs(): |
271 |
add_dir_to_list(self.compiler.include_dirs, dir) |
249 |
|
272 |
|
250 |
# Add paths specified in the environment variables LDFLAGS and |
273 |
# Add paths specified in the environment variables LDFLAGS and |
251 |
# CPPFLAGS for header and library files. |
274 |
# CPPFLAGS for header and library files. |
Lines 298-304
class PyBuildExt(build_ext):
Link Here
|
298 |
'/lib64', '/usr/lib64', |
321 |
'/lib64', '/usr/lib64', |
299 |
'/lib', '/usr/lib', |
322 |
'/lib', '/usr/lib', |
300 |
] |
323 |
] |
301 |
inc_dirs = self.compiler.include_dirs + ['/usr/include'] |
324 |
inc_dirs = self.compiler.include_dirs + [] |
302 |
exts = [] |
325 |
exts = [] |
303 |
|
326 |
|
304 |
config_h = sysconfig.get_config_h_filename() |
327 |
config_h = sysconfig.get_config_h_filename() |