diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-03-14 10:19:41 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-04-02 09:03:41 +0200 |
commit | 6ae4121da56e4a80d71c88984c17e7cc2b9d0f62 (patch) | |
tree | bfe0309ac7b41dcfa84a56b3e47ed4b00226b711 /buildtools | |
parent | 764706c2b083b210917dd3966426851c2767b67e (diff) | |
download | samba-6ae4121da56e4a80d71c88984c17e7cc2b9d0f62.tar.gz samba-6ae4121da56e4a80d71c88984c17e7cc2b9d0f62.tar.xz samba-6ae4121da56e4a80d71c88984c17e7cc2b9d0f62.zip |
wafsamba: allow optional 'checkcode' argument to CHECK_BUNDLED_SYSTEM()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_bundled.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index 5926ae2d6eb..97ad4aa365b 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -111,7 +111,7 @@ def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0', @runonce @conf def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', - checkfunctions=None, headers=None, + checkfunctions=None, headers=None, checkcode=None, onlyif=None, implied_deps=None, require_headers=True, pkg=None): '''check if a library is available as a system library. @@ -124,7 +124,7 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', if found in conf.env: return conf.env[found] - def check_functions_headers(): + def check_functions_headers_code(): '''helper function for CHECK_BUNDLED_SYSTEM''' if require_headers and headers and not conf.CHECK_HEADERS(headers, lib=libname): return False @@ -133,6 +133,14 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', empty_decl=False, set_target=False) if not ok: return False + if checkcode is not None: + define='CHECK_BUNDLED_SYSTEM_%s' % libname.upper() + ok = conf.CHECK_CODE(checkcode, lib=libname, + headers=headers, local_include=False, + msg=msg, define=define) + conf.CONFIG_RESET(define) + if not ok: + return False return True @@ -162,14 +170,14 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', if (conf.check_cfg(package=pkg, args='"%s >= %s" --cflags --libs' % (pkg, minversion), msg=msg, uselib_store=uselib_store) and - check_functions_headers()): + check_functions_headers_code()): conf.SET_TARGET_TYPE(libname, 'SYSLIB') conf.env[found] = True if implied_deps: conf.SET_SYSLIB_DEPS(libname, implied_deps) return True if checkfunctions is not None: - if check_functions_headers(): + if check_functions_headers_code(): conf.env[found] = True if implied_deps: conf.SET_SYSLIB_DEPS(libname, implied_deps) |