blob: 714015049ec31e1d366ae86085b039ad8a283131 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import os
import sys
from bento.commands import hooks
import waflib
@hooks.post_configure
def configure(context):
conf = context.waf_context
conf.env.USE_WINCRYPT = False
if conf.check_declaration("_WIN32", mandatory=False):
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 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"]
kw = {}
if bld.env.USE_WINCRYPT:
kw["lib"] = "ADVAPI32"
return context.default_builder(extension, includes=includes, **kw)
context.register_builder("mtrand", builder)
|