summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-07 13:48:33 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:41 +1000
commite01a71942cdc5cc02008838136dc0f0e52cbb401 (patch)
tree2f8f17f2f8b44c97c1659f6f9f7ca3c216ba5629
parent8bae4823f29984b49efb83b91e60fd761e0bbf9f (diff)
downloadsamba-e01a71942cdc5cc02008838136dc0f0e52cbb401.tar.gz
samba-e01a71942cdc5cc02008838136dc0f0e52cbb401.tar.bz2
samba-e01a71942cdc5cc02008838136dc0f0e52cbb401.zip
build: added define and always options to CHECK_VARIABLE()
-rw-r--r--buildtools/wafsamba/samba_autoconf.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 3d18d2e250..898264e474 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -43,15 +43,20 @@ def CHECK_TYPE(conf, t, alternate):
conf.DEFINE(t, alternate)
@conf
-def CHECK_VARIABLE(conf, v):
+def CHECK_VARIABLE(conf, v, define=None, always=False):
hdrs=''
for h in conf.env.hlist:
hdrs += '#include <%s>\n' % h
+ if define is None:
+ define = 'HAVE_%s' % v.upper()
if conf.check(fragment=
'%s\nint main(void) {void *_x; _x=(void *)&%s; return 0;}\n' % (hdrs, v),
execute=0,
msg="Checking for variable %s" % v):
- conf.DEFINE('HAVE_%s' % v.upper(), 1)
+ conf.DEFINE(define, 1)
+ elif always:
+ conf.DEFINE(define, 0)
+
@runonce
def CHECK_FUNC(conf, f):