summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorUri Simchoni <uri@samba.org>2017-11-21 20:53:30 +0200
committerAndrew Bartlett <abartlet@samba.org>2017-11-22 10:20:21 +0100
commit34b4be091fe83ac0eec9e2d697b54bfa5e7823b6 (patch)
treeb1dced199837596d16214b7402ff75074fe654d6 /buildtools
parent90508f46c0a57a632a64300d97c636112d3e8fb7 (diff)
downloadsamba-34b4be091fe83ac0eec9e2d697b54bfa5e7823b6.tar.gz
build: allow specifying prerequisite flags when checking flags
In gcc, "-Wformat-security" is ignored unless "-Wformat" is also specified. This patch allow adding a "prerequisite flag" to a flag we're testing during configuration. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 4c0400a625d..682edf4215f 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -770,14 +770,15 @@ def CONFIG_PATH(conf, name, default):
conf.env[name] = conf.env['PREFIX'] + default
@conf
-def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False):
+def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False, prereq_flags=[]):
'''add some CFLAGS to the command line
optionally set testflags to ensure all the flags work
'''
+ prereq_flags = TO_LIST(prereq_flags)
if testflags:
ok_flags=[]
for f in flags.split():
- if CHECK_CFLAGS(conf, f):
+ if CHECK_CFLAGS(conf, [f] + prereq_flags):
ok_flags.append(f)
flags = ok_flags
if not name in conf.env:
@@ -785,11 +786,12 @@ def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False):
conf.env[name].extend(TO_LIST(flags))
@conf
-def ADD_CFLAGS(conf, flags, testflags=False):
+def ADD_CFLAGS(conf, flags, testflags=False, prereq_flags=[]):
'''add some CFLAGS to the command line
optionally set testflags to ensure all the flags work
'''
- ADD_NAMED_CFLAGS(conf, 'EXTRA_CFLAGS', flags, testflags=testflags)
+ ADD_NAMED_CFLAGS(conf, 'EXTRA_CFLAGS', flags, testflags=testflags,
+ prereq_flags=prereq_flags)
@conf
def ADD_LDFLAGS(conf, flags, testflags=False):