From: Uri Simchoni Date: Mon, 20 Nov 2017 20:53:12 +0000 (+0000) Subject: build: ensure compiler flags are properly detected X-Git-Tag: talloc-2.1.11~397 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=667335a42d683f73ec9c52c68730041d83a163a5;p=thirdparty%2Fsamba.git build: ensure compiler flags are properly detected While checking for compiler flag availability, treat warnings as errors. Thus if the compiler only warns about unsupported flag, it will fail the test and the flag shall be marked as unsupported. Signed-off-by: Uri Simchoni Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Nov 22 14:19:20 CET 2017 on sn-devel-144 --- diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index e157b20de2c..7940a7d4fe8 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -473,10 +473,13 @@ def CHECK_STRUCTURE_MEMBER(conf, structname, member, def CHECK_CFLAGS(conf, cflags, fragment='int main(void) { return 0; }\n'): '''check if the given cflags are accepted by the compiler ''' + check_cflags = TO_LIST(cflags) + if 'WERROR_CFLAGS' in conf.env: + check_cflags.extend(conf.env['WERROR_CFLAGS']) return conf.check(fragment=fragment, execute=0, type='nolink', - ccflags=cflags, + ccflags=check_cflags, msg="Checking compiler accepts %s" % cflags) @conf