Commit ffffe1ca authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Patch #641685] setup.py contained code for finding libraries, instead

   of using the CCompiler.find_library_file() provided by the Distutils.
   This patch fixes it to use the Distutils method at the cost of some
   additional glue.

(The duplication resulted in the SSL module not being automatically
built on Macs; the Distutils knew that shared libraries on OS X have a
.dylib extension, but the setup.py code didn't.)
parent 5658df75
...@@ -48,14 +48,30 @@ def find_file(filename, std_dirs, paths): ...@@ -48,14 +48,30 @@ def find_file(filename, std_dirs, paths):
return None return None
def find_library_file(compiler, libname, std_dirs, paths): def find_library_file(compiler, libname, std_dirs, paths):
filename = compiler.library_filename(libname, lib_type='shared') result = compiler.find_library_file(std_dirs + paths, libname)
result = find_file(filename, std_dirs, paths) if result is None:
if result is not None: return result return None
filename = compiler.library_filename(libname, lib_type='static') # Check whether the found file is in one of the standard directories
result = find_file(filename, std_dirs, paths) dirname = os.path.dirname(result)
return result for p in std_dirs:
# Ensure path doesn't end with path separator
if p.endswith(os.sep):
p = p.strip(os.sep)
if p == dirname:
return [ ]
# Otherwise, it must have been in one of the additional directories,
# so we have to figure out which one.
for p in paths:
# Ensure path doesn't end with path separator
if p.endswith(os.sep):
p = p.strip(os.sep)
if p == dirname:
return [p]
else:
assert False, "Internal error: Path not found in std_dirs or paths"
def module_enabled(extlist, modname): def module_enabled(extlist, modname):
"""Returns whether the module 'modname' is present in the list """Returns whether the module 'modname' is present in the list
of extensions 'extlist'.""" of extensions 'extlist'."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment