diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 8c6b4b057d..42c9b93ce5 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -362,6 +362,7 @@ class sitl(Board): ] cfg.check_librt(env) + cfg.check_feenableexcept() env.LINKFLAGS += ['-pthread',] env.AP_LIBRARIES += [ diff --git a/Tools/ardupilotwaf/cxx_checks.py b/Tools/ardupilotwaf/cxx_checks.py index 62286823a2..03274b8c9e 100644 --- a/Tools/ardupilotwaf/cxx_checks.py +++ b/Tools/ardupilotwaf/cxx_checks.py @@ -169,6 +169,22 @@ def check_librt(cfg, env): return ret +@conf +def check_feenableexcept(cfg): + + cfg.check( + compiler='cxx', + fragment=''' + #include + + int main() { + return feenableexcept(FE_OVERFLOW | FE_DIVBYZERO); + }''', + msg="Checking for feenableexcept", + define_name="HAVE_FEENABLEEXCEPT", + mandatory=False, + ) + @conf def check_package(cfg, env, libname): '''use pkg-config to look for an installed library that has a LIBNAME.pc file'''