summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_bundled.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-28 17:05:30 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:13 +1000
commitb9aa63887c005971b1b812893d6c1bbc50ea21b2 (patch)
treea5e73d210538ec5b12019170cff367dc144d3d16 /buildtools/wafsamba/samba_bundled.py
parentbfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9 (diff)
downloadsamba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.tar.gz
samba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.tar.bz2
samba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.zip
s4-waf: cleanup use of LIBPOPT vs popt dependency
Diffstat (limited to 'buildtools/wafsamba/samba_bundled.py')
-rw-r--r--buildtools/wafsamba/samba_bundled.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 2a6d75f7c9..6e3753a790 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -42,15 +42,27 @@ def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''):
Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT
+@runonce
@conf
-def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0'):
+def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
+ checkfunctions=None, headers=None):
if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS:
return False
+ found = 'FOUND_SYSTEMLIB_%s' % libname
+ if found in conf.env:
+ return conf.env[found]
+ # try pkgconfig first
if conf.check_cfg(package=libname,
args='"%s >= %s" --cflags --libs' % (libname, minversion),
msg='Checking for system %s >= %s' % (libname, minversion)):
conf.SET_TARGET_TYPE(libname, 'SYSLIB')
+ conf.env[found] = True
return True
+ if checkfunctions is not None:
+ if conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers):
+ conf.env[found] = True
+ return True
+ conf.env[found] = False
if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS:
print('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion))
sys.exit(1)