mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
wafsamba: allow optional 'checkcode' argument to CHECK_BUNDLED_SYSTEM()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
764706c2b0
commit
6ae4121da5
@ -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)
|
||||
|
Reference in New Issue
Block a user