Tools: check for feenableexcept on WAF

This commit is contained in:
Pierre Kancir 2019-07-23 13:00:43 +02:00 committed by Andrew Tridgell
parent 17c0cf8d5c
commit bb13a75e30
2 changed files with 17 additions and 0 deletions

View File

@ -362,6 +362,7 @@ class sitl(Board):
] ]
cfg.check_librt(env) cfg.check_librt(env)
cfg.check_feenableexcept()
env.LINKFLAGS += ['-pthread',] env.LINKFLAGS += ['-pthread',]
env.AP_LIBRARIES += [ env.AP_LIBRARIES += [

View File

@ -169,6 +169,22 @@ def check_librt(cfg, env):
return ret return ret
@conf
def check_feenableexcept(cfg):
cfg.check(
compiler='cxx',
fragment='''
#include <fenv.h>
int main() {
return feenableexcept(FE_OVERFLOW | FE_DIVBYZERO);
}''',
msg="Checking for feenableexcept",
define_name="HAVE_FEENABLEEXCEPT",
mandatory=False,
)
@conf @conf
def check_package(cfg, env, libname): def check_package(cfg, env, libname):
'''use pkg-config to look for an installed library that has a LIBNAME.pc file''' '''use pkg-config to look for an installed library that has a LIBNAME.pc file'''