Merged revisions 72593 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72593 | benjamin.peterson | 2009-05-12 16:06:05 -0500 (Tue, 12 May 2009) | 1 line the compiler attribute is used in setup.py; can't rename ........
This commit is contained in:
parent
8dc07c0eb4
commit
44c3c0e2b9
|
@ -303,38 +303,38 @@ class build_ext (Command):
|
||||||
|
|
||||||
# Setup the CCompiler object that we'll use to do all the
|
# Setup the CCompiler object that we'll use to do all the
|
||||||
# compiling and linking
|
# compiling and linking
|
||||||
self._compiler = new_compiler(compiler=self.compiler,
|
self.compiler = new_compiler(compiler=None,
|
||||||
verbose=self.verbose,
|
verbose=self.verbose,
|
||||||
dry_run=self.dry_run,
|
dry_run=self.dry_run,
|
||||||
force=self.force)
|
force=self.force)
|
||||||
customize_compiler(self._compiler)
|
customize_compiler(self.compiler)
|
||||||
# If we are cross-compiling, init the compiler now (if we are not
|
# If we are cross-compiling, init the compiler now (if we are not
|
||||||
# cross-compiling, init would not hurt, but people may rely on
|
# cross-compiling, init would not hurt, but people may rely on
|
||||||
# late initialization of compiler even if they shouldn't...)
|
# late initialization of compiler even if they shouldn't...)
|
||||||
if os.name == 'nt' and self.plat_name != get_platform():
|
if os.name == 'nt' and self.plat_name != get_platform():
|
||||||
self._compiler.initialize(self.plat_name)
|
self.compiler.initialize(self.plat_name)
|
||||||
|
|
||||||
# And make sure that any compile/link-related options (which might
|
# And make sure that any compile/link-related options (which might
|
||||||
# come from the command-line or from the setup script) are set in
|
# come from the command-line or from the setup script) are set in
|
||||||
# that CCompiler object -- that way, they automatically apply to
|
# that CCompiler object -- that way, they automatically apply to
|
||||||
# all compiling and linking done here.
|
# all compiling and linking done here.
|
||||||
if self.include_dirs is not None:
|
if self.include_dirs is not None:
|
||||||
self._compiler.set_include_dirs(self.include_dirs)
|
self.compiler.set_include_dirs(self.include_dirs)
|
||||||
if self.define is not None:
|
if self.define is not None:
|
||||||
# 'define' option is a list of (name,value) tuples
|
# 'define' option is a list of (name,value) tuples
|
||||||
for (name, value) in self.define:
|
for (name, value) in self.define:
|
||||||
self._compiler.define_macro(name, value)
|
self.compiler.define_macro(name, value)
|
||||||
if self.undef is not None:
|
if self.undef is not None:
|
||||||
for macro in self.undef:
|
for macro in self.undef:
|
||||||
self._compiler.undefine_macro(macro)
|
self.compiler.undefine_macro(macro)
|
||||||
if self.libraries is not None:
|
if self.libraries is not None:
|
||||||
self._compiler.set_libraries(self.libraries)
|
self.compiler.set_libraries(self.libraries)
|
||||||
if self.library_dirs is not None:
|
if self.library_dirs is not None:
|
||||||
self._compiler.set_library_dirs(self.library_dirs)
|
self.compiler.set_library_dirs(self.library_dirs)
|
||||||
if self.rpath is not None:
|
if self.rpath is not None:
|
||||||
self._compiler.set_runtime_library_dirs(self.rpath)
|
self.compiler.set_runtime_library_dirs(self.rpath)
|
||||||
if self.link_objects is not None:
|
if self.link_objects is not None:
|
||||||
self._compiler.set_link_objects(self.link_objects)
|
self.compiler.set_link_objects(self.link_objects)
|
||||||
|
|
||||||
# Now actually compile and link everything.
|
# Now actually compile and link everything.
|
||||||
self.build_extensions()
|
self.build_extensions()
|
||||||
|
@ -490,7 +490,7 @@ class build_ext (Command):
|
||||||
for undef in ext.undef_macros:
|
for undef in ext.undef_macros:
|
||||||
macros.append((undef,))
|
macros.append((undef,))
|
||||||
|
|
||||||
objects = self._compiler.compile(sources,
|
objects = self.compiler.compile(sources,
|
||||||
output_dir=self.build_temp,
|
output_dir=self.build_temp,
|
||||||
macros=macros,
|
macros=macros,
|
||||||
include_dirs=ext.include_dirs,
|
include_dirs=ext.include_dirs,
|
||||||
|
@ -517,9 +517,9 @@ class build_ext (Command):
|
||||||
extra_args = ext.extra_link_args or []
|
extra_args = ext.extra_link_args or []
|
||||||
|
|
||||||
# Detect target language, if not provided
|
# Detect target language, if not provided
|
||||||
language = ext.language or self._compiler.detect_language(sources)
|
language = ext.language or self.compiler.detect_language(sources)
|
||||||
|
|
||||||
self._compiler.link_shared_object(
|
self.compiler.link_shared_object(
|
||||||
objects, ext_path,
|
objects, ext_path,
|
||||||
libraries=self.get_libraries(ext),
|
libraries=self.get_libraries(ext),
|
||||||
library_dirs=ext.library_dirs,
|
library_dirs=ext.library_dirs,
|
||||||
|
@ -690,7 +690,7 @@ class build_ext (Command):
|
||||||
# Append '_d' to the python import library on debug builds.
|
# Append '_d' to the python import library on debug builds.
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
from distutils.msvccompiler import MSVCCompiler
|
from distutils.msvccompiler import MSVCCompiler
|
||||||
if not isinstance(self._compiler, MSVCCompiler):
|
if not isinstance(self.compiler, MSVCCompiler):
|
||||||
template = "python%d%d"
|
template = "python%d%d"
|
||||||
if self.debug:
|
if self.debug:
|
||||||
template = template + '_d'
|
template = template + '_d'
|
||||||
|
|
Loading…
Reference in New Issue