awips2/pythonPackages/numpy/numpy/random/SConscript
root a02aeb236c Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]
Former-commit-id: 9f19e3f712
2012-01-06 08:55:05 -06:00

50 lines
1.2 KiB
Python
Executable file

# Last Change: Wed Nov 19 09:00 PM 2008 J
# vim:syntax=python
import os
from numscons import GetNumpyEnvironment, scons_get_mathlib
from setup import needs_mingw_ftime_workaround
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)
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')
config.Finish()
if needs_mingw_ftime_workaround():
env.Append(CPPDEFINES=['NPY_NEEDS_MINGW_TIME_WORKAROUND'])
sources = [os.path.join('mtrand', x) for x in
['mtrand.c', 'randomkit.c', 'initarray.c', 'distributions.c']]
# XXX: Pyrex dependency
env.NumpyPythonExtension('mtrand', source = sources)