[Numpy-svn] r6060 - in branches/visualstudio_manifest/numpy/distutils: . command

numpy-svn@scip... numpy-svn@scip...
Mon Nov 17 06:06:12 CST 2008


Author: cdavid
Date: 2008-11-17 06:05:56 -0600 (Mon, 17 Nov 2008)
New Revision: 6060

Modified:
   branches/visualstudio_manifest/numpy/distutils/command/config.py
   branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py
Log:
Generate the xml manifest file.

Modified: branches/visualstudio_manifest/numpy/distutils/command/config.py
===================================================================
--- branches/visualstudio_manifest/numpy/distutils/command/config.py	2008-11-17 12:05:29 UTC (rev 6059)
+++ branches/visualstudio_manifest/numpy/distutils/command/config.py	2008-11-17 12:05:56 UTC (rev 6060)
@@ -13,7 +13,7 @@
 from distutils.msvccompiler import get_build_version as get_build_msvc_version
 from numpy.distutils.exec_command import exec_command
 from numpy.distutils.mingw32ccompiler import msvc_manifest_xml, \
-     check_embedded_msvcr_match_linked
+     check_embedded_msvcr_match_linked, manifest_name
 
 LANG_EXT['f77'] = '.f'
 LANG_EXT['f90'] = '.f90'
@@ -118,7 +118,14 @@
             if msver is not None:
                 if msver >= 8:
                     check_embedded_msvcr_match_linked(msver)
-                    
+                    ma = int(msver)
+                    mi = int((msver - ma) * 10)
+                    # Write the manifest file
+                    manxml = msvc_manifest_xml(ma, mi)
+                    man = open(manifest_name(self), "w")
+                    self.temp_files.append(man)
+                    man.write(manxml)
+                    man.close()
         return self._wrap_method(old_config._link,lang,
                                  (body, headers, include_dirs,
                                   libraries, library_dirs, lang))

Modified: branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py
===================================================================
--- branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py	2008-11-17 12:05:29 UTC (rev 6059)
+++ branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py	2008-11-17 12:05:56 UTC (rev 6060)
@@ -279,8 +279,7 @@
     'exe').
 
     Parameters
-    ----------
-        name: str
+    ---------- name: str
             name of the manifest file to embed
         type: str ('dll', 'exe')
             type of the binary which will embed the manifest"""
@@ -307,3 +306,10 @@
                   "Dyscrepancy between linked msvcr " \
                   "(%d) and the one about to be embedded " \
                   "(%d)" % (int(msver), maj)
+
+def manifest_name(config):
+    # Get configest name (including suffix)  
+    base = os.path.basename(config._gen_temp_sourcefile("yo", [], lang))
+    root, ext = os.path.splitext(base)
+    exext = self.compiler.exe_extension
+    return root + exect + ".manifest"



More information about the Numpy-svn mailing list