summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-09-29 14:36:41 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-09-29 14:50:00 +1000
commit931ed2509d93110b525f763ffb15ee3feff87fa0 (patch)
tree3624a67e4fe2d073e23823c5df2d4ca887cf3817 /lib/replace/wscript
parent837f47d630618fb382cfd49f5fb14e9af35e82fa (diff)
downloadsamba-931ed2509d93110b525f763ffb15ee3feff87fa0.tar.gz
samba-931ed2509d93110b525f763ffb15ee3feff87fa0.tar.bz2
samba-931ed2509d93110b525f763ffb15ee3feff87fa0.zip
lib/replace: Add test for what flag we need for -Werror behaviour
Diffstat (limited to 'lib/replace/wscript')
-rw-r--r--lib/replace/wscript9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index f1f1cefe65..732c664b6e 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -53,6 +53,15 @@ struct foo bar = { .y = 'X', .x = 1 };
conf.ADD_CFLAGS(f)
break
+ # Try to find the right extra flags for -Werror behaviour
+ for f in ["-Werror", "-w2", "-errwarn"]:
+ if conf.CHECK_CFLAGS([f], '''
+'''):
+ if not 'WERROR_CFLAGS' in conf.env:
+ conf.env['WERROR_CFLAGS'] = []
+ conf.env['WERROR_CFLAGS'].extend([f])
+ break
+
conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')