Commit 39a6cfad authored by Greg Ward's avatar Greg Ward

Patch from Perry Stoll:

  - fix some broken abstract methods
  - kludge: add 'build_info' parameter to link methods
  - add 'object_name()' and 'shared_library_name()'
  - support for MSVCCompiler class on NT/Win95
parent 6ad6cbda
...@@ -294,7 +294,8 @@ class CCompiler: ...@@ -294,7 +294,8 @@ class CCompiler:
objects, objects,
output_libname, output_libname,
libraries=None, libraries=None,
library_dirs=None): library_dirs=None,
build_info=None):
"""Link a bunch of stuff together to create a shared library """Link a bunch of stuff together to create a shared library
file. Has the same effect as 'link_static_lib()' except file. Has the same effect as 'link_static_lib()' except
that the filename inferred from 'output_libname' will most that the filename inferred from 'output_libname' will most
...@@ -306,7 +307,8 @@ class CCompiler: ...@@ -306,7 +307,8 @@ class CCompiler:
objects, objects,
output_filename, output_filename,
libraries=None, libraries=None,
library_dirs=None): library_dirs=None,
build_info=None):
"""Link a bunch of stuff together to create a shared object """Link a bunch of stuff together to create a shared object
file. Much like 'link_shared_lib()', except the output file. Much like 'link_shared_lib()', except the output
filename is explicitly supplied as 'output_filename'.""" filename is explicitly supplied as 'output_filename'."""
...@@ -315,27 +317,35 @@ class CCompiler: ...@@ -315,27 +317,35 @@ class CCompiler:
# -- Filename mangling methods ------------------------------------- # -- Filename mangling methods -------------------------------------
def object_filenames (source_filenames): def object_filenames (self, source_filenames):
"""Return the list of object filenames corresponding to each """Return the list of object filenames corresponding to each
specified source filename.""" specified source filename."""
pass pass
def shared_object_filename (source_filename): def shared_object_filename (self, source_filename):
"""Return the shared object filename corresponding to a """Return the shared object filename corresponding to a
specified source filename.""" specified source filename."""
pass pass
def library_filename (libname): def library_filename (self, libname):
"""Return the static library filename corresponding to the """Return the static library filename corresponding to the
specified library name.""" specified library name."""
pass pass
def shared_library_filename (libname): def shared_library_filename (self, libname):
"""Return the shared library filename corresponding to the """Return the shared library filename corresponding to the
specified library name.""" specified library name."""
pass pass
def object_name (self, inname):
"""Given a name with no extension, return the name + object extension"""
return inname + self._obj_ext
def shared_library_name (self, inname):
"""Given a name with no extension, return the name + shared object extension"""
return inname + self._shared_lib_ext
# -- Utility methods ----------------------------------------------- # -- Utility methods -----------------------------------------------
...@@ -357,6 +367,9 @@ def new_compiler (plat=None, ...@@ -357,6 +367,9 @@ def new_compiler (plat=None,
if plat == 'posix': if plat == 'posix':
from unixccompiler import UnixCCompiler from unixccompiler import UnixCCompiler
return UnixCCompiler (verbose, dry_run) return UnixCCompiler (verbose, dry_run)
elif plat in ['nt', 'win95' ]:
from msvccompiler import MSVCCompiler
return MSVCCompiler ( verbose, dry_run )
else: else:
raise DistutilsPlatformError, \ raise DistutilsPlatformError, \
"don't know how to compile C/C++ code on platform %s" % plat "don't know how to compile C/C++ code on platform %s" % plat
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