From 87f255821b75accb0d91ac11cdf059f91bf6ecd4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Feb 2013 14:20:07 +0100 Subject: wafsamba: add CHECK_VALUEOF() helper Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- buildtools/wafsamba/samba_autoconf.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 76316d28e6..65c66f393b 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -323,7 +323,25 @@ def CHECK_SIZEOF(conf, vars, headers=None, define=None): ret = False return ret - +@conf +def CHECK_VALUEOF(conf, v, headers=None, define=None): + '''check the value of a variable/define''' + ret = True + v_define = define + if v_define is None: + v_define = 'VALUEOF_%s' % v.upper().replace(' ', '_') + if CHECK_CODE(conf, + 'printf("%%u", (unsigned)(%s))' % v, + define=v_define, + execute=True, + define_ret=True, + quote=False, + headers=headers, + local_include=False, + msg="Checking value of %s" % v): + return int(conf.env[v_define]) + + return None @conf def CHECK_CODE(conf, code, define, -- cgit