From: Andrew Bartlett Date: Fri, 9 Feb 2024 06:47:11 +0000 (+1300) Subject: build: Allow --private-libraries to include a default X-Git-Tag: tdb-1.4.11~1612 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f41997b4c673caeaa60ab7b3a5bb6e806deedc0;p=thirdparty%2Fsamba.git build: Allow --private-libraries to include a default This will in the future allow ldb to be declared public in the build system, and so have all the attributes set for that, but be actually built as a private Samba library by default. No change in behavour currently. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index 029be159b62..b9960f1cbb1 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -88,7 +88,14 @@ def LIB_MAY_BE_BUNDLED(conf, libname): return False return True -def __LIB_MUST_BE(liblist, libname): +def __LIB_MUST_BE(liblist_in, defaults, libname): + liblist = [] + for lib in liblist_in: + if lib == "DEFAULT": + liblist += defaults + else: + liblist += [lib] + if libname in liblist: return True if '!%s' % libname in liblist: @@ -99,11 +106,11 @@ def __LIB_MUST_BE(liblist, libname): @conf def LIB_MUST_BE_BUNDLED(conf, libname): - return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, libname) + return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, [], libname) @conf def LIB_MUST_BE_PRIVATE(conf, libname): - return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, libname) + return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, conf.env.DEFAULT_PRIVATE_LIBS, libname) @conf def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0', diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 99a623737f1..e18bc4fd741 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -63,9 +63,12 @@ This allows that to be disabled, to ensure that other software does not use these libraries and they are placed in a private filesystem prefix. +Likewise, it allows the value of DEFAULT (currently {','.join(Context.g_module.DEFAULT_PRIVATE_LIBS) if getattr(Context.g_module, 'DEFAULT_PRIVATE_LIBS', False) else "''"}) +to be overridden, allowing a private-by-default library to be exposed. + May include !LIBNAME to disable making a library private in order to -limit the effect of 'ALL' '''), - action="store", dest='PRIVATE_LIBS', default='') +limit the effect of 'ALL' and 'DEFAULT'.'''), + action="store", dest='PRIVATE_LIBS', default='DEFAULT') extension_default = default_value('PRIVATE_EXTENSION_DEFAULT') gr.add_option('--private-library-extension', @@ -325,6 +328,10 @@ def configure(conf): conf.env.PRIVATELIBDIR = Options.options.PRIVATELIBDIR conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',') conf.env.SYSTEM_LIBS = () + + if getattr(Context.g_module, 'DEFAULT_PRIVATE_LIBS', False): + conf.env.DEFAULT_PRIVATE_LIBS = Context.g_module.DEFAULT_PRIVATE_LIBS + conf.env.PRIVATE_LIBS = Options.options.PRIVATE_LIBS.split(',') conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',') conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',')