summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_bundled.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-28 16:38:27 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:13 +1000
commitbfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9 (patch)
tree35e0b133c53a859c90962d0678b0e5218943b6f8 /buildtools/wafsamba/samba_bundled.py
parent505e902436b2a31a7b828fdeddf599339d0229e5 (diff)
downloadsamba-bfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9.tar.gz
samba-bfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9.tar.bz2
samba-bfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9.zip
s4-waf: support the use of system libraries
distros can set --bundled-libraries=NONE to force use of all system libraries. If the right version isn't found then configure will fail. Users may choose which libraries to use from the system, and which to use bundled libs. The default is to try system libs, and use them if their version matches the one in the source tree.
Diffstat (limited to 'buildtools/wafsamba/samba_bundled.py')
-rw-r--r--buildtools/wafsamba/samba_bundled.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index d4dbe221db..2a6d75f7c9 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -40,3 +40,18 @@ def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''):
Options.options['BUNDLED_EXTENSION_DEFAULT'] = extension
Options.options['BUNDLED_EXTENSION_EXCEPTION'] = noextenion
Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT
+
+
+@conf
+def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0'):
+ if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS:
+ return False
+ 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')
+ return True
+ 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)
+ return False