mirror of
https://github.com/python/cpython.git
synced 2025-11-08 09:32:01 +00:00
Patch from Perry Stoll: caught up with changes in CCompiler necessary (?)
for MSVCCompiler.
This commit is contained in:
parent
32162e832e
commit
65f4a3b173
1 changed files with 21 additions and 8 deletions
|
|
@ -52,6 +52,11 @@ class UnixCCompiler (CCompiler):
|
||||||
# are specified via {add,set}_include_dirs(), and there's no way to
|
# are specified via {add,set}_include_dirs(), and there's no way to
|
||||||
# distinguish them. This might be a bug.
|
# distinguish them. This might be a bug.
|
||||||
|
|
||||||
|
_obj_ext = '.o'
|
||||||
|
_exe_ext = ''
|
||||||
|
_shared_lib_ext = SO
|
||||||
|
_static_lib_ext = '.a'
|
||||||
|
|
||||||
def __init__ (self,
|
def __init__ (self,
|
||||||
verbose=0,
|
verbose=0,
|
||||||
dry_run=0):
|
dry_run=0):
|
||||||
|
|
@ -121,22 +126,28 @@ def link_shared_lib (self,
|
||||||
objects,
|
objects,
|
||||||
output_libname,
|
output_libname,
|
||||||
libraries=None,
|
libraries=None,
|
||||||
library_dirs=None):
|
library_dirs=None,
|
||||||
|
build_info=None):
|
||||||
# XXX should we sanity check the library name? (eg. no
|
# XXX should we sanity check the library name? (eg. no
|
||||||
# slashes)
|
# slashes)
|
||||||
self.link_shared_object (objects, "lib%s%s" % (output_libname, SO))
|
self.link_shared_object (objects, "lib%s%s" % \
|
||||||
|
(output_libname, self._shared_lib_ext),
|
||||||
|
build_info=build_info)
|
||||||
|
|
||||||
|
|
||||||
def link_shared_object (self,
|
def link_shared_object (self,
|
||||||
objects,
|
objects,
|
||||||
output_filename,
|
output_filename,
|
||||||
libraries=None,
|
libraries=None,
|
||||||
library_dirs=None):
|
library_dirs=None,
|
||||||
|
build_info=None):
|
||||||
|
|
||||||
if libraries is None:
|
if libraries is None:
|
||||||
libraries = []
|
libraries = []
|
||||||
if library_dirs is None:
|
if library_dirs is None:
|
||||||
library_dirs = []
|
library_dirs = []
|
||||||
|
if build_info is None:
|
||||||
|
build_info = {}
|
||||||
|
|
||||||
lib_opts = _gen_lib_options (self.libraries + libraries,
|
lib_opts = _gen_lib_options (self.libraries + libraries,
|
||||||
self.library_dirs + library_dirs)
|
self.library_dirs + library_dirs)
|
||||||
|
|
@ -150,17 +161,19 @@ def link_shared_object (self,
|
||||||
def object_filenames (self, source_filenames):
|
def object_filenames (self, source_filenames):
|
||||||
outnames = []
|
outnames = []
|
||||||
for inname in source_filenames:
|
for inname in source_filenames:
|
||||||
outnames.append (re.sub (r'\.(c|C|cc|cxx)$', '.o', inname))
|
outnames.append ( re.sub (r'\.(c|C|cc|cxx|cpp)$',
|
||||||
|
self._obj_ext, inname))
|
||||||
return outnames
|
return outnames
|
||||||
|
|
||||||
def shared_object_filename (self, source_filename):
|
def shared_object_filename (self, source_filename):
|
||||||
return re.sub (r'\.(c|C|cc|cxx)$', SO)
|
return re.sub (r'\.(c|C|cc|cxx|cpp)$', self._shared_lib_ext)
|
||||||
|
|
||||||
def library_filename (self, libname):
|
def library_filename (self, libname):
|
||||||
return "lib%s.a" % libname
|
return "lib%s%s" % (libname, self._static_lib_ext )
|
||||||
|
|
||||||
def shared_library_filename (self, libname):
|
def shared_library_filename (self, libname):
|
||||||
return "lib%s.so" % libname
|
return "lib%s%s" % (libname, self._shared_lib_ext )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# class UnixCCompiler
|
# class UnixCCompiler
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue