diff options
author | Greg Ward <gward@python.net> | 1999-10-03 20:47:52 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 1999-10-03 20:47:52 (GMT) |
commit | c74138d941114e31882988bb846b04103e2d7b0b (patch) | |
tree | 09a5a0fd57f7904a4444a34d567c5a559a9aa032 /Lib/distutils | |
parent | 4fecfce4d09eca422af8ad60363bc83005b7c032 (diff) | |
download | cpython-c74138d941114e31882988bb846b04103e2d7b0b.zip cpython-c74138d941114e31882988bb846b04103e2d7b0b.tar.gz cpython-c74138d941114e31882988bb846b04103e2d7b0b.tar.bz2 |
Catch up with changes in 'gen_lib_options()':
- change how we call it
- added methods 'library_dir_option()', 'library_option()', and
'find_library_file()' that it calls
Added 'force' flag; it's automatically "respected", because this class
always rebuilds everything! (Which it to say, "force=0" is not respected.)
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/msvccompiler.py | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index 64b2730..5ac60b2 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -23,9 +23,10 @@ class MSVCCompiler (CCompiler) : def __init__ (self, verbose=0, - dry_run=0): + dry_run=0, + force=0): - CCompiler.__init__ (self, verbose, dry_run) + CCompiler.__init__ (self, verbose, dry_run, force) # XXX This is a nasty dependency to add on something otherwise # pretty clean. move it to build_ext under an nt specific part. @@ -164,9 +165,9 @@ class MSVCCompiler (CCompiler) : if library_dirs is None: library_dirs = [] - lib_opts = gen_lib_options (self.library_dirs + library_dirs, - self.libraries + libraries, - "/LIBPATH:%s", "%s.lib") + lib_opts = gen_lib_options (self, + self.library_dirs + library_dirs, + self.libraries + libraries) ld_args = self.ldflags_shared + lib_opts + \ objects + ['/OUT:' + output_filename] @@ -200,6 +201,9 @@ class MSVCCompiler (CCompiler) : specified source filename.""" return self._change_extensions( source_filenames, self._shared_lib_ext ) + # XXX ummm... these aren't right, are they? I thought library 'foo' on + # DOS/Windows was to be found in "foo.lib", not "libfoo.lib"! + def library_filename (self, libname): """Return the static library filename corresponding to the specified library name.""" @@ -210,4 +214,25 @@ class MSVCCompiler (CCompiler) : specified library name.""" return "lib%s%s" %( libname, self._shared_lib_ext ) + + def library_dir_option (self, dir): + return "/LIBPATH:" + dir + + def library_option (self, lib): + return self.library_filename (lib) + + + def find_library_file (self, dirs, lib): + + for dir in dirs: + libfile = os.path.join (dir, self.library_filename (lib)) + if os.path.exists (libfile): + return libfile + + else: + # Oops, didn't find it in *any* of 'dirs' + return None + + # find_library_file () + # class MSVCCompiler |