summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-22 14:20:07 +0100
committerJeremy Allison <jra@samba.org>2013-03-01 11:58:38 -0800
commit87f255821b75accb0d91ac11cdf059f91bf6ecd4 (patch)
tree5556df72b8da7c19ff402324fe866c40ff6cc2c8 /buildtools
parentd9a69e6dbf61cffd6be473a460f6671573aa8564 (diff)
downloadsamba-87f255821b75accb0d91ac11cdf059f91bf6ecd4.tar.gz
wafsamba: add CHECK_VALUEOF() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 76316d28e67..65c66f393bc 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,