summaryrefslogtreecommitdiffstats
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-19 15:48:34 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-04-02 09:03:45 +0200
commit8cdd9f3a7f5e2576c0676eeef32b44484516e885 (patch)
tree694bad970359d7ef5982a6ca2098d4beeba8d581 /buildtools/wafsamba
parent2f059329b0aa617907f25d31c9d65ccaa54e78e9 (diff)
downloadsamba-8cdd9f3a7f5e2576c0676eeef32b44484516e885.tar.gz
samba-8cdd9f3a7f5e2576c0676eeef32b44484516e885.tar.xz
samba-8cdd9f3a7f5e2576c0676eeef32b44484516e885.zip
wafsamba: split out a conf.ADD_NAMED_CFLAGS() function
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 0cc53bd8348..1357fd7af46 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -710,7 +710,7 @@ def CONFIG_PATH(conf, name, default):
conf.env[name] = conf.env['PREFIX'] + default
@conf
-def ADD_CFLAGS(conf, flags, testflags=False):
+def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False):
'''add some CFLAGS to the command line
optionally set testflags to ensure all the flags work
'''
@@ -720,9 +720,16 @@ def ADD_CFLAGS(conf, flags, testflags=False):
if CHECK_CFLAGS(conf, f):
ok_flags.append(f)
flags = ok_flags
- if not 'EXTRA_CFLAGS' in conf.env:
- conf.env['EXTRA_CFLAGS'] = []
- conf.env['EXTRA_CFLAGS'].extend(TO_LIST(flags))
+ if not name in conf.env:
+ conf.env[name] = []
+ conf.env[name].extend(TO_LIST(flags))
+
+@conf
+def ADD_CFLAGS(conf, flags, testflags=False):
+ '''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)
@conf
def ADD_LDFLAGS(conf, flags, testflags=False):