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

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Nov 17 07:09:25 EST 2008


Author: cdavid
Date: 2008-11-17 06:09:08 -0600 (Mon, 17 Nov 2008)
New Revision: 6066

Modified:
   branches/visualstudio_manifest/numpy/distutils/command/config.py
   branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py
Log:
Refactor manifest generation and put it back into mingw32ccompiler module.

Modified: branches/visualstudio_manifest/numpy/distutils/command/config.py
===================================================================
--- branches/visualstudio_manifest/numpy/distutils/command/config.py	2008-11-17 12:08:38 UTC (rev 6065)
+++ branches/visualstudio_manifest/numpy/distutils/command/config.py	2008-11-17 12:09:08 UTC (rev 6066)
@@ -10,10 +10,8 @@
 from distutils.command.config import LANG_EXT
 from distutils import log
 from distutils.file_util import copy_file
-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, manifest_name, rc_name, manifest_rc
+from numpy.distutils.mingw32ccompiler import generate_manifest
 
 LANG_EXT['f77'] = '.f'
 LANG_EXT['f90'] = '.f90'
@@ -114,24 +112,7 @@
                 log.warn('could not find library %r in directories %s' \
                          % (libname, library_dirs))
         elif self.compiler.compiler_type == 'mingw32':
-            msver = get_build_msvc_version()
-            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(manxml)
-                    man.write(manxml)
-                    man.close()
-                    # # Write the rc file
-                    # manrc = manifest_rc(manifest_name(self), "exe")
-                    # rc = open(rc_name(self), "w")
-                    # self.temp_files.append(manrc)
-                    # rc.write(manrc)
-                    # rc.close()
+            generate_manifest(self)
         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:08:38 UTC (rev 6065)
+++ branches/visualstudio_manifest/numpy/distutils/mingw32ccompiler.py	2008-11-17 12:09:08 UTC (rev 6066)
@@ -27,6 +27,7 @@
 from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
 
 from distutils.unixccompiler import UnixCCompiler
+from distutils.msvccompiler import get_build_version as get_build_msvc_version
 from numpy.distutils.misc_util import msvc_runtime_library
 
 # the same as cygwin plus some additional parameters
@@ -321,3 +322,23 @@
     # Get configest name (including suffix)  
     root = configtest_name(config)
     return root + ".rc"
+
+def generate_manifest(config):
+    msver = get_build_msvc_version()
+    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(config), "w")
+            config.temp_files.append(manifest_name(config))
+            man.write(manxml)
+            man.close()
+            # # Write the rc file
+            # manrc = manifest_rc(manifest_name(self), "exe")
+            # rc = open(rc_name(self), "w")
+            # self.temp_files.append(manrc)
+            # rc.write(manrc)
+            # rc.close()




More information about the Numpy-svn mailing list