diff options
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 9e05aded0..571d067e0 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -145,7 +145,8 @@ def check_math_capabilities(config, ext, moredefs, mathlibs): headers=headers, ) - def check_funcs_once(funcs_name, headers=["feature_detection_math.h"]): + def check_funcs_once(funcs_name, headers=["feature_detection_math.h"], + add_to_moredefs=True): call = dict([(f, True) for f in funcs_name]) call_args = dict([(f, FUNC_CALL_ARGS[f]) for f in funcs_name]) st = config.check_funcs_once( @@ -156,7 +157,7 @@ def check_math_capabilities(config, ext, moredefs, mathlibs): call_args=call_args, headers=headers, ) - if st: + if st and add_to_moredefs: moredefs.extend([(fname2def(f), 1) for f in funcs_name]) return st @@ -173,7 +174,7 @@ def check_math_capabilities(config, ext, moredefs, mathlibs): return 1 #use_msvc = config.check_decl("_MSC_VER") - if not check_funcs_once(MANDATORY_FUNCS): + if not check_funcs_once(MANDATORY_FUNCS, add_to_moredefs=False): raise SystemError("One of the required function to build numpy is not" " available (the list is %s)." % str(MANDATORY_FUNCS)) @@ -184,20 +185,12 @@ def check_math_capabilities(config, ext, moredefs, mathlibs): # config.h in the public namespace, so we have a clash for the common # functions we test. We remove every function tested by python's # autoconf, hoping their own test are correct - for f in OPTIONAL_STDFUNCS_MAYBE: - if config.check_decl(fname2def(f), - headers=["Python.h", "math.h"]): - if f in OPTIONAL_STDFUNCS: - OPTIONAL_STDFUNCS.remove(f) - else: - OPTIONAL_FILE_FUNCS.remove(f) + for f in OPTIONAL_FUNCS_MAYBE: + if config.check_decl(fname2def(f), headers=["Python.h"]): + OPTIONAL_FILE_FUNCS.remove(f) - - check_funcs(OPTIONAL_STDFUNCS) check_funcs(OPTIONAL_FILE_FUNCS, headers=["feature_detection_stdio.h"]) check_funcs(OPTIONAL_MISC_FUNCS, headers=["feature_detection_misc.h"]) - - for h in OPTIONAL_HEADERS: if config.check_func("", decl=False, call=False, headers=[h]): |