diff options
author | David Cournapeau <cournape@gmail.com> | 2008-11-17 12:03:57 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-11-17 12:03:57 +0000 |
commit | 1d3d4cd14e397269c08b8dc794e0835ca551efa9 (patch) | |
tree | 826d7943df7b3d1d653da6b43a3397625aeed95e /numpy/distutils/command/config.py | |
parent | 6cf5c1f26d241dc0008b875b0c5fbea9a453bd39 (diff) | |
download | numpy-1d3d4cd14e397269c08b8dc794e0835ca551efa9.tar.gz |
Detect whether config link needs embedding the manifest for the MSVC runtime.
Diffstat (limited to 'numpy/distutils/command/config.py')
-rw-r--r-- | numpy/distutils/command/config.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 0036c5543..23985b916 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -10,7 +10,10 @@ 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.misc_util import msvc_runtime_library +from numpy.distutils.mingw32compiler import msvc_manifest_xml LANG_EXT['f77'] = '.f' LANG_EXT['f90'] = '.f90' @@ -110,6 +113,21 @@ class config(old_config): if fileexists: continue 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 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) + return self._wrap_method(old_config._link,lang, (body, headers, include_dirs, libraries, library_dirs, lang)) |