From e01a71942cdc5cc02008838136dc0f0e52cbb401 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Mar 2010 13:48:33 +1100 Subject: build: added define and always options to CHECK_VARIABLE() --- buildtools/wafsamba/samba_autoconf.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'buildtools/wafsamba/samba_autoconf.py') 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): -- cgit