From a8aaf3d4be4e835fc32bca46dbc4667bf265e1ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 19 Jun 2010 13:47:11 +0200 Subject: wafsamba: Factor out functions to determine if a bundled library should not or must be used. --- buildtools/wafsamba/samba_bundled.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'buildtools/wafsamba/samba_bundled.py') 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 -- cgit