mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Removed the implib_dir instance variable because it is unused.
Removed get_ext_libname() because it is unused. Fixed get_libraries() to append an '_d' to the python debug import library. If MSVC is used, do not add 'pythonxx.lib' to the list of libraries, because this is handled better by a pragma in config.h. This should fix bug #115595, but it needs some more testing.
This commit is contained in:
parent
20af3172ce
commit
18b9b93df3
1 changed files with 9 additions and 13 deletions
|
|
@ -158,7 +158,6 @@ class build_ext (Command):
|
||||||
# also Python's library directory must be appended to library_dirs
|
# also Python's library directory must be appended to library_dirs
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
self.library_dirs.append (os.path.join(sys.exec_prefix, 'libs'))
|
self.library_dirs.append (os.path.join(sys.exec_prefix, 'libs'))
|
||||||
self.implib_dir = self.build_temp
|
|
||||||
if self.debug:
|
if self.debug:
|
||||||
self.build_temp = os.path.join (self.build_temp, "Debug")
|
self.build_temp = os.path.join (self.build_temp, "Debug")
|
||||||
else:
|
else:
|
||||||
|
|
@ -543,15 +542,6 @@ class build_ext (Command):
|
||||||
return apply (os.path.join, ext_path) + '_d' + so_ext
|
return apply (os.path.join, ext_path) + '_d' + so_ext
|
||||||
return apply (os.path.join, ext_path) + so_ext
|
return apply (os.path.join, ext_path) + so_ext
|
||||||
|
|
||||||
def get_ext_libname (self, ext_name):
|
|
||||||
# create a filename for the (unneeded) lib-file.
|
|
||||||
# extensions in debug_mode are named 'module_d.pyd' under windows
|
|
||||||
ext_path = string.split (ext_name, '.')
|
|
||||||
if os.name == 'nt' and self.debug:
|
|
||||||
return apply (os.path.join, ext_path) + '_d.lib'
|
|
||||||
return apply (os.path.join, ext_path) + '.lib'
|
|
||||||
|
|
||||||
|
|
||||||
def get_export_symbols (self, ext):
|
def get_export_symbols (self, ext):
|
||||||
"""Return the list of symbols that a shared extension has to
|
"""Return the list of symbols that a shared extension has to
|
||||||
export. This either uses 'ext.export_symbols' or, if it's not
|
export. This either uses 'ext.export_symbols' or, if it's not
|
||||||
|
|
@ -573,9 +563,15 @@ class build_ext (Command):
|
||||||
# is redundant, since the library is mentioned in a pragma in
|
# is redundant, since the library is mentioned in a pragma in
|
||||||
# config.h that MSVC groks. The other Windows compilers all seem
|
# config.h that MSVC groks. The other Windows compilers all seem
|
||||||
# to need it mentioned explicitly, though, so that's what we do.
|
# to need it mentioned explicitly, though, so that's what we do.
|
||||||
if sys.platform == "win32":
|
# Append '_d' to the python import library on debug builds.
|
||||||
pythonlib = ("python%d%d" %
|
from distutils.msvccompiler import MSVCCompiler
|
||||||
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
|
if sys.platform == "win32" and \
|
||||||
|
not isinstance(self.compiler, MSVCCompiler):
|
||||||
|
template = "python%d%d"
|
||||||
|
if self.debug:
|
||||||
|
template = template + '_d'
|
||||||
|
pythonlib = (template %
|
||||||
|
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
|
||||||
# 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]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue