wafsamba: allow certain public libraries to be forced to be private
authorAndrew Bartlett <abartlet@samba.org>
Thu, 19 Apr 2012 05:34:48 +0000 (15:34 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 20 Apr 2012 01:27:22 +0000 (03:27 +0200)
This will help installations where the Samba4 libraries must be used but
the main system is not using the system libs that would normally
be installed.  This in particular impacts on libwbclient, which is a
core dep, but is different to that used by the rest of a Samba 3.x based
system.

Use eg:  ./configure --private-libraries=wbclient

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr 20 03:27:22 CEST 2012 on sn-devel-104

buildtools/wafsamba/samba_bundled.py
buildtools/wafsamba/wafsamba.py
buildtools/wafsamba/wscript

index c5b402229752d3a59777f13c49460ac05d7baa64..1a5d565b382e17b742353859fc235a430e864021 100644 (file)
@@ -81,6 +81,10 @@ def LIB_MUST_BE_BUNDLED(conf, libname):
     return ('ALL' in conf.env.BUNDLED_LIBS or 
             libname in conf.env.BUNDLED_LIBS)
 
+@conf
+def LIB_MUST_BE_PRIVATE(conf, libname):
+    return ('ALL' in conf.env.PRIVATE_LIBS or
+            libname in conf.env.PRIVATE_LIBS)
 
 @conf
 def CHECK_PREREQUISITES(conf, prereqs):
index 317bca127553c17b12857dc2fe111c36ab6d5f40..534bace25b441eba44bcb8bc4132e2c6380cd508 100644 (file)
@@ -132,6 +132,9 @@ def SAMBA_LIBRARY(bld, libname, source,
                   enabled=True):
     '''define a Samba library'''
 
+    if LIB_MUST_BE_PRIVATE(bld, libname):
+        private_library=True
+
     if not enabled:
         SET_TARGET_TYPE(bld, libname, 'DISABLED')
         return
index ff18777575cdfe121541cad973f11afe9d55b5cc..4db341202ee48be8ac521a6295d83d20ee341343 100755 (executable)
@@ -27,6 +27,10 @@ def set_options(opt):
                    help=("comma separated list of bundled libraries. May include !LIBNAME to disable bundling a library. Can be 'NONE' or 'ALL' [auto]"),
                    action="store", dest='BUNDLED_LIBS', default='')
 
+    gr.add_option('--private-libraries',
+                   help=("comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private. Can be 'NONE' or 'ALL' [auto]"),
+                   action="store", dest='PRIVATE_LIBS', default='')
+
     extension_default = Options.options['PRIVATE_EXTENSION_DEFAULT']
     gr.add_option('--private-library-extension',
                    help=("name extension for private libraries [%s]" % extension_default),
@@ -233,6 +237,7 @@ def configure(conf):
     conf.env.MODULESDIR = Options.options.MODULESDIR
     conf.env.PRIVATELIBDIR = Options.options.PRIVATELIBDIR
     conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',')
+    conf.env.PRIVATE_LIBS = Options.options.PRIVATE_LIBS.split(',')
     conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',')
     conf.env.DISABLE_SHARED = Options.options.disable_shared
     conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',')