]> granicus.if.org Git - python/commitdiff
Patch #870382: Automatically add msvcr71 to the list of libraries if
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 3 Aug 2004 12:41:42 +0000 (12:41 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 3 Aug 2004 12:41:42 +0000 (12:41 +0000)
Python was built with VC 7.1.

Lib/distutils/cygwinccompiler.py

index a9620076015eb3e9496cc2917c3e475c3cc35f22..acd393d5935e633d1058843f3e32bc29bdf297df 100644 (file)
@@ -122,6 +122,17 @@ class CygwinCCompiler (UnixCCompiler):
                 "Consider upgrading to a newer version of gcc")
         else:
             self.dll_libraries=[]
+           # Include the appropriate MSVC runtime library if Python was built
+           # with MSVC 7.0 or 7.1.
+           msc_pos = sys.version.find('MSC v.')
+           if msc_pos != -1:
+               msc_ver = sys.version[msc_pos+6:msc_pos+10]
+               if msc_ver == '1300':
+                   # MSVC 7.0
+                   self.dll_libraries = ['msvcr70']
+               elif msc_ver == '1310':
+                   # MSVC 7.1
+                   self.dll_libraries = ['msvcr71']
 
     # __init__ ()
 
@@ -308,6 +319,18 @@ class Mingw32CCompiler (CygwinCCompiler):
         # no additional libraries needed
         self.dll_libraries=[]
 
+       # Include the appropriate MSVC runtime library if Python was built
+       # with MSVC 7.0 or 7.1.
+       msc_pos = sys.version.find('MSC v.')
+       if msc_pos != -1:
+           msc_ver = sys.version[msc_pos+6:msc_pos+10]
+           if msc_ver == '1300':
+               # MSVC 7.0
+               self.dll_libraries = ['msvcr70']
+           elif msc_ver == '1310':
+               # MSVC 7.1
+               self.dll_libraries = ['msvcr71']
+
     # __init__ ()
 
 # class Mingw32CCompiler