summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-11-17 12:09:08 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-11-17 12:09:08 +0000
commitfd802862ca053f0d6ce57816214e54c966911b0a (patch)
treea7e3509444d1b4b0d32663f97aa228d06d260176 /numpy/distutils
parent3d745a673576835739c3ff0e402791c77b998e3a (diff)
downloadnumpy-fd802862ca053f0d6ce57816214e54c966911b0a.tar.gz
Refactor manifest generation and put it back into mingw32ccompiler module.
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/command/config.py23
-rw-r--r--numpy/distutils/mingw32ccompiler.py21
2 files changed, 23 insertions, 21 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index b6b90e6b8..d24d60598 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -10,10 +10,8 @@ from distutils.command.config import config as old_config
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 @@ class config(old_config):
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))
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index 17711360b..a557507a4 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -27,6 +27,7 @@ from numpy.distutils.ccompiler import gen_preprocess_options, gen_lib_options
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 @@ def rc_name(config):
# 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()