tdb_compat.h: divert every tdb build and includes to tdb_compat
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:10:25 +0000 (18:40 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:18:34 +0000 (11:18 +0200)
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
35 files changed:
buildtools/wafsamba/samba3.py
lib/tdb_compat/wscript
lib/util/tdb_wrap.c
lib/util/tdb_wrap.h
lib/util/util_tdb.c
lib/util/wscript_build
libcli/auth/schannel_state_tdb.c
source3/configure.in
source3/groupdb/mapping.c
source3/include/ctdbd_conn.h
source3/include/dbwrap.h
source3/include/util_tdb.h
source3/lib/eventlog/eventlog.h
source3/lib/tdb_validate.h
source3/libsmb/smb_share_modes.c
source3/smbd/globals.c
source3/smbd/statcache.c
source3/wscript
source3/wscript_build
source4/cluster/local.c
source4/lib/ldb-samba/ldb_wrap.c
source4/lib/ldb-samba/wscript_build
source4/lib/ldb/ldb_tdb/ldb_tdb.h
source4/lib/ldb/wscript
source4/lib/messaging/messaging.c
source4/ntvfs/common/brlock.c
source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/common/notify.c
source4/ntvfs/common/opendb_tdb.c
source4/ntvfs/posix/python/pyxattr_tdb.c
source4/ntvfs/posix/vfs_posix.c
source4/ntvfs/posix/xattr_tdb.c
source4/torture/basic/mangle_test.c
source4/torture/local/dbspeed.c
wscript_build

index e44e28b..d73fa3a 100644 (file)
@@ -51,7 +51,7 @@ def s3_fix_kwargs(bld, kwargs):
     s3reldir = os_path_relpath(s3dir, bld.curdir)
 
     # the extra_includes list is relative to the source3 directory
-    extra_includes = [ '.', 'include', 'lib' ]
+    extra_includes = [ '.', 'include', 'lib', '../lib/tdb_compat' ]
     if bld.env.use_intree_heimdal:
         extra_includes += [ '../source4/heimdal/lib/com_err',
                             '../source4/heimdal/lib/gssapi',
index 14be4e7..8a6f69a 100644 (file)
@@ -1,7 +1,16 @@
 #!/usr/bin/env python
 
+def set_options(opt):
+    opt.RECURSE('lib/tdb')
+
+def configure(conf):
+    conf.RECURSE('lib/tdb')
+    conf.RECURSE('lib/ccan')
+
 def build(bld):
+    bld.RECURSE('lib/tdb')
+    bld.RECURSE('lib/ccan')
     bld.SAMBA_LIBRARY('tdb_compat',
                       source='tdb_compat.c',
-                     deps='replace tdb',
+                     deps='replace tdb ccan',
                       private_library=True)
index c9562c6..b19b4fe 100644 (file)
 */
 
 #include "includes.h"
-#include <tdb.h>
 #include "lib/util/dlinklist.h"
 #include "lib/util/tdb_wrap.h"
-#include <tdb.h>
 
 /*
  Log tdb messages via DEBUG().
index 1be2bb0..6f9f383 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef _TDB_WRAP_H_
 #define _TDB_WRAP_H_
 
-#include <tdb.h>
+#include "tdb_compat.h"
 
 struct tdb_wrap {
        struct tdb_context *tdb;
index 4a81678..3361585 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "../lib/util/util_tdb.h"
 
 /* these are little tdb utility functions that are meant to make
index 6c4bb37..a094fa3 100755 (executable)
@@ -76,7 +76,7 @@ bld.SAMBA_LIBRARY('wrap_xattr',
 bld.SAMBA_LIBRARY('UTIL_TDB',
        source='util_tdb.c',
        local_include=False,
-       public_deps='tdb talloc',
+       public_deps='tdb_compat talloc',
                   private_library=True
        )
 
@@ -113,7 +113,7 @@ bld.SAMBA_SUBSYSTEM('UTIL_PW',
 
 bld.SAMBA_LIBRARY('tdb-wrap',
                   source='tdb_wrap.c',
-                  deps='tdb talloc samba-util',
+                  deps='tdb_compat talloc samba-util',
                   private_library=True,
                   local_include=False
                   )
index ca35a11..f95691f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "../lib/util/util_tdb.h"
 #include "../libcli/auth/schannel.h"
 #include "../librpc/gen_ndr/ndr_schannel.h"
index 2d248cc..e8662da 100644 (file)
@@ -41,6 +41,7 @@ SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${CCAN_CFLAGS}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/tdb_compat"
 
 SAMBA_CONFIGURE_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/popt"
 
index e37c951..70c96f1 100644 (file)
@@ -26,7 +26,7 @@
 #include "groupdb/mapping.h"
 #include "../libcli/security/security.h"
 #include "lib/winbind_util.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 
 static const struct mapping_backend *backend;
 
index 36b6542..3d71267 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef _CTDBD_CONN_H
 #define _CTDBD_CONN_H
 
-#include <tdb.h>
+#include "tdb_compat.h"
 
 struct ctdbd_connection;
 struct messaging_context;
index d657ee7..303a554 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __DBWRAP_H__
 #define __DBWRAP_H__
 
-#include <tdb.h>
+#include "tdb_compat.h"
 
 struct db_record {
        TDB_DATA key, value;
index a6144ba..f127cea 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __TDBUTIL_H__
 #define __TDBUTIL_H__
 
-#include <tdb.h>
+#include "tdb_compat.h"
 
 #include <talloc.h> /* for tdb_wrap_open() */
 #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */
index b485bfe..694732d 100644 (file)
@@ -17,7 +17,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <tdb.h>
+#include "tdb_compat.h"
 
 /* Defines for TDB keys */
 #define  EVT_OLDEST_ENTRY  "INFO/oldest_entry"
index 3e7c20d..5bb043d 100644 (file)
@@ -23,7 +23,7 @@
 #define __TDB_VALIDATE_H__
 
 #include "lib/replace/replace.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 
 /**
  * Flag field for keeping track of the status of a validation.
index 133b5b8..bb40596 100644 (file)
@@ -27,7 +27,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "smb_share_modes.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include <ccan/hash/hash.h>
 
 /* Database context handle. */
index 93f2ad7..b3cf0bd 100644 (file)
@@ -22,7 +22,7 @@
 #include "smbd/globals.h"
 #include "memcache.h"
 #include "messages.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 
 #if defined(WITH_AIO)
 struct aio_extra *aio_list_head = NULL;
index e2ccc74..e1597fd 100644 (file)
@@ -25,7 +25,7 @@
 #include "smbd/smbd.h"
 #include "messages.h"
 #include "smbprofile.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 
 /****************************************************************************
  Stat cache code used in unix_convert.
index 4b5d98b..12bb08b 100644 (file)
@@ -25,7 +25,7 @@ def set_options(opt):
         opt.RECURSE('../lib/nss_wrapper')
         opt.RECURSE('../lib/socket_wrapper')
         opt.RECURSE('../lib/tevent')
-        opt.RECURSE('../lib/tdb')
+        opt.RECURSE('../lib/tdb_compat')
 
     opt.add_option('--with-static-modules',
                    help=("Comma-separated list of names of modules to statically link in"),
@@ -93,7 +93,7 @@ def configure(conf):
         conf.RECURSE('../lib/replace')
         conf.RECURSE('build')
         conf.RECURSE('../lib/ccan')
-        conf.RECURSE('../lib/tdb')
+        conf.RECURSE('../lib/tdb_compat')
         conf.RECURSE('../lib/talloc')
         conf.RECURSE('../lib/tevent')
         conf.RECURSE('../lib/popt')
@@ -105,7 +105,7 @@ def configure(conf):
 
         conf.ADD_EXTRA_INCLUDES('''#source3 #source3/include #lib/replace #lib''')
         if not conf.env.USING_SYSTEM_TDB:
-            conf.ADD_EXTRA_INCLUDES('#lib/tdb/include')
+            conf.ADD_EXTRA_INCLUDES('#lib/tdb_compat')
         if not conf.env.USING_SYSTEM_TEVENT:
             conf.ADD_EXTRA_INCLUDES('#lib/tevent')
         if not conf.env.USING_SYSTEM_TALLOC:
index 0e8ec50..0e76d1f 100755 (executable)
@@ -662,7 +662,7 @@ bld.SAMBA3_LIBRARY('rpc_client',
 
 bld.SAMBA3_LIBRARY('netapi',
                     source=LIBNETAPI_SRC,
-                    public_deps='''talloc tdb cap wbclient LIB_NONSMBD LIBSMB KRBCLIENT
+                    public_deps='''talloc tdb_compat cap wbclient LIB_NONSMBD LIBSMB KRBCLIENT
                     passdb SMBLDAP PARAM_WITHOUT_REG samba-util
                     LIBMSRPC_GEN msrpc3 ads LIBNET DCUTIL NDR_LIBNETAPI
                     RPC_CLIENT_SCHANNEL smbconf REG_SMBCONF TOKEN_UTIL
@@ -675,7 +675,7 @@ bld.SAMBA3_LIBRARY('netapi',
 
 bld.SAMBA3_LIBRARY('libsmb/smbclient',
                     source=LIBSMBCLIENT_SRC,
-                    public_deps='''talloc tdb wbclient cap param LIB_NONSMBD LIBSMB KRBCLIENT passdb SMBLDAP
+                    public_deps='''talloc tdb_compat wbclient cap param LIB_NONSMBD LIBSMB KRBCLIENT passdb SMBLDAP
                     LIBMSRPC_GEN msrpc3 LIBCLI_LSA3 RPC_NDR_SRVSVC POPT_SAMBA3''',
                     public_headers='include/libsmbclient.h',
                     vnum='0',
@@ -683,7 +683,7 @@ bld.SAMBA3_LIBRARY('libsmb/smbclient',
 
 bld.SAMBA3_LIBRARY('smbsharemodes',
                     source=LIBSMBSHAREMODES_SRC,
-                    public_deps='''talloc tdb''',
+                    public_deps='''talloc tdb_compat''',
                     deps='''ccan''',
                     public_headers='include/smb_share_modes.h',
                     vnum='0',
@@ -722,7 +722,7 @@ bld.SAMBA3_SUBSYSTEM('AVAHI',
 
 bld.SAMBA3_SUBSYSTEM('GROUPDB',
                     source=GROUPDB_SRC,
-                    deps='tdb')
+                    deps='tdb_compat')
 
 bld.SAMBA3_SUBSYSTEM('TLDAP',
                     source=TLDAP_SRC,
@@ -885,7 +885,7 @@ bld.SAMBA3_LIBRARY('smbd_conn',
 
 bld.SAMBA3_LIBRARY('smbd_base',
                     source=SMBD_SRC_BASE,
-                    deps='''tdb tevent dl krb5 ldap gssapi gssapi_krb5
+                    deps='''tdb_compat tevent dl krb5 ldap gssapi gssapi_krb5
                     samba-util wbclient crypt nsl cups cap z passdb
                     PARAM_WITHOUT_REG samba3core LIBSMB POPT_SAMBA3 KRBCLIENT AVAHI
                     LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER LIBADS_PRINTER
@@ -902,7 +902,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
 
 bld.SAMBA3_SUBSYSTEM('LOCKING',
                     source='${LOCKING_SRC}',
-                    deps='''tdb talloc''',
+                    deps='''tdb_compat talloc''',
                     vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('PROFILE',
@@ -1116,7 +1116,7 @@ bld.SAMBA3_BINARY('smbd/smbd',
 
 bld.SAMBA3_BINARY('nmbd/nmbd',
                  source=NMBD_SRC,
-                 deps='''talloc tdb tevent z cap wbclient dl
+                 deps='''talloc tdb_compat tevent z cap wbclient dl
                  passdb param ldap LIB_NONSMBD LIBSMB
                  POPT_SAMBA3 KRBCLIENT NDR_SAMR NDR_LSA PROFILE''',
                  install_path='${SBINDIR}',
@@ -1124,7 +1124,7 @@ bld.SAMBA3_BINARY('nmbd/nmbd',
 
 bld.SAMBA3_BINARY('winbindd/winbindd',
                  source=WINBINDD_SRC,
-                 deps='''talloc tdb tevent cap dl z
+                 deps='''talloc tdb_compat tevent cap dl z
                  wbclient passdb ldap param LIB_NONSMBD LIBSMB
                  POPT_SAMBA3 KRBCLIENT LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER
                  SRV_NDR_WBINT RPC_NDR_WBINT NDR_WBINT LIBAFS
@@ -1151,7 +1151,7 @@ bld.SAMBA3_BINARY('web/swat',
 
 bld.SAMBA3_BINARY('rpcclient/rpcclient',
                  source=RPCCLIENT_SRC,
-                 deps='''talloc tdb cap POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat cap POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
                  PARAM_WITHOUT_REG wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3
                  ads SMBREADLINE DCUTIL RPC_NDR_WINREG RPC_NDR_ECHO
                  RPC_CLIENT_SCHANNEL
@@ -1164,7 +1164,7 @@ bld.SAMBA3_BINARY('rpcclient/rpcclient',
 
 bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3,
                  source=CLIENT_SRC,
-                 deps='''talloc tdb cap POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat cap POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
                  PARAM_WITHOUT_REG wbclient param KRBCLIENT LIBMSRPC_GEN
                  msrpc3 SMBREADLINE libsmb/smbclient RPC_NDR_SRVSVC INIT_LSA
                  LIBCLI_SMB_COMMON''',
@@ -1172,7 +1172,7 @@ bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3,
 
 bld.SAMBA3_BINARY('net',
                  source=NET_SRC,
-                 deps='''talloc tdb netapi addns cap intl POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat netapi addns cap intl POPT_SAMBA3 passdb LIBSMB LIB_NONSMBD
                  PARAM_WITHOUT_REG wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3 LIBGPO ads LIBADS_SERVER LIBADS_PRINTER
                  LIBAFS LIBAFS_SETTOKEN SMBREADLINE PASSWD_UTIL LIBNET
                  LIBNET_DSSYNC LIBNET_SAMSYNC LIBEVENTLOG DCUTIL
@@ -1186,12 +1186,12 @@ bld.SAMBA3_BINARY('net',
 
 bld.SAMBA3_BINARY('profiles',
                  source=PROFILES_SRC,
-                 deps='''talloc tdb cap tevent POPT_SAMBA3 param samba3core LIBSMB_ERR LIB_NONSMBD REGFIO''',
+                 deps='''talloc tdb_compat cap tevent POPT_SAMBA3 param samba3core LIBSMB_ERR LIB_NONSMBD REGFIO''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbspool',
                  source=CUPS_SRC,
-                 deps='''talloc tdb tevent cap wbclient POPT_SAMBA3 param LIBSMB LIB_NONSMBD samba3core
+                 deps='''talloc tdb_compat tevent cap wbclient POPT_SAMBA3 param LIBSMB LIB_NONSMBD samba3core
                  KRBCLIENT asn1util LIBTSOCKET NDR_SAMR NDR_LSA''',
                  vars=locals())
 
@@ -1204,61 +1204,61 @@ bld.SAMBA3_BINARY('testparm',
 
 bld.SAMBA3_BINARY('smbta-util',
                  source=SMBTA_UTIL_SRC,
-                 deps='''talloc tdb tevent cap param POPT_SAMBA3 LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap param POPT_SAMBA3 LIB_NONSMBD
                  LIBSMB_ERR''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbstatus',
                  source=STATUS_SRC,
-                 deps='''talloc tdb tevent cap param POPT_SAMBA3 LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap param POPT_SAMBA3 LIB_NONSMBD
                  LIBSMB_ERR LOCKING PROFILE FNAME_UTIL''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbcontrol',
                  source=SMBCONTROL_SRC,
-                 deps='''talloc tdb tevent cap param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3 PRINTBASE''',
+                 deps='''talloc tdb_compat tevent cap param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3 PRINTBASE''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbtree',
                  source=SMBTREE_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD
                  LIBSMB LIBSMB_ERR POPT_SAMBA3 KRBCLIENT passdb SMBLDAP LIBMSRPC_GEN msrpc3 PROFILE
                  RPC_NDR_SRVSVC''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbpasswd',
                  source=SMBPASSWD_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD
                  LIBSMB LIBSMB_ERR POPT_SAMBA3 KRBCLIENT passdb SMBLDAP LIBMSRPC_GEN msrpc3 PASSWD_UTIL
                  LIBCLI_SAMR INIT_LSA PASSCHANGE''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('pdbedit',
                  source=PDBEDIT_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD
                  LIBNTLMSSP LIBSMB_ERR POPT_SAMBA3 passdb SMBLDAP
                  PASSWD_UTIL cli-ldap-common''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbget',
                  source=SMBGET_SRC,
-                 deps='''talloc tdb libsmb/smbclient POPT_SAMBA3''',
+                 deps='''talloc tdb_compat libsmb/smbclient POPT_SAMBA3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('nmblookup' + bld.env.suffix3,
                  source=NMBLOOKUP_SRC,
-                 deps='''talloc tdb tevent cap param LIB_NONSMBD POPT_SAMBA3 LIBSMB_ERR LIBNMB''',
+                 deps='''talloc tdb_compat tevent cap param LIB_NONSMBD POPT_SAMBA3 LIBSMB_ERR LIBNMB''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
                  source=SMBTORTURE_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIBSMB KRBCLIENT TLDAP
+                 deps='''talloc tdb_compat tevent cap wbclient param LIBSMB KRBCLIENT TLDAP
                  LIB_NONSMBD POPT_SAMBA3 asn1util LIBTSOCKET NDR_LSA msrpc3 LIBMSRPC_GEN RPC_NDR_ECHO WB_REQTRANS''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbconftort',
                  source=SMBCONFTORT_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3''',
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('replacetort',
@@ -1268,25 +1268,25 @@ bld.SAMBA3_BINARY('replacetort',
 
 bld.SAMBA3_BINARY('masktest' + bld.env.suffix3,
                  source=MASKTEST_SRC,
-                 deps='''talloc tdb cap wbclient param LIB_NONSMBD LIBSMB KRBCLIENT
+                 deps='''talloc tdb_compat cap wbclient param LIB_NONSMBD LIBSMB KRBCLIENT
                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('msgtest',
                  source=MSGTEST_SRC,
-                 deps='''talloc tdb tevent cap param LIBSMB_ERR LIB_NONSMBD''',
+                 deps='''talloc tdb_compat tevent cap param LIBSMB_ERR LIB_NONSMBD''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbcacls',
                  source=SMBCACLS_SRC,
-                 deps='''talloc tdb cap wbclient param LIBSMB KRBCLIENT
+                 deps='''talloc tdb_compat cap wbclient param LIBSMB KRBCLIENT
                  LIB_NONSMBD passdb POPT_SAMBA3 SMBLDAP LIBMSRPC_GEN
                  msrpc3 LIBCLI_LSA3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbcquotas',
                  source=SMBCQUOTAS_SRC,
-                 deps='''talloc tdb cap wbclient param LIB_NONSMBD LIBSMB KRBCLIENT
+                 deps='''talloc tdb_compat cap wbclient param LIB_NONSMBD LIBSMB KRBCLIENT
                  POPT_SAMBA3 passdb SMBLDAP LIBMSRPC_GEN msrpc3
                  LIBCLI_LSA3''',
                  vars=locals())
@@ -1299,18 +1299,18 @@ bld.SAMBA3_BINARY('eventlogadm',
 
 bld.SAMBA3_BINARY('sharesec',
                  source=SHARESEC_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3''',
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD LIBSMB_ERR POPT_SAMBA3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('locktest' + bld.env.suffix3,
                  source=LOCKTEST_SRC,
-                 deps='''talloc tdb tevent cap wbclient param KRBCLIENT LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient param KRBCLIENT LIBSMB LIB_NONSMBD
                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA LOCKING FNAME_UTIL''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('pdbtest',
                  source=PDBTEST_SRC,
-                 deps='''talloc tdb cap wbclient param LIBSMB KRBCLIENT LIB_NONSMBD passdb
+                 deps='''talloc tdb_compat cap wbclient param LIBSMB KRBCLIENT LIB_NONSMBD passdb
                  SMBLDAP POPT_SAMBA3 NDR_SAMR NDR_LSA''',
                  vars=locals())
 
@@ -1321,7 +1321,7 @@ bld.SAMBA3_BINARY('vfstest',
 
 bld.SAMBA3_BINARY('smbiconv',
                  source=SMBICONV_SRC,
-                 deps='''talloc tdb tevent cap param LIB_NONSMBD POPT_SAMBA3 LIBSMB_ERR''',
+                 deps='''talloc tdb_compat tevent cap param LIB_NONSMBD POPT_SAMBA3 LIBSMB_ERR''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('log2pcap',
@@ -1331,7 +1331,7 @@ bld.SAMBA3_BINARY('log2pcap',
 
 bld.SAMBA3_BINARY('locktest2',
                  source=LOCKTEST2_SRC,
-                 deps='''talloc tdb tevent cap wbclient param KRBCLIENT LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient param KRBCLIENT LIBSMB LIB_NONSMBD
                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA LOCKING FNAME_UTIL''',
                  vars=locals())
 
@@ -1360,7 +1360,7 @@ bld.SAMBA3_BINARY('wbinfo' + bld.env.suffix3,
 
 bld.SAMBA3_BINARY('ntlm_auth' + bld.env.suffix3,
                  source=NTLM_AUTH_SRC,
-                 deps='''tdb talloc cap KRB5_WRAP k5crypto wbclient param LIB_NONSMBD
+                 deps='''tdb_compat talloc cap KRB5_WRAP k5crypto wbclient param LIB_NONSMBD
                  samba3core LIBNTLMSSP POPT_SAMBA3 asn1util LIBTSOCKET
                  passdb SMBLDAP winbind-client LIBINIPARSER LIBADS_SERVER
                  NDR_SAMR NDR_LSA NDR_NETLOGON cli-ldap-common LIBNMB SLCACHE SPNEGO_PARSE KRBCLIENT''',
@@ -1372,35 +1372,35 @@ bld.SAMBA3_BINARY('timelimit',
 
 bld.SAMBA3_BINARY('rpc_open_tcp',
                  source=RPC_OPEN_TCP_SRC,
-                 deps='''talloc tdb tevent cap wbclient KRBCLIENT param samba3core LIBSMB LIB_NONSMBD
+                 deps='''talloc tdb_compat tevent cap wbclient KRBCLIENT param samba3core LIBSMB LIB_NONSMBD
                  LIBSMB_ERR asn1util LIBTSOCKET LIBMSRPC_GEN msrpc3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('test_lp_load',
                  source=TEST_LP_LOAD_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD POPT_SAMBA3 LIBNTLMSSP''',
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD POPT_SAMBA3 LIBNTLMSSP''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('dbwrap_tool',
                  source=DBWRAP_TOOL_SRC,
-                 deps='''talloc tdb tevent cap param LIB_NONSMBD LIBSMB_ERR''',
+                 deps='''talloc tdb_compat tevent cap param LIB_NONSMBD LIBSMB_ERR''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('dbwrap_torture',
                  source=DBWRAP_TORTURE_SRC,
-                 deps='''talloc tdb tevent cap param LIB_NONSMBD LIBSMB_ERR
+                 deps='''talloc tdb_compat tevent cap param LIB_NONSMBD LIBSMB_ERR
                  POPT_SAMBA3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('split_tokens',
                  source=SPLIT_TOKENS_SRC,
-                 deps='''talloc tdb tevent cap wbclient param LIB_NONSMBD POPT_SAMBA3
+                 deps='''talloc tdb_compat tevent cap wbclient param LIB_NONSMBD POPT_SAMBA3
                  LIBNTLMSSP''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('vlp',
                  source=VLP_SRC,
-                 deps='''talloc tdb PARAM_UTIL UTIL_TDB samba3core param''',
+                 deps='''talloc tdb_compat PARAM_UTIL UTIL_TDB samba3core param''',
                  vars=locals())
 
 swat_dir = os.path.join(bld.curdir, '../swat')
@@ -1450,7 +1450,7 @@ bld.RECURSE('../lib/smbconf')
 bld.RECURSE('../lib/socket_wrapper')
 bld.RECURSE('../lib/uid_wrapper')
 bld.RECURSE('../lib/talloc')
-bld.RECURSE('../lib/tdb')
+bld.RECURSE('../lib/tdb_compat')
 bld.RECURSE('../lib/util')
 bld.RECURSE('../lib/tevent')
 bld.RECURSE('../lib/tsocket')
index 833a86b..0a294b4 100644 (file)
@@ -22,7 +22,7 @@
 #include "includes.h"
 #include "cluster/cluster.h"
 #include "cluster/cluster_private.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "lib/util/tdb_wrap.h"
 #include "system/filesys.h"
 #include "param/param.h"
index d713dff..66213bf 100644 (file)
@@ -35,7 +35,7 @@
 #include "dsdb/samdb/samdb.h"
 #include "param/param.h"
 #include "../lib/util/dlinklist.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 
 /*
   this is used to catch debug messages from ldb
index e6a13f3..2e1cacb 100644 (file)
@@ -8,7 +8,7 @@ bld.SAMBA_LIBRARY('ldbsamba',
                   source='ldif_handlers.c',
                   autoproto='ldif_handlers_proto.h',
                   public_deps='ldb',
-                  deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb pyldb-util errors',
+                  deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb_compat pyldb-util errors',
                   private_library=True
                   )
 
index 3d793d2..82127a1 100644 (file)
@@ -1,7 +1,7 @@
 #include "replace.h"
 #include "system/filesys.h"
 #include "system/time.h"
-#include "tdb.h"
+#include "tdb_compat.h"
 #include "ldb_module.h"
 
 /* this private structure is used by the ltdb backend in the
index b59e782..393f99f 100755 (executable)
@@ -16,29 +16,33 @@ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
 import wafsamba, samba_dist, Options
 
 samba_dist.DIST_DIRS('''source4/lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
-                        lib/tdb:lib/tdb lib/tevent:lib/tevent lib/popt:lib/popt
+                        lib/tdb:lib/tdb lib/tdb_compat:lib/tdb_compat lib/ccan:lib/ccan lib/tevent:lib/tevent lib/popt:lib/popt
                         buildtools:buildtools''')
 
 
 def set_options(opt):
     opt.BUILTIN_DEFAULT('replace')
     opt.PRIVATE_EXTENSION_DEFAULT('ldb', noextension='ldb')
-    opt.RECURSE('lib/tdb')
+    opt.RECURSE('lib/tdb_compat')
     opt.RECURSE('lib/tevent')
     opt.RECURSE('lib/replace')
     opt.tool_options('python') # options for disabling pyc or pyo compilation
 
 def configure(conf):
-    conf.RECURSE('lib/tdb')
+    conf.RECURSE('lib/tdb_compat')
     conf.RECURSE('lib/tevent')
     conf.RECURSE('lib/popt')
     conf.RECURSE('lib/replace')
+    conf.RECURSE('lib/tdb_compat')
     conf.find_program('python', var='PYTHON')
     conf.find_program('xsltproc', var='XSLTPROC')
     conf.check_tool('python')
     conf.check_python_version((2,4,2))
     conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
 
+    # This make #include <ccan/...> work.
+    conf.ADD_EXTRA_INCLUDES('''#lib''')
+
     # where does the default LIBDIR end up? in conf.env somewhere?
     #
     conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
@@ -72,10 +76,11 @@ def configure(conf):
     conf.SAMBA_CONFIG_H()
 
 def build(bld):
-    bld.RECURSE('lib/tdb')
+    bld.RECURSE('lib/tdb_compat')
     bld.RECURSE('lib/tevent')
     bld.RECURSE('lib/popt')
     bld.RECURSE('lib/replace')
+    bld.RECURSE('lib/tdb_compat')
 
     if bld.env.standalone_ldb:
         private_library = False
@@ -233,14 +238,14 @@ def build(bld):
                          init_function='ldb_tdb_init',
                          module_init_name='ldb_init_module',
                          internal_module=False,
-                         deps='tdb ldb',
+                         deps='tdb_compat ldb',
                          subsystem='ldb')
 
         # have a separate subsystem for common/ldb.c, so it can rebuild
         # for install with a different -DLDB_MODULESDIR=
         bld.SAMBA_SUBSYSTEM('LIBLDB_MAIN',
                             'common/ldb.c',
-                            deps='tevent',
+                            deps='tevent tdb_compat',
                             includes='include',
                             cflags=['-DLDB_MODULESDIR=\"%s\"' % modules_dir])
 
index aa1b433..13fc188 100644 (file)
@@ -30,7 +30,7 @@
 #include "lib/util/tdb_wrap.h"
 #include "../lib/util/unix_privs.h"
 #include "librpc/rpc/dcerpc.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "../lib/util/util_tdb.h"
 #include "cluster/cluster.h"
 #include "../lib/util/tevent_ntstatus.h"
index 142b4ff..a6232f8 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "messaging/messaging.h"
 #include "lib/messaging/irpc.h"
 #include "libcli/libcli.h"
index 3fd0edc..885eda9 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "messaging/messaging.h"
 #include "lib/util/tdb_wrap.h"
 #include "lib/messaging/irpc.h"
index e3335fe..98f17a6 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "../lib/util/util_tdb.h"
 #include "messaging/messaging.h"
 #include "lib/util/tdb_wrap.h"
index 7c2707f..851d838 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "messaging/messaging.h"
 #include "lib/util/tdb_wrap.h"
 #include "lib/messaging/irpc.h"
index 34b449f..2b28aca 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <Python.h>
 #include "includes.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "lib/util/tdb_wrap.h"
 #include "librpc/ndr/libndr.h"
 #include "lib/util/wrap_xattr.h"
index 5b89f1e..00ed146 100644 (file)
@@ -26,7 +26,7 @@
 #include "includes.h"
 #include "vfs_posix.h"
 #include "librpc/gen_ndr/security.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "lib/util/tdb_wrap.h"
 #include "libcli/security/security.h"
 #include "lib/events/events.h"
index 2d6f1d9..a2e8111 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "lib/util/tdb_wrap.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include "vfs_posix.h"
 
 #define XATTR_LIST_ATTR ".xattr_list"
index 0b7d696..a15dc00 100644 (file)
@@ -20,7 +20,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "system/dir.h"
-#include <tdb.h>
+#include "../lib/tdb_compat/tdb_compat.h"
 #include "../lib/util/util_tdb.h"
 #include "libcli/libcli.h"
 #include "torture/util.h"
index 55fed70..92deb4f 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include <tdb.h>
+#include "tdb_compat.h"
 #include <ldb.h>
 #include <ldb_errors.h>
 #include "ldb_wrap.h"
index a6e2cab..ff4f7f3 100644 (file)
@@ -35,7 +35,6 @@ bld.SAMBA_MKVERSION('version.h')
 bld.RECURSE('lib/replace')
 bld.RECURSE('lib/socket')
 bld.RECURSE('lib/talloc')
-bld.RECURSE('lib/tdb')
 bld.RECURSE('lib/tevent')
 bld.RECURSE('lib/ccan')
 bld.RECURSE('lib/tdb_compat')