diff options
author | David Cournapeau <cournape@gmail.com> | 2011-08-21 18:50:10 +0200 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2011-08-29 00:32:27 +0200 |
commit | 1220e44e092ca835da9567e4f82eb977e4a42c5d (patch) | |
tree | f0666fe6dc2216f6c9ed9265290bd78c96cef37c /numpy | |
parent | ec59e5af21046dfdcdc5639ca2f06fad260f2d41 (diff) | |
download | numpy-1220e44e092ca835da9567e4f82eb977e4a42c5d.tar.gz |
FEAT: fix numpy.random build issues with MSVC.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/random/bscript | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/numpy/random/bscript b/numpy/random/bscript index 0026bb8b3..3e509159f 100644 --- a/numpy/random/bscript +++ b/numpy/random/bscript @@ -1,19 +1,33 @@ import os +import sys -from bento.commands.hooks \ - import \ - pre_build +from bento.commands import hooks +import waflib -@pre_build +@hooks.pre_configure +def configure(context): + conf = context.waf_context + + conf.env.USE_WINCRYPT = False + if conf.check_declaration("_WIN32"): + conf.env.USE_WINCRYPT = True + + conf.env.NEEDS_MINGW32_WORKAROUND = False + if sys.platform == "win32" and conf.check_declaration("__GNUC__", mandatory=False): + conf.env.NEEDS_MINGW32_WORKAROUND = True + +@hooks.pre_build def build(context): bld = context.waf_context - if os.name == 'nt': - raise NotImplementedError("Check for wincrypt stuff") + if bld.env.NEEDS_MINGW32_WORKAROUND: raise NotImplementedError("Check for mingw time workaround stuff") def builder(extension): includes = ["../core/include", "../core/include/numpy", "../core", "../core/src/private"] - return context.default_builder(extension, includes=includes) + kw = {} + if bld.env.USE_WINCRYPT: + kw["lib"] = "ADVAPI32" + return context.default_builder(extension, includes=includes, **kw) context.register_builder("mtrand", builder) |