[Python-checkins] CVS: distutils/distutils msvccompiler.py,1.35,1.36

Greg Ward python-dev@python.org
Tue, 1 Aug 2000 17:00:33 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25004

Modified Files:
	msvccompiler.py 
Log Message:
Patch from Rene Liebscher: generate an /IMPLIB: option to ensure that 
the linker leaves the (temporary) .lib file in the temporary dir.  (Moved
from 'msvc_prelink_hack()' method in build_ext.py.)

Index: msvccompiler.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/msvccompiler.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** msvccompiler.py	2000/06/30 19:37:59	1.35
--- msvccompiler.py	2000/08/02 00:00:30	1.36
***************
*** 381,388 ****
                         objects + ['/OUT:' + output_filename])
  
              if extra_preargs:
                  ld_args[:0] = extra_preargs
              if extra_postargs:
!                 ld_args.extend (extra_postargs)
  
              print "link_shared_object():"
--- 381,400 ----
                         objects + ['/OUT:' + output_filename])
  
+             # The MSVC linker generates .lib and .exp files, which cannot be
+             # suppressed by any linker switches. The .lib files may even be
+             # needed! Make sure they are generated in the temporary build
+             # directory. Since they have different names for debug and release
+             # builds, they can go into the same directory.
+             (dll_name, dll_ext) = os.path.splitext(
+                 os.path.basename(output_filename))
+             implib_file = os.path.join(
+                 os.path.dirname(objects[0]),
+                 self.library_filename(dll_name))
+             ld_args.append ('/IMPLIB:' + implib_file)
+ 
              if extra_preargs:
                  ld_args[:0] = extra_preargs
              if extra_postargs:
!                 ld_args.extend(extra_postargs)
  
              print "link_shared_object():"