summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-19 13:47:11 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-19 13:47:11 +0200
commita8aaf3d4be4e835fc32bca46dbc4667bf265e1ef (patch)
tree540e702200952179e160cb111287b3b95501db2b /buildtools
parent238e89f7b0c3f35578105329578685a187209f83 (diff)
downloadsamba-a8aaf3d4be4e835fc32bca46dbc4667bf265e1ef.tar.gz
samba-a8aaf3d4be4e835fc32bca46dbc4667bf265e1ef.tar.bz2
samba-a8aaf3d4be4e835fc32bca46dbc4667bf265e1ef.zip
wafsamba: Factor out functions to determine if a bundled library should not or
must be used.
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_bundled.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index ee6de796ce..caf5361ac6 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -72,6 +72,18 @@ def minimum_library_version(conf, libname, default):
return default
+@conf
+def LIB_MAY_BE_BUNDLED(conf, libname):
+ return ('NONE' not in conf.env.BUNDLED_LIBS and
+ '!%s' % libname not in conf.env.BUNDLED_LIBS)
+
+
+@conf
+def LIB_MUST_BE_BUNDLED(conf, libname):
+ return ('ALL' in conf.env.BUNDLED_LIBS or
+ libname in conf.env.BUNDLED_LIBS)
+
+
@runonce
@conf
def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
@@ -82,7 +94,7 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
this first tries via pkg-config, then if that fails
tries by testing for a specified function in the specified lib
'''
- if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS:
+ if conf.LIB_MUST_BE_BUNDLED(libname):
return False
found = 'FOUND_SYSTEMLIB_%s' % libname
if found in conf.env:
@@ -122,7 +134,7 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
conf.SET_SYSLIB_DEPS(libname, implied_deps)
return True
conf.env[found] = False
- if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS:
+ if conf.LIB_MAY_BE_BUNDLED(libname):
Logs.error('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion))
sys.exit(1)
return False