diff options
author | David Cournapeau <cournape@gmail.com> | 2008-06-12 10:05:12 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-06-12 10:05:12 +0000 |
commit | 3f04110ecb03a627cc4e69497c63e683e585b591 (patch) | |
tree | 890ea6ee2213a15b10a6cafc5f48867298c7d4e9 /numpy/random/SConscript | |
parent | 8c53a440625db9ddd54a09e2811e16a8f1fbd02d (diff) | |
download | numpy-3f04110ecb03a627cc4e69497c63e683e585b591.tar.gz |
adapt numpy.random to new scons build_dir architecture.
Diffstat (limited to 'numpy/random/SConscript')
-rw-r--r-- | numpy/random/SConscript | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/numpy/random/SConscript b/numpy/random/SConscript new file mode 100644 index 000000000..5beee13d4 --- /dev/null +++ b/numpy/random/SConscript @@ -0,0 +1,46 @@ +# Last Change: Thu Jun 12 06:00 PM 2008 J +# vim:syntax=python +import os + +from numscons import GetNumpyEnvironment, scons_get_paths, \ + scons_get_mathlib + +def CheckWincrypt(context): + from copy import deepcopy + src = """\ +/* check to see if _WIN32 is defined */ +int main(int argc, char *argv[]) +{ +#ifdef _WIN32 + return 0; +#else + return 1; +#endif +} +""" + + context.Message("Checking if using wincrypt ... ") + st = context.env.TryRun(src, '.C') + if st[0] == 0: + context.Result('No') + else: + context.Result('Yes') + return st[0] + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = scons_get_paths(env['include_bootstrap'])) + +mlib = scons_get_mathlib(env) +env.AppendUnique(LIBS = mlib) + +# On windows, see if we should use Advapi32 +if os.name == 'nt': + config = env.NumpyConfigure(custom_tests = {'CheckWincrypt' : CheckWincrypt}) + if config.CheckWincrypt: + config.env.AppendUnique(LIBS = 'Advapi32') + +sources = [os.path.join('mtrand', x) for x in + ['mtrand.c', 'randomkit.c', 'initarray.c', 'distributions.c']] + +# XXX: Pyrex dependency +mtrand = env.DistutilsPythonExtension('mtrand', source = sources) |