headers=None, msg=None, cflags='', includes='# .',
local_include=True, lib=None, link=True,
define_ret=False, quote=False,
- on_target=True):
+ on_target=True, strict=False):
'''check if some code compiles and/or runs'''
if CONFIG_SET(conf, define):
cflags = TO_LIST(cflags)
+ # Be strict when relying on a compiler check
+ # Some compilers (e.g. xlc) ignore non-supported features as warnings
+ if strict:
+ extra_cflags = None
+ if conf.env["CC_NAME"] == "gcc":
+ extra_cflags = "-Werror"
+ elif conf.env["CC_NAME"] == "xlc":
+ extra_cflags = "-qhalt=w"
+ cflags.append(extra_cflags)
+
if local_include:
cflags.append('-I%s' % conf.curdir)