Kaydet (Commit) 506f0b1f authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Part of patch #102409: special cases for Cygwin:

    Lib/distutils/command/build_ext.py(build_ext.finalize_options): Add
    Cygwin specific code to append Python's library directory to the
    extension's list of library directories.

    (build_ext.get_libraries): Add Cygwin specific code to append Python's
    (import) library to the extension's list of libraries.
üst f47075e8
...@@ -163,6 +163,17 @@ class build_ext (Command): ...@@ -163,6 +163,17 @@ class build_ext (Command):
self.build_temp = os.path.join(self.build_temp, "Debug") self.build_temp = os.path.join(self.build_temp, "Debug")
else: else:
self.build_temp = os.path.join(self.build_temp, "Release") self.build_temp = os.path.join(self.build_temp, "Release")
# for extensions under Cygwin Python's library directory must be
# appended to library_dirs
if sys.platform[:6] == 'cygwin':
if string.find(sys.executable, sys.exec_prefix) != -1:
# building third party extensions
self.library_dirs.append(os.path.join(sys.prefix, "lib", "python" + sys.version[:3], "config"))
else:
# building python standard extensions
self.library_dirs.append('.')
# finalize_options () # finalize_options ()
...@@ -576,6 +587,13 @@ class build_ext (Command): ...@@ -576,6 +587,13 @@ class build_ext (Command):
# don't extend ext.libraries, it may be shared with other # don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list # extensions, it is a reference to the original list
return ext.libraries + [pythonlib] return ext.libraries + [pythonlib]
elif sys.platform[:6] == "cygwin":
template = "python%d.%d"
pythonlib = (template %
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list
return ext.libraries + [pythonlib]
else: else:
return ext.libraries return ext.libraries
......
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