ldb: Honour --private-library=!ldb as meaning build as a public library
authorAndrew Bartlett <abartlet@samba.org>
Fri, 9 Feb 2024 09:15:30 +0000 (22:15 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 1 Mar 2024 02:41:36 +0000 (02:41 +0000)
Likewise, let the SAMBA_LIBRARY code handle being a private library
rather than in the library declaration.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
buildtools/wafsamba/wafsamba.py
lib/ldb/wscript
wscript

index 171022383eb4e10e53c661ba43fef5ed63e18fe7..fad5fd24e38cb46bc1359a6412c71f57cc5d0097 100644 (file)
@@ -33,6 +33,7 @@ import symbols
 import pkgconfig
 import configure_file
 import samba_waf18
+import samba_bundled
 
 LIB_PATH="shared"
 
index 25591a2617d9a97aa8170ee09c7a63503f17632c..cfdcb2eb6f6898ce96ea791ac22539b55a2e68b4 100644 (file)
@@ -14,7 +14,7 @@ sys.path.insert(0, top + '/buildtools/wafsamba')
 
 out = 'bin'
 
-from wafsamba import samba_dist, samba_utils
+from wafsamba import samba_dist, samba_utils, samba_bundled
 from waflib import Errors, Options, Logs, Context
 import shutil
 
@@ -194,6 +194,9 @@ def configure(conf):
 
     conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
 
+    conf.env.ldb_is_public_library \
+        = not samba_bundled.LIB_MUST_BE_PRIVATE(conf, 'ldb')
+
 def build(bld):
     bld.RECURSE('lib/tevent')
 
@@ -208,9 +211,9 @@ def build(bld):
         if not 'PACKAGE_VERSION' in bld.env:
             bld.env.PACKAGE_VERSION = VERSION
         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
-        private_library = False
-    else:
-        private_library = True
+
+    private_library = not bld.env.ldb_is_public_library
+
     # we're not currently linking against the ldap libs, but ldb.pc.in
     # has @LDAP_LIBS@
     bld.env.LDAP_LIBS = ''
@@ -273,11 +276,11 @@ def build(bld):
                           COMMON_SRC + ' ' + LDB_MAP_SRC,
                           deps='tevent LIBLDB_MAIN replace',
                           includes='include',
-                          public_headers=('' if private_library else ldb_headers),
-                          public_headers_install=not private_library,
+                          public_headers=ldb_headers,
+                          public_headers_install=True,
                           pc_files='ldb.pc',
                           vnum=VERSION,
-                          private_library=private_library,
+                          private_library=False,
                           manpages='man/ldb.3',
                           abi_directory='ABI',
                           abi_match = abi_match)
diff --git a/wscript b/wscript
index 770b9bcf9af3a50bce639f22ff67f940d3824181..6b5d29bcfe5ebab11d95323cb6a64ae8b6b7f247 100644 (file)
--- a/wscript
+++ b/wscript
@@ -16,6 +16,8 @@ from waflib.Tools import bison
 samba_dist.DIST_DIRS('.')
 samba_dist.DIST_BLACKLIST('.gitignore .bzrignore source4/selftest/provisions')
 
+DEFAULT_PRIVATE_LIBS = ["ldb"]
+
 # install in /usr/local/samba by default
 default_prefix = Options.default_prefix = '/usr/local/samba'