diff options
author | David Cournapeau <cournape@gmail.com> | 2008-11-17 12:04:27 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-11-17 12:04:27 +0000 |
commit | 4ebd39d35a1ff5b045e02453548c621c016e6704 (patch) | |
tree | 0f416511ceaefb4964a9bcc378b2956e22344ebc | |
parent | 1d3d4cd14e397269c08b8dc794e0835ca551efa9 (diff) | |
download | numpy-4ebd39d35a1ff5b045e02453548c621c016e6704.tar.gz |
Refactor msvc runtime checking, put it into mingw32compiler
-rw-r--r-- | numpy/distutils/command/config.py | 15 | ||||
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 23985b916..a7952966e 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -12,8 +12,8 @@ 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.misc_util import msvc_runtime_library -from numpy.distutils.mingw32compiler import msvc_manifest_xml +from numpy.distutils.mingw32compiler import msvc_manifest_xml, + check_embedded_match_linked LANG_EXT['f77'] = '.f' LANG_EXT['f90'] = '.f90' @@ -117,16 +117,7 @@ class config(old_config): msver = get_build_msvc_version() if msver is not None: if msver >= 8: - # check msvcr major version are the same for linking and - # embedding - msvcv = msvc_runtime_library() - if msvcv: - maj = msvcv[5:6] - if not maj == int(msver): - raise ValueError, - "Dyscrepancy between linked msvcr " \ - "(%f) and the one about to be embedded " \ - "(%f)" % (int(msver), maj) + check_embedded_msvcr_match_linked(msver) return self._wrap_method(old_config._link,lang, (body, headers, include_dirs, diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py index 3027fba9a..a62be27a4 100644 --- a/numpy/distutils/mingw32ccompiler.py +++ b/numpy/distutils/mingw32ccompiler.py @@ -294,3 +294,16 @@ def manifest_rc(name, type='dll'): return """\ #include "winuser.h" %d RT_MANIFEST %s""" % (rctype, name) + +def check_embedded_msvcr_match_linked(msver): + """msver is the ms runtime version used for the MANIFEST.""" + # check msvcr major version are the same for linking and + # embedding + msvcv = msvc_runtime_library() + if msvcv: + maj = msvcv[5:6] + if not maj == int(msver): + raise ValueError, + "Dyscrepancy between linked msvcr " \ + "(%f) and the one about to be embedded " \ + "(%f)" % (int(msver), maj) |