ldb: Change LDBSAMBA back to subsystem, update comments, use different
authorJelmer Vernooij <jelmer@samba.org>
Sun, 20 Jun 2010 09:49:08 +0000 (11:49 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 20 Jun 2010 09:49:08 +0000 (11:49 +0200)
ABI file based on whether ldb_ildap is included.

source4/lib/ldb-samba/wscript_build
source4/lib/ldb/wscript

index 717a8465a7da72993357d99cbe91696af0059faf..970f495eca6c107ae2358a6fccdb36650624f0dd 100644 (file)
@@ -1,11 +1,15 @@
 #!/usr/bin/env python
 
+# LDBSAMBA gets included in the ldb build when we are building ldb_ildap 
+# as a built-in module and this delutes the symbols in the ldb library with 
+# the symbols of all of ldb_ildap's dependencies. 
 
-# It is important that this is a library!
-# Otherwise samba specific symbols end up in
-# 'ldb' and we fail the ABI check, when not using
-# a system 'ldb'.
-bld.SAMBA_LIBRARY('LDBSAMBA',
+# However, LDBSAMBA has to be a subsystem, otherwise we end up with an unusable
+# build when building against the system ldb.
+
+# When adding/modifying public symbols in LDBSAMBA, please make sure that 
+# lib/ldb/ABI/ldb-samba-X.sigs gets updated.
+bld.SAMBA_SUBSYSTEM('LDBSAMBA',
        source='ldif_handlers.c ldb_wrap.c',
        autoproto='ldif_handlers_proto.h',
        public_deps='ldb',
index 6f6c9a1f9edb8b66fd82a240e294c7fcb50d5fdf..df2245f6749f0afcfd8ef3c3ff336d8d2277a50c 100644 (file)
@@ -74,13 +74,15 @@ def build(bld):
                             ldb_attributes.c attrib_handlers.c ldb_controls.c qsort.c''')
 
     if s4_build:
+        builtin_ildap = not bld.CONFIG_SET('USING_SYSTEM_LDB')
         # this is only in the s4 build
         bld.SAMBA_MODULE('ldb_ildap', 'ldb_ildap/ldb_ildap.c',
                          init_function='LDB_BACKEND(ldapi),LDB_BACKEND(ldaps),LDB_BACKEND(ldap)',
                          deps='talloc LIBCLI_LDAP CREDENTIALS',
-                         internal_module=not bld.CONFIG_SET('USING_SYSTEM_LDB'),
+                         internal_module=builtin_ildap,
                          subsystem='ldb')
     else:
+        builtin_ildap = False
         # this is not included in the s4 build
         bld.SAMBA_MODULE('ldb_ldap', 'ldb_ldap/ldb_ldap.c',
                          init_function='LDB_BACKEND(ldapi),LDB_BACKEND(ldaps),LDB_BACKEND(ldap)',
@@ -96,7 +98,10 @@ def build(bld):
         bld.env.PACKAGE_VERSION = VERSION
         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
 
-    abi_file = 'ABI/ldb-%s.sigs' % VERSION
+    if builtin_ildap:
+        abi_file = 'ABI/ldb-ildap-%s.sigs' % VERSION
+    else:
+        abi_file = 'ABI/ldb-%s.sigs' % VERSION
 
     bld.SAMBA_SUBSYSTEM('pyldb_util', deps='ldb',
             source='pyldb_util.c', needs_python=True)