smbldap: expose bind callback via API and increase smbldap ABI version
[vlendec/samba-autobuild/.git] / source3 / wscript_build
old mode 100755 (executable)
new mode 100644 (file)
index 1598555..a030b8a
@@ -57,48 +57,81 @@ bld.SAMBA3_LIBRARY('netapi',
 
 bld.SAMBA3_LIBRARY('gse',
                    source='librpc/crypto/gse_krb5.c librpc/crypto/gse.c',
-                   deps='krb5samba gensec param KRBCLIENT secrets3',
+                   deps='krb5samba gensec smbconf KRBCLIENT secrets3',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('msrpc3',
-                   source='''rpc_client/cli_pipe.c
-                   rpc_client/rpc_transport_np.c
-                   rpc_client/rpc_transport_sock.c
-                   rpc_client/rpc_transport_tstream.c
-                   librpc/rpc/dcerpc_helpers.c''',
-                   deps='''ndr ndr-standard
-                    RPC_NDR_EPMAPPER NTLMSSP_COMMON COMMON_SCHANNEL LIBCLI_AUTH
-                    LIBTSOCKET gse dcerpc-binding
-                    libsmb ndr-table NETLOGON_CREDS_CLI
+                   source='''
+                          rpc_client/cli_pipe.c
+                          rpc_client/rpc_transport_np.c
+                          rpc_client/rpc_transport_sock.c
+                          rpc_client/rpc_transport_tstream.c
+                          librpc/rpc/dcerpc_helpers.c
+                          ''',
+                   deps='''
+                        ndr
+                        ndr-standard
+                        RPC_NDR_EPMAPPER
+                        NTLMSSP_COMMON
+                        COMMON_SCHANNEL
+                        LIBCLI_AUTH
+                        LIBTSOCKET
+                        gse
+                        dcerpc-binding
+                        libsmb
+                        ndr-table
+                        NETLOGON_CREDS_CLI
                    ''',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('gpo',
-                   source='''../libgpo/gpo_ldap.c
-                   ../libgpo/gpo_ini.c
-                   ../libgpo/gpo_util.c
-                   ../libgpo/gpo_fetch.c
-                   libgpo/gpo_filesync.c
-                   ../libgpo/gpo_sec.c
-                   libgpo/gpo_reg.c''',
-                   deps='talloc ads TOKEN_UTIL gpext auth',
+                   source='''
+                          ../libgpo/gpo_ldap.c
+                          ../libgpo/gpo_ini.c
+                          ../libgpo/gpo_util.c
+                          ../libgpo/gpo_fetch.c
+                          libgpo/gpo_filesync.c
+                          ../libgpo/gpo_sec.c
+                          libgpo/gpo_reg.c
+                          ''',
+                   deps='''
+                        talloc
+                        ads
+                        TOKEN_UTIL
+                        gpext
+                        auth
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('AVAHI',
-                    source='lib/avahi.c smbd/avahi_register.c',
-                    deps='avahi-common avahi-client',
+                    source='''
+                           lib/avahi.c
+                           smbd/avahi_register.c
+                           ''',
+                    deps='''
+                         avahi-common
+                         avahi-client
+                         ''',
                     enabled=bld.env.with_avahi)
 
 bld.SAMBA3_SUBSYSTEM('GROUPDB',
-                    source='groupdb/mapping.c groupdb/mapping_tdb.c',
+                    source='''
+                           groupdb/mapping.c
+                           groupdb/mapping_tdb.c
+                           ''',
                     deps='tdb')
 
 bld.SAMBA3_SUBSYSTEM('TLDAP',
-                    source='''lib/tldap.c
-                    lib/tldap_util.c
-                    lib/tldap_gensec_bind.c
-                    ''',
-                    deps='asn1util LIBTSOCKET samba3util')
+                    source='''
+                           lib/tldap.c
+                           lib/tldap_util.c
+                           lib/tldap_gensec_bind.c
+                           ''',
+                    deps='''
+                         asn1util
+                         LIBTSOCKET
+                         samba3util
+                         ''')
 
 # libpdb.so should not expose internal symbols that are only usable
 # to the statically linked modules that are merged into libpdb.
@@ -129,35 +162,48 @@ bld.SAMBA3_LIBRARY('samba-passdb',
                    pc_files=[],
                    public_headers_install=True,
                    public_headers='''
-                   include/passdb.h
-                   passdb/machine_sid.h
-                   passdb/lookup_sid.h''',
+                                  include/passdb.h
+                                  passdb/machine_sid.h
+                                  passdb/lookup_sid.h
+                                  ''',
                    abi_match=private_pdb_match,
                    abi_directory='passdb/ABI',
-                   vnum='0.25.0')
+                   vnum='0.27.0')
 
 bld.SAMBA3_SUBSYSTEM('pdb',
-                   source='''passdb/pdb_get_set.c
-                   passdb/passdb.c
-                   lib/util_wellknown.c
-                   lib/util_builtin.c
-                   passdb/pdb_compat.c
-                   lib/util_sid_passdb.c
-                   lib/util_unixsids.c
-                   passdb/lookup_sid.c
-                   passdb/login_cache.c
-                   passdb/account_pol.c
-                   lib/privileges.c
-                   lib/util_nscd.c
-                   lib/winbind_util.c
-                   passdb/pdb_util.c
-                   passdb/pdb_interface.c
-                   passdb/pdb_secrets.c
-                   passdb/pdb_unixid.c''',
-                   deps='secrets3 GROUPDB SERVER_MUTEX wbclient LIBCLI_AUTH flag_mapping samba-credentials')
+                   source='''
+                          passdb/pdb_get_set.c
+                          passdb/passdb.c
+                          lib/util_wellknown.c
+                          lib/util_builtin.c
+                          passdb/pdb_compat.c
+                          lib/util_sid_passdb.c
+                          lib/util_unixsids.c
+                          passdb/lookup_sid.c
+                          passdb/login_cache.c
+                          passdb/account_pol.c
+                          lib/privileges.c
+                          lib/util_nscd.c
+                          lib/winbind_util.c
+                          passdb/pdb_util.c
+                          passdb/pdb_interface.c
+                          passdb/pdb_secrets.c
+                          passdb/pdb_unixid.c''',
+                   deps='''
+                        secrets3
+                        GROUPDB
+                        SERVER_MUTEX
+                        wbclient
+                        LIBCLI_AUTH
+                        flag_mapping
+                        samba-credentials
+                        ''')
 
 bld.SAMBA3_LIBRARY('smbldaphelper',
-                   source='passdb/pdb_ldap_schema.c passdb/pdb_ldap_util.c',
+                   source='''
+                          passdb/pdb_ldap_schema.c
+                          passdb/pdb_ldap_util.c
+                          ''',
                    deps='smbldap secrets3',
                    allow_undefined_symbols=True,
                    enabled=bld.CONFIG_SET('HAVE_LDAP'),
@@ -167,22 +213,6 @@ bld.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
                      source='lib/server_mutex.c',
                      deps='talloc')
 
-bld.SAMBA3_SUBSYSTEM('param',
-                   source='''param/loadparm.c
-                   lib/sharesec.c
-                   lib/ldap_debug_handler.c
-                   lib/util_names.c''',
-                   deps='''samba-util
-                   PARAM_UTIL
-                   ldap
-                   lber
-                   LOADPARM_CTX
-                   samba3core
-                   smbconf
-                   param_local.h
-                   param_global.h
-                   cups''')
-
 # this includes only the low level parse code, not stuff
 # that requires knowledge of security contexts
 bld.SAMBA3_SUBSYSTEM('REG_PARSE_PRS',
@@ -196,43 +226,61 @@ bld.SAMBA3_SUBSYSTEM('REG_API_REGF',
                     source='registry/reg_api_regf.c',
                     deps='samba-util')
 
-bld.SAMBA3_LIBRARY('smbregistry',
-                   source='''registry/reg_api.c
-                   registry/reg_dispatcher.c
-                   registry/reg_cachehook.c
-                   registry/reg_objects.c
-                   registry/reg_util_internal.c
-                   lib/util_nttoken.c
-                   registry/reg_backend_db.c
-                   registry/reg_parse_internal.c
-                   lib/cbuf.c
-                   lib/srprs.c
-                   registry/reg_init_basic.c''',
-                   deps='''smbd_shim tdb-wrap3 NDR_SECURITY util_tdb talloc
-                   replace util_reg samba-util samba-security
-                   errors3 dbwrap samba3-util''',
-                   allow_undefined_symbols=True,
-                   private_library=True)
+# Do not link against this use 'smbconf'
+bld.SAMBA3_SUBSYSTEM('SMBREGISTRY',
+                   source='''
+                          registry/reg_api.c
+                          registry/reg_dispatcher.c
+                          registry/reg_cachehook.c
+                          registry/reg_objects.c
+                          registry/reg_util_internal.c
+                          lib/util_nttoken.c
+                          registry/reg_backend_db.c
+                          registry/reg_parse_internal.c
+                          lib/srprs.c
+                          registry/reg_init_basic.c
+                          ''',
+                   deps='''
+                        smbd_shim
+                        tdb-wrap3
+                        NDR_SECURITY
+                        util_tdb
+                        talloc
+                        replace
+                        util_reg
+                        samba-util
+                        samba-security
+                        errors3
+                        dbwrap
+                        samba3-util
+                        ''')
 
+# Do not link against this use 'smbconf'
 bld.SAMBA3_SUBSYSTEM('REG_SMBCONF',
-                    source='''registry/reg_backend_smbconf.c
-                    registry/reg_init_smbconf.c
-                    registry/reg_util_token.c
-                    registry/reg_api_util.c''',
-                    deps='smbregistry')
+                    source='''
+                           registry/reg_backend_smbconf.c
+                           registry/reg_init_smbconf.c
+                           registry/reg_util_token.c
+                           registry/reg_api_util.c
+                           ''',
+                    deps='SMBREGISTRY')
 
 bld.SAMBA3_SUBSYSTEM('REG_FULL',
-                    source='''registry/reg_backend_printing.c
-                    registry/reg_backend_shares.c
-                    registry/reg_backend_netlogon_params.c
-                    registry/reg_backend_prod_options.c
-                    registry/reg_backend_tcpip_params.c
-                    registry/reg_backend_hkpt_params.c
-                    registry/reg_backend_current_version.c
-                    registry/reg_backend_perflib.c
-                    registry/reg_init_full.c
-                    registry/reg_perfcount.c''',
-                    deps='REG_SMBCONF tdb-wrap3')
+                    source='''
+                           registry/reg_backend_printing.c
+                           registry/reg_backend_shares.c
+                           registry/reg_backend_netlogon_params.c
+                           registry/reg_backend_prod_options.c
+                           registry/reg_backend_tcpip_params.c
+                           registry/reg_backend_hkpt_params.c
+                           registry/reg_backend_current_version.c
+                           registry/reg_backend_perflib.c
+                           registry/reg_init_full.c
+                           registry/reg_perfcount.c''',
+                    deps='''
+                         smbconf
+                         tdb-wrap3
+                         ''')
 
 bld.SAMBA3_LIBRARY('popt_samba3',
                    source='lib/popt_common.c',
@@ -249,22 +297,34 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
                      public_deps='krb5samba asn1util k5crypto gssapi LIBTSOCKET CLDAP LIBNMB')
 
 bld.SAMBA3_SUBSYSTEM('samba3util',
-                   source='''lib/system.c
-                   lib/sendfile.c
-                   lib/recvfile.c
-                   lib/time.c
-                   lib/util_sid.c
-                   lib/util_specialsids.c
-                   lib/util_file.c
-                   lib/util.c
-                   lib/util_path.c
-                   lib/util_procid.c
-                   lib/util_sock.c
-                   lib/util_tsock.c
-                   lib/util_transfer_file.c
-                   lib/sys_popen.c
-                   lib/sock_exec.c''',
-                   deps='ndr LIBTSOCKET samba-security NDR_SECURITY samba-util util_tdb sys_rw iov_buf')
+                   source='''
+                          lib/system.c
+                          lib/sendfile.c
+                          lib/recvfile.c
+                          lib/time.c
+                          lib/util_sid.c
+                          lib/util_specialsids.c
+                          lib/util_file.c
+                          lib/util.c
+                          lib/util_path.c
+                          lib/util_procid.c
+                          lib/util_sock.c
+                          lib/util_tsock.c
+                          lib/util_transfer_file.c
+                          lib/sys_popen.c
+                          lib/sock_exec.c
+                          ''',
+                   deps='''
+                        CHARSET3
+                        ndr
+                        LIBTSOCKET
+                        samba-security
+                        NDR_SECURITY
+                        samba-util
+                        util_tdb
+                        sys_rw
+                        iov_buf
+                        ''')
 
 if bld.env.with_ctdb:
     SAMBA_CLUSTER_SUPPORT_SOURCES='''
@@ -295,14 +355,28 @@ bld.SAMBA3_LIBRARY('samba-cluster-support',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('TDB_LIB',
-                     source='''lib/dbwrap/dbwrap_open.c
-                     lib/dbwrap/dbwrap_watch.c
-                     lib/g_lock.c''',
-                     deps='dbwrap samba-cluster-support')
+                     source='''
+                            lib/dbwrap/dbwrap_open.c
+                            lib/dbwrap/dbwrap_watch.c
+                            lib/g_lock.c
+                            ''',
+                     deps='''
+                          dbwrap
+                          samba-cluster-support
+                          ''')
 
 bld.SAMBA3_LIBRARY('messages_dgm',
-                   source='''lib/messages_dgm.c lib/messages_dgm_ref.c''',
-                   deps='''talloc samba-debug PTHREADPOOL msghdr genrand''',
+                   source='''
+                          lib/messages_dgm.c
+                          lib/messages_dgm_ref.c
+                          ''',
+                   deps='''
+                        talloc
+                        samba-debug
+                        PTHREADPOOL
+                        msghdr
+                        genrand
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('messages_util',
@@ -311,41 +385,43 @@ bld.SAMBA3_LIBRARY('messages_util',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('samba3core',
-                   source='''lib/messages.c
-                   lib/util_cluster.c
-                   lib/id_cache.c
-                   lib/talloc_dict.c
-                   lib/serverid.c
-                   lib/server_id_watch.c
-                   lib/server_id_db_util.c
-                   lib/addrchange.c
-                   ../lib/util/debug_s3.c
-                   lib/dumpcore.c
-                   lib/interface.c
-                   lib/username.c
-                   lib/access.c lib/smbrun.c
-                   lib/wins_srv.c
-                   lib/substitute.c
-                   lib/substitute_generic.c
-                   lib/ms_fnmatch.c
-                   lib/tallocmsg.c
-                   lib/dmallocmsg.c
-                   intl/lang_tdb.c
-                   lib/gencache.c
-                   lib/util_event.c
-                   lib/server_contexts.c
-                   lib/server_prefork.c
-                   lib/server_prefork_util.c
-                   lib/ldap_escape.c
-                   lib/fncall.c
-                   libads/krb5_errs.c
-                   lib/system_smbd.c
-                   lib/audit.c
-                   lib/tevent_wait.c
-                   lib/idmap_cache.c
-                   lib/util_ea.c
-                   lib/background.c
-                   lib/cleanupdb.c''',
+                   source='''
+                          lib/messages.c
+                          lib/util_cluster.c
+                          lib/id_cache.c
+                          lib/talloc_dict.c
+                          lib/serverid.c
+                          lib/server_id_watch.c
+                          lib/server_id_db_util.c
+                          lib/addrchange.c
+                          ../lib/util/debug_s3.c
+                          lib/dumpcore.c
+                          lib/interface.c
+                          lib/username.c
+                          lib/smbrun.c
+                          lib/wins_srv.c
+                          lib/substitute.c
+                          lib/substitute_generic.c
+                          lib/ms_fnmatch.c
+                          lib/tallocmsg.c
+                          lib/dmallocmsg.c
+                          intl/lang_tdb.c
+                          lib/gencache.c
+                          lib/util_event.c
+                          lib/server_contexts.c
+                          lib/server_prefork.c
+                          lib/server_prefork_util.c
+                          lib/ldap_escape.c
+                          lib/fncall.c
+                          libads/krb5_errs.c
+                          lib/system_smbd.c
+                          lib/audit.c
+                          lib/tevent_wait.c
+                          lib/idmap_cache.c
+                          lib/util_ea.c
+                          lib/background.c
+                          lib/cleanupdb.c
+                          ''',
                    deps='''
                         samba3util
                         LIBTSOCKET
@@ -354,9 +430,8 @@ bld.SAMBA3_SUBSYSTEM('samba3core',
                         UTIL_PW
                         SAMBA_VERSION
                         PTHREADPOOL
-                        POLL_FUNCS_TEVENT
                         interfaces
-                        param
+                        smbconf
                         dbwrap
                         samba3-util
                         errors3
@@ -364,7 +439,9 @@ bld.SAMBA3_SUBSYSTEM('samba3core',
                         messages_util
                         messages_dgm
                         talloc_report
-                        TDB_LIB''')
+                        access
+                        TDB_LIB
+                        ''')
 
 bld.SAMBA3_LIBRARY('smbd_shim',
                    source='''lib/smbd_shim.c''',
@@ -376,41 +453,44 @@ bld.SAMBA3_SUBSYSTEM('auth_generic',
                     deps='gse gensec')
 
 bld.SAMBA3_LIBRARY('libsmb',
-                   source='''libsmb/clientgen.c
-                   libsmb/cliconnect.c
-                   libsmb/clifile.c
-                   libsmb/clispnego.c
-                   libsmb/clirap.c
-                   libsmb/clierror.c
-                   libsmb/climessage.c
-                   libsmb/clireadwrite.c
-                   libsmb/clilist.c
-                   libsmb/cliprint.c
-                   libsmb/clitrans.c
-                   libsmb/clisecdesc.c
-                   libsmb/clidgram.c
-                   libsmb/clistr.c
-                   libsmb/cliquota.c
-                   libsmb/clifsinfo.c
-                   libsmb/clidfs.c
-                   libsmb/clioplock.c
-                   libsmb/clirap2.c
-                   libsmb/async_smb.c
-                   libsmb/reparse_symlink.c
-                   libsmb/clisymlink.c
-                   libsmb/smbsock_connect.c
-                   libsmb/cli_smb2_fnum.c''',
+                   source='''
+                          libsmb/clientgen.c
+                          libsmb/cliconnect.c
+                          libsmb/clifile.c
+                          libsmb/clispnego.c
+                          libsmb/clirap.c
+                          libsmb/clierror.c
+                          libsmb/climessage.c
+                          libsmb/clireadwrite.c
+                          libsmb/clilist.c
+                          libsmb/cliprint.c
+                          libsmb/clitrans.c
+                          libsmb/clisecdesc.c
+                          libsmb/clidgram.c
+                          libsmb/clistr.c
+                          libsmb/cliquota.c
+                          libsmb/clifsinfo.c
+                          libsmb/clidfs.c
+                          libsmb/clioplock.c
+                          libsmb/clirap2.c
+                          libsmb/async_smb.c
+                          libsmb/reparse_symlink.c
+                          libsmb/clisymlink.c
+                          libsmb/smbsock_connect.c
+                          libsmb/cli_smb2_fnum.c
+                          ''',
                    deps='''
-                   auth_generic
-                   CLDAP
-                   LIBNMB
-                   SPNEGO_PARSE
-                   LIBTSOCKET
-                   KRBCLIENT
-                   NDR_IOCTL
-                   cli_smb_common
-                   util_cmdline
-                   tevent''',
+                        auth_generic
+                        CLDAP
+                        LIBNMB
+                        SPNEGO_PARSE
+                        LIBTSOCKET
+                        KRBCLIENT
+                        NDR_IOCTL
+                        cli_smb_common
+                        util_cmdline
+                        tevent
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('CLDAP',
@@ -421,39 +501,60 @@ bld.SAMBA3_SUBSYSTEM('CLDAP',
 # PLEASE DO NOT make it depend on high level libraries like PDB, if you are
 # doing that your design is wrong and needs changing. -SSS
 bld.SAMBA3_LIBRARY('secrets3',
-                   source='''passdb/secrets.c
-                   passdb/machine_account_secrets.c
-                   passdb/machine_sid.c
-                   passdb/secrets_lsa.c''',
-                   deps='NDR_SECRETS param samba3util dbwrap',
+                   source='''
+                          passdb/secrets.c
+                          passdb/machine_account_secrets.c
+                          passdb/machine_sid.c
+                          passdb/secrets_lsa.c
+                          ''',
+                   deps='''
+                        NDR_SECRETS
+                        smbconf
+                        samba3util
+                        dbwrap
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('smbldap',
                     source='lib/smbldap.c',
-                    deps='ldap lber samba-util param',
+                    deps='ldap lber samba-util smbconf',
                     enabled=bld.CONFIG_SET("HAVE_LDAP"),
                     private_library=False,
                     abi_directory='lib/ABI',
                     abi_match='smbldap_*',
                     pc_files=[],
-                    vnum='0',
+                    vnum='2',
                     public_headers='include/smbldap.h include/smb_ldap.h')
 
 bld.SAMBA3_LIBRARY('ads',
-                   source='''libads/ldap.c
-                   libads/sasl.c
-                   libads/sasl_wrapping.c
-                   libads/krb5_setpw.c
-                   libads/kerberos_util.c
-                   libads/ldap_user.c
-                   libads/ads_struct.c
-                   libads/kerberos_keytab.c
-                   libads/disp_sec.c
-                   libads/ldap_utils.c
-                   libads/ldap_schema.c
-                   libads/util.c
-                   libads/ndr.c''',
-                   deps='cli-ldap-common krb5samba ldap lber KRBCLIENT param LIBNMB libsmb DCUTIL smbldap',
+                   source='''
+                          libads/ldap.c
+                          libads/sasl.c
+                          libads/sasl_wrapping.c
+                          libads/krb5_setpw.c
+                          libads/kerberos_util.c
+                          libads/ldap_user.c
+                          libads/ads_struct.c
+                          libads/kerberos_keytab.c
+                          libads/disp_sec.c
+                          libads/ldap_utils.c
+                          libads/ldap_schema.c
+                          libads/util.c
+                          libads/ndr.c
+                          ''',
+                   deps='''
+                        cli-ldap-common
+                        krb5samba
+                        ldap
+                        lber
+                        KRBCLIENT
+                        smbconf
+                        LIBNMB
+                        libsmb
+                        DCUTIL
+                        smbldap
+                        trusts_util
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
@@ -464,23 +565,45 @@ bld.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
                     source='libads/ldap_printer.c',
                     deps='samba-util krb5samba')
 
+# Only smbconf should link against this subsystem, else we will create
+# a circular dependency.
+bld.SAMBA3_SUBSYSTEM('SMBCONF_PARAM',
+                   source='''
+                          param/loadparm.c
+                          lib/sharesec.c
+                          lib/ldap_debug_handler.c
+                          lib/util_names.c
+                          ''',
+                   deps='''
+                        samba-util
+                        PARAM_UTIL
+                        ldap
+                        lber
+                        LOADPARM_CTX
+                        samba3core
+                        param_local.h
+                        param_global.h
+                        cups
+                        ''')
+
 bld.SAMBA3_LIBRARY('smbconf',
-                   source='''lib/smbconf/smbconf_init.c
-                   lib/smbconf/smbconf_reg.c''',
+                   source='''
+                          lib/smbconf/smbconf_init.c
+                          lib/smbconf/smbconf_reg.c
+                          ''',
                    deps='''
-                   CHARSET3
-                   LIBSMBCONF
-                   REG_SMBCONF
-                   SAMBA_VERSION
-                   cap
-                   charset
-                   cli_smb_common
-                   errors3
-                   param
-                   samba-util
-                   smbregistry
-                   talloc
-                   util_reg''',
+                        LIBSMBCONF
+                        REG_SMBCONF
+                        SAMBA_VERSION
+                        cap
+                        charset
+                        cli_smb_common
+                        errors3
+                        SMBCONF_PARAM
+                        samba-util
+                        talloc
+                        util_reg
+                        ''',
                    public_headers='../lib/smbconf/smbconf.h',
                    pc_files=[],
                    vnum='0')
@@ -514,124 +637,124 @@ if bld.CONFIG_SET('SAMBA_FAM_LIBS'):
 
 bld.SAMBA3_LIBRARY('smbd_base',
                    source='''
-                   smbd/server_reload.c
-                   smbd/files.c
-                   smbd/connection.c
-                   smbd/utmp.c
-                   smbd/session.c
-                   smbd/dfree.c
-                   smbd/dir.c
-                   smbd/password.c
-                   smbd/conn_msg.c
-                   smbd/conn_idle.c
-                   smbd/share_access.c
-                   smbd/fileio.c
-                   smbd/ipc.c
-                   smbd/lanman.c
-                   smbd/negprot.c
-                   smbd/message.c
-                   smbd/nttrans.c
-                   smbd/pipes.c
-                   smbd/reply.c
-                   smbd/sesssetup.c
-                   smbd/trans2.c
-                   smbd/uid.c
-                   smbd/dosmode.c
-                   smbd/filename.c
-                   smbd/open.c
-                   smbd/close.c
-                   smbd/blocking.c
-                   smbd/sec_ctx.c
-                   smbd/srvstr.c
-                   smbd/vfs.c
-                   smbd/perfcount.c
-                   smbd/statcache.c
-                   smbd/seal.c
-                   smbd/posix_acls.c
-                   lib/sysacls.c
-                   smbd/process.c
-                   smbd/service.c
-                   smbd/error.c
-                   printing/printspoolss.c
-                   printing/spoolssd.c
-                   lib/sessionid_tdb.c
-                   lib/conn_tdb.c
-                   smbd/fake_file.c
-                   smbd/quotas.c
-                   smbd/ntquotas.c
-                   smbd/msdfs.c
-                   smbd/aio.c smbd/statvfs.c
-                   smbd/dmapi.c
-                   smbd/signing.c
-                   smbd/file_access.c
-                   smbd/dnsregister.c smbd/globals.c
-                   smbd/smb2_server.c
-                   smbd/smb2_glue.c
-                   smbd/smb2_negprot.c
-                   smbd/smb2_sesssetup.c
-                   smbd/smb2_tcon.c
-                   smbd/smb2_create.c
-                   smbd/smb2_close.c
-                   smbd/smb2_flush.c
-                   smbd/smb2_read.c
-                   smbd/smb2_write.c
-                   smbd/smb2_lock.c
-                   smbd/smb2_ioctl.c
-                   smbd/smb2_ioctl_dfs.c
-                   smbd/smb2_ioctl_filesys.c
-                   smbd/smb2_ioctl_named_pipe.c
-                   smbd/smb2_ioctl_network_fs.c
-                   smbd/smb2_keepalive.c
-                   smbd/smb2_query_directory.c
-                   smbd/smb2_notify.c
-                   smbd/smb2_getinfo.c
-                   smbd/smb2_setinfo.c
-                   smbd/smb2_break.c
-                   smbd/smbXsrv_version.c
-                   smbd/smbXsrv_client.c
-                   smbd/smbXsrv_session.c
-                   smbd/smbXsrv_tcon.c
-                   smbd/smbXsrv_open.c
-                   smbd/server_exit.c
-                   smbd/durable.c
-                   smbd/scavenger.c
-                   smbd/mangle.c
-                   smbd/mangle_hash.c
-                   smbd/mangle_hash2.c
-                   smbd/oplock.c
-                   smbd/oplock_irix.c
-                   smbd/oplock_linux.c
-                   smbd/notify.c
-                   smbd/notify_msg.c
-                   smbd/build_options.c''' + NOTIFY_SOURCES,
+                          smbd/server_reload.c
+                          smbd/files.c
+                          smbd/connection.c
+                          smbd/utmp.c
+                          smbd/session.c
+                          smbd/dfree.c
+                          smbd/dir.c
+                          smbd/password.c
+                          smbd/conn_msg.c
+                          smbd/conn_idle.c
+                          smbd/share_access.c
+                          smbd/fileio.c
+                          smbd/ipc.c
+                          smbd/lanman.c
+                          smbd/negprot.c
+                          smbd/message.c
+                          smbd/nttrans.c
+                          smbd/pipes.c
+                          smbd/reply.c
+                          smbd/sesssetup.c
+                          smbd/trans2.c
+                          smbd/uid.c
+                          smbd/dosmode.c
+                          smbd/filename.c
+                          smbd/open.c
+                          smbd/close.c
+                          smbd/blocking.c
+                          smbd/sec_ctx.c
+                          smbd/srvstr.c
+                          smbd/vfs.c
+                          smbd/perfcount.c
+                          smbd/statcache.c
+                          smbd/seal.c
+                          smbd/posix_acls.c
+                          lib/sysacls.c
+                          smbd/process.c
+                          smbd/service.c
+                          smbd/error.c
+                          printing/printspoolss.c
+                          lib/sessionid_tdb.c
+                          lib/conn_tdb.c
+                          smbd/fake_file.c
+                          smbd/quotas.c
+                          smbd/ntquotas.c
+                          smbd/msdfs.c
+                          smbd/aio.c smbd/statvfs.c
+                          smbd/dmapi.c
+                          smbd/signing.c
+                          smbd/file_access.c
+                          smbd/dnsregister.c smbd/globals.c
+                          smbd/smb2_server.c
+                          smbd/smb2_glue.c
+                          smbd/smb2_negprot.c
+                          smbd/smb2_sesssetup.c
+                          smbd/smb2_tcon.c
+                          smbd/smb2_create.c
+                          smbd/smb2_close.c
+                          smbd/smb2_flush.c
+                          smbd/smb2_read.c
+                          smbd/smb2_write.c
+                          smbd/smb2_lock.c
+                          smbd/smb2_ioctl.c
+                          smbd/smb2_ioctl_dfs.c
+                          smbd/smb2_ioctl_filesys.c
+                          smbd/smb2_ioctl_named_pipe.c
+                          smbd/smb2_ioctl_network_fs.c
+                          smbd/smb2_keepalive.c
+                          smbd/smb2_query_directory.c
+                          smbd/smb2_notify.c
+                          smbd/smb2_getinfo.c
+                          smbd/smb2_setinfo.c
+                          smbd/smb2_break.c
+                          smbd/smbXsrv_version.c
+                          smbd/smbXsrv_client.c
+                          smbd/smbXsrv_session.c
+                          smbd/smbXsrv_tcon.c
+                          smbd/smbXsrv_open.c
+                          smbd/server_exit.c
+                          smbd/durable.c
+                          smbd/scavenger.c
+                          smbd/mangle.c
+                          smbd/mangle_hash.c
+                          smbd/mangle_hash2.c
+                          smbd/oplock.c
+                          smbd/oplock_irix.c
+                          smbd/oplock_linux.c
+                          smbd/notify.c
+                          smbd/notify_msg.c
+                          smbd/build_options.c
+                          ''' + NOTIFY_SOURCES,
                    deps='''
-                   talloc
-                   tevent
-                   pdb
-                   libsmb
-                   msrpc3
-                   vfs
-                   vfs_default
-                   vfs_posixacl
-                  inotify
-                   popt_samba3
-                   samba3core
-                   smbd_conn
-                   param_service
-                   AVAHI
-                   PRINTBASE
-                   PROFILE
-                   LOCKING
-                   LIBADS_SERVER
-                   LIBAFS
-                   RPC_SERVICE
-                   NDR_SMBXSRV
-                   LEASES_DB
-                   sysquotas
-                   NDR_SMB_ACL
-                   netapi
-                   NDR_IOCTL
-                   notifyd
+                        talloc
+                        tevent
+                        pdb
+                        libsmb
+                        msrpc3
+                        vfs
+                        vfs_default
+                        vfs_posixacl
+                        inotify
+                        samba3core
+                        smbd_conn
+                        param_service
+                        AVAHI
+                        PRINTBASE
+                        PROFILE
+                        LOCKING
+                        LIBADS_SERVER
+                        LIBAFS
+                        RPC_SERVICE
+                        NDR_SMBXSRV
+                        LEASES_DB
+                        LEASES_UTIL
+                        sysquotas
+                        NDR_SMB_ACL
+                        netapi
+                        NDR_IOCTL
+                        notifyd
                    ''' +
                    bld.env['dmapi_lib'] +
                    bld.env['legacy_quota_libs'] +
@@ -639,21 +762,29 @@ bld.SAMBA3_LIBRARY('smbd_base',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('LOCKING',
-                    source='''locking/locking.c
-                    locking/brlock.c
-                    locking/posix.c
-                    locking/share_mode_lock.c''',
+                    source='''
+                           locking/locking.c
+                           locking/brlock.c
+                           locking/posix.c
+                           locking/share_mode_lock.c
+                           ''',
                     deps='''
-                    tdb
-                    talloc
-                    LEASES_DB
-                    NDR_OPEN_FILES
-                    FNAME_UTIL''')
+                         tdb
+                         talloc
+                         LEASES_DB
+                         LEASES_UTIL
+                         NDR_OPEN_FILES
+                         FNAME_UTIL
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('LEASES_DB',
                     source='locking/leases_db.c',
                     deps='NDR_LEASES_DB')
 
+bld.SAMBA3_SUBSYSTEM('LEASES_UTIL',
+                    source='locking/leases_util.c',
+                    deps='NDR_OPEN_FILES')
+
 if bld.CONFIG_GET("WITH_PROFILE"):
     bld.SAMBA3_SUBSYSTEM('PROFILE',
                          source='profile/profile.c',
@@ -664,39 +795,65 @@ else:
                          deps='')
 
 bld.SAMBA3_SUBSYSTEM('PRINTBASE',
-                    source='''printing/notify.c printing/printing_db.c''',
-                    deps='samba-util tdb')
+                    source='''
+                           printing/notify.c
+                           printing/printing_db.c
+                           ''',
+                    deps='''
+                         samba-util
+                         tdb
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('PRINTBACKEND',
-                    source='''printing/printing.c
-                    printing/nt_printing.c
-                    printing/nt_printing_tdb.c
-                    printing/nt_printing_migrate_internal.c
-                    printing/nt_printing_ads.c
-                    printing/queue_process.c''',
-                    deps='PRINTBASE LIBADS_PRINTER tdb printing_migrate')
+                    source='''
+                           printing/printing.c
+                           printing/nt_printing.c
+                           printing/nt_printing_tdb.c
+                           printing/nt_printing_migrate_internal.c
+                           printing/nt_printing_ads.c
+                           printing/queue_process.c
+                           ''',
+                    deps='''
+                         PRINTBASE
+                         LIBADS_PRINTER
+                         tdb
+                         printing_migrate
+                         SPOOLSSD
+                         ''')
 
 bld.SAMBA3_LIBRARY('printing_migrate',
-                    source='printing/nt_printing_migrate.c rpc_client/cli_winreg_spoolss.c printing/nt_printing_os2.c',
-                    deps='NDR_NTPRINTING cli_spoolss RPC_NDR_WINREG LIBCLI_WINREG param',
+                    source='''
+                           printing/nt_printing_migrate.c
+                           rpc_client/cli_winreg_spoolss.c
+                           printing/nt_printing_os2.c
+                           ''',
+                    deps='''
+                         NDR_NTPRINTING
+                         cli_spoolss
+                         RPC_NDR_WINREG
+                         LIBCLI_WINREG
+                         smbconf
+                         ''',
                     private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('PRINTING',
-                    source='''printing/pcap.c
-                    printing/print_svid.c
-                    printing/print_aix.c
-                    printing/print_cups.c
-                    printing/print_generic.c
-                    printing/lpq_parse.c
-                    printing/load.c
-                    printing/print_standard.c
-                    printing/print_iprint.c
-                    printing/printer_list.c''',
-                    deps='NDR_PRINTCAP tdb cups')
-
-bld.SAMBA3_SUBSYSTEM('PASSWD_UTIL',
-                    source='utils/passwd_util.c',
-                    deps='samba-util')
+                    source='''
+                           printing/pcap.c
+                           printing/print_svid.c
+                           printing/print_aix.c
+                           printing/print_cups.c
+                           printing/print_generic.c
+                           printing/lpq_parse.c
+                           printing/load.c
+                           printing/print_standard.c
+                           printing/print_iprint.c
+                           printing/printer_list.c
+                           ''',
+                    deps='''
+                         NDR_PRINTCAP
+                         tdb
+                         cups
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('FNAME_UTIL',
                     source='lib/filename_util.c',
@@ -713,51 +870,79 @@ bld.SAMBA3_LIBRARY('net_keytab',
 
 
 bld.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
-                    source='''libnet/libnet_dssync.c
-                    libnet/libnet_dssync_passdb.c
-                    libnet/libnet_dssync_keytab.c''',
-                    deps='LIBNET RPC_NDR_DRSUAPI')
+                    source='''
+                           libnet/libnet_dssync.c
+                           libnet/libnet_dssync_passdb.c
+                           libnet/libnet_dssync_keytab.c
+                           ''',
+                    deps='''
+                         LIBNET
+                         RPC_NDR_DRSUAPI
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('LIBNET_SAMSYNC',
-                    source='''libnet/libnet_samsync.c
-                    libnet/libnet_samsync_ldif.c
-                    libnet/libnet_samsync_passdb.c
-                    libnet/libnet_samsync_display.c
-                    libnet/libnet_samsync_keytab.c''',
-                    deps='LIBNET LIBCLI_SAMSYNC')
+                    source='''
+                           libnet/libnet_samsync.c
+                           libnet/libnet_samsync_ldif.c
+                           libnet/libnet_samsync_passdb.c
+                           libnet/libnet_samsync_display.c
+                           libnet/libnet_samsync_keytab.c
+                           ''',
+                    deps='''
+                         LIBNET
+                         LIBCLI_SAMSYNC
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
                     source='lib/eventlog/eventlog.c',
                     deps='NDR_EVENTLOG tdb')
 
 bld.SAMBA3_SUBSYSTEM('LIBNMB',
-                     source='''libsmb/unexpected.c
-                     libsmb/namecache.c
-                     libsmb/nmblib.c
-                     libsmb/namequery.c
-                     libsmb/conncache.c
-                     libads/sitename_cache.c''',
-                     deps='LIBTSOCKET samba3util addns lmhosts resolv')
+                     source='''
+                            libsmb/unexpected.c
+                            libsmb/namecache.c
+                            libsmb/nmblib.c
+                            libsmb/namequery.c
+                            libsmb/conncache.c
+                            libads/sitename_cache.c
+                            ''',
+                     deps='''
+                          LIBTSOCKET
+                          samba3util
+                          addns
+                          lmhosts
+                          resolv
+                          ''')
 
 bld.SAMBA3_SUBSYSTEM('SERVICES',
-                    source='''services/svc_spoolss.c
-                    services/svc_rcinit.c
-                    services/svc_winreg_glue.c
-                    services/svc_netlogon.c
-                    services/svc_winreg.c
-                    services/svc_wins.c''',
+                    source='''
+                           services/svc_spoolss.c
+                           services/svc_rcinit.c
+                           services/svc_winreg_glue.c
+                           services/svc_netlogon.c
+                           services/svc_winreg.c
+                           services/svc_wins.c
+                           ''',
                     deps='samba-util')
 
 bld.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
-                    source='''auth/pampass.c auth/pass_check.c''',
-                    deps='pam PAM_ERRORS')
+                    source='''
+                           auth/pampass.c
+                           auth/pass_check.c
+                           ''',
+                    deps='''
+                         pam
+                         PAM_ERRORS
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('PASSCHANGE',
                     source='libsmb/passchange.c',
-                    deps='''LIBCLI_SAMR
-                    INIT_LSA
-                    msrpc3
-                    krb5samba''')
+                    deps='''
+                         LIBCLI_SAMR
+                         INIT_LSA
+                         msrpc3
+                         krb5samba
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
                     source='lib/version.c',
@@ -765,17 +950,30 @@ bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
 
 bld.SAMBA3_SUBSYSTEM('SLCACHE',
                     source='libsmb/samlogon_cache.c',
-                    deps='samba-util tdb')
+                    deps='''
+                         samba-util
+                         tdb
+                         ''')
 
 bld.SAMBA3_SUBSYSTEM('DCUTIL',
-                    source='''libsmb/namequery_dc.c
-                    libsmb/trustdom_cache.c
-                    libsmb/dsgetdcname.c''',
-                    deps='ads msrpc3 libcli_lsa3')
+                    source='''
+                           libsmb/namequery_dc.c
+                           libsmb/trustdom_cache.c
+                           libsmb/dsgetdcname.c
+                           ''',
+                    deps='''
+                         ads
+                         msrpc3
+                         libcli_lsa3
+                         ''')
 
 bld.SAMBA3_LIBRARY('trusts_util',
                    source='libsmb/trusts_util.c',
-                   deps='libcli_netlogon3 msrpc3 samba-passdb',
+                   deps='''
+                        libcli_netlogon3
+                        msrpc3
+                        samba-passdb
+                        ''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('tdb-wrap3',
@@ -783,8 +981,19 @@ bld.SAMBA3_SUBSYSTEM('tdb-wrap3',
                     deps='talloc samba3-util')
 
 bld.SAMBA3_LIBRARY('samba3-util',
-                   source='''lib/util_sec.c lib/util_str.c lib/adt_tree.c lib/util_malloc.c lib/namearray.c lib/file_id.c''',
-                   deps='samba-util charset',
+                   source='''
+                          lib/util_sec.c
+                          lib/util_str.c
+                          lib/adt_tree.c
+                          lib/util_malloc.c
+                          lib/namearray.c
+                          lib/file_id.c
+                          lib/cbuf.c
+                          ''',
+                   deps='''
+                        samba-util
+                        charset
+                        ''',
                    private_library=True)
 
 bld.SAMBA_LIBRARY('xattr_tdb',
@@ -793,13 +1002,26 @@ bld.SAMBA_LIBRARY('xattr_tdb',
                   private_library=True)
 
 bld.SAMBA3_LIBRARY('CHARSET3',
-                    source='''lib/charcnv.c lib/fstring.c''',
-                    public_deps='ICONV_WRAPPER charset',
-                    deps='samba-util samba3-util',
+                    source='''
+                           lib/charcnv.c
+                           lib/fstring.c
+                           ''',
+                    public_deps='''
+                                ICONV_WRAPPER
+                                charset
+                                ''',
+                    deps='''
+                         samba-util
+                         samba3-util
+                         ''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('errors3',
-                     source='libsmb/errormap.c libsmb/smberr.c lib/errmap_unix.c',
+                     source='''
+                            libsmb/errormap.c
+                            libsmb/smberr.c
+                            lib/errmap_unix.c
+                            ''',
                      deps='samba-errors')
 
 bld.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
@@ -812,14 +1034,28 @@ bld.SAMBA3_LIBRARY('libcli_lsa3',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('libcli_netlogon3',
-                   source='rpc_client/cli_netlogon.c rpc_client/util_netlogon.c',
-                   deps='msrpc3 RPC_NDR_NETLOGON INIT_NETLOGON cliauth param NETLOGON_CREDS_CLI',
+                   source='''
+                          rpc_client/cli_netlogon.c
+                          rpc_client/util_netlogon.c
+                          ''',
+                   deps='''
+                        msrpc3
+                        RPC_NDR_NETLOGON
+                        INIT_NETLOGON
+                        cliauth
+                        smbconf
+                        NETLOGON_CREDS_CLI''',
                    private_library=True)
 
 bld.SAMBA3_LIBRARY('cli_spoolss',
-                   source='''rpc_client/cli_spoolss.c
-                   rpc_client/init_spoolss.c''',
-                   deps='RPC_NDR_SPOOLSS param secrets3',
+                   source='''
+                          rpc_client/cli_spoolss.c
+                          rpc_client/init_spoolss.c
+                          ''',
+                   deps='''
+                        RPC_NDR_SPOOLSS
+                        smbconf
+                        secrets3''',
                    private_library=True)
 
 bld.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
@@ -849,33 +1085,26 @@ bld.SAMBA3_SUBSYSTEM('INIT_SAMR',
 bld.SAMBA3_SUBSYSTEM('LIBLSA',
                      source='lib/lsa.c')
 
+bld.SAMBA3_SUBSYSTEM('SPOOLSSD',
+                    source='printing/spoolssd.c',
+                    deps='''
+                         samba-util
+                         RPC_SOCK_HELPER
+                         ''')
+
 ########################## BINARIES #################################
 
 bld.SAMBA3_BINARY('smbd/smbd',
                  source='smbd/server.c smbd/smbd_cleanupd.c',
-                 deps='smbd_base EPMD LSASD FSSD MDSSD',
-                 install_path='${SBINDIR}')
-
-bld.SAMBA3_BINARY('nmbd/nmbd',
-                 source='''nmbd/asyncdns.c nmbd/nmbd.c nmbd/nmbd_become_dmb.c
-                 nmbd/nmbd_become_lmb.c nmbd/nmbd_browserdb.c
-                 nmbd/nmbd_browsesync.c nmbd/nmbd_elections.c
-                 nmbd/nmbd_incomingdgrams.c nmbd/nmbd_incomingrequests.c
-                 nmbd/nmbd_lmhosts.c nmbd/nmbd_logonnames.c nmbd/nmbd_mynames.c
-                 nmbd/nmbd_namelistdb.c nmbd/nmbd_namequery.c
-                 nmbd/nmbd_nameregister.c nmbd/nmbd_namerelease.c
-                 nmbd/nmbd_nodestatus.c nmbd/nmbd_packets.c
-                 nmbd/nmbd_processlogon.c nmbd/nmbd_responserecordsdb.c
-                 nmbd/nmbd_sendannounce.c nmbd/nmbd_serverlistdb.c
-                 nmbd/nmbd_subnetdb.c nmbd/nmbd_winsproxy.c nmbd/nmbd_winsserver.c
-                 nmbd/nmbd_workgroupdb.c nmbd/nmbd_synclists.c''',
                  deps='''
-                 talloc
-                 tevent
-                 param
-                 libsmb
-                 popt_samba3
-                 ''',
+                      popt_samba3
+                      smbd_base
+                      EPMD
+                      LSASD
+                      FSSD
+                      MDSSD
+                      SPOOLSSD
+                      ''',
                  install_path='${SBINDIR}')
 
 
@@ -884,257 +1113,53 @@ bld.SAMBA3_SUBSYSTEM('TDB_VALIDATE',
                      deps='samba-util')
 
 
-bld.SAMBA3_BINARY('winbindd/winbindd',
-                 source='''winbindd/winbindd.c
-                 winbindd/winbindd_group.c
-                 winbindd/winbindd_util.c
-                 winbindd/winbindd_cache.c
-                 winbindd/winbindd_pam.c
-                 winbindd/winbindd_misc.c
-                 winbindd/winbindd_cm.c
-                 winbindd/winbindd_wins_byip.c
-                 winbindd/winbindd_wins_byname.c
-                 winbindd/winbindd_msrpc.c
-                 winbindd/winbindd_rpc.c
-                 winbindd/winbindd_reconnect.c
-                 winbindd/winbindd_reconnect_ads.c
-                 winbindd/winbindd_ads.c
-                 winbindd/winbindd_samr.c
-                 winbindd/winbindd_dual.c
-                 winbindd/winbindd_dual_ndr.c
-                 winbindd/winbindd_dual_srv.c
-                 winbindd/winbindd_async.c
-                 winbindd/winbindd_creds.c
-                 winbindd/winbindd_cred_cache.c
-                 winbindd/winbindd_ccache_access.c
-                 winbindd/winbindd_domain.c
-                 winbindd/winbindd_idmap.c
-                 winbindd/winbindd_locator.c
-                 winbindd/winbindd_ndr.c
-                 winbindd/wb_ping.c
-                 winbindd/wb_lookupsid.c
-                 winbindd/wb_lookupsids.c
-                 winbindd/wb_lookupname.c
-                 winbindd/wb_sids2xids.c
-                 winbindd/wb_xids2sids.c
-                 winbindd/wb_queryuser.c
-                 winbindd/wb_lookupuseraliases.c
-                 winbindd/wb_lookupusergroups.c
-                 winbindd/wb_getpwsid.c
-                 winbindd/wb_gettoken.c
-                 winbindd/wb_seqnum.c
-                 winbindd/wb_seqnums.c
-                 winbindd/wb_group_members.c
-                 winbindd/wb_getgrsid.c
-                 winbindd/wb_query_user_list.c
-                 winbindd/wb_query_group_list.c
-                 winbindd/wb_fill_pwent.c
-                 winbindd/wb_next_pwent.c
-                 winbindd/wb_next_grent.c
-                 winbindd/wb_dsgetdcname.c
-                 winbindd/winbindd_lookupsid.c
-                 winbindd/winbindd_lookupsids.c
-                 winbindd/winbindd_lookupname.c
-                 winbindd/winbindd_sids_to_xids.c
-                 winbindd/winbindd_xids_to_sids.c
-                 winbindd/winbindd_allocate_uid.c
-                 winbindd/winbindd_allocate_gid.c
-                 winbindd/winbindd_getpwsid.c
-                 winbindd/winbindd_getpwnam.c
-                 winbindd/winbindd_getpwuid.c
-                 winbindd/winbindd_getsidaliases.c
-                 winbindd/winbindd_getuserdomgroups.c
-                 winbindd/winbindd_getgroups.c
-                 winbindd/winbindd_show_sequence.c
-                 winbindd/winbindd_getgrgid.c
-                 winbindd/winbindd_getgrnam.c
-                 winbindd/winbindd_getusersids.c
-                 winbindd/winbindd_lookuprids.c
-                 winbindd/winbindd_setpwent.c
-                 winbindd/winbindd_getpwent.c
-                 winbindd/winbindd_endpwent.c
-                 winbindd/winbindd_setgrent.c
-                 winbindd/winbindd_getgrent.c
-                 winbindd/winbindd_endgrent.c
-                 winbindd/winbindd_dsgetdcname.c
-                 winbindd/winbindd_getdcname.c
-                 winbindd/winbindd_list_users.c
-                 winbindd/winbindd_list_groups.c
-                 winbindd/winbindd_check_machine_acct.c
-                 winbindd/winbindd_change_machine_acct.c
-                 winbindd/winbindd_irpc.c
-                 winbindd/winbindd_ping_dc.c
-                 winbindd/winbindd_pam_auth.c
-                 winbindd/winbindd_pam_logoff.c
-                 winbindd/winbindd_pam_chauthtok.c
-                 winbindd/winbindd_pam_auth_crap.c
-                 winbindd/winbindd_pam_chng_pswd_auth_crap.c''',
-                 deps='''
-                 talloc
-                 tevent
-                 pdb
-                 popt_samba3
-                 idmap
-                 ads
-                 msrpc3
-                 nss_info
-                 LIBAFS
-                 LIBADS_SERVER
-                 LIBCLI_SAMR
-                 SLCACHE
-                 RPC_NDR_DSSETUP
-                 RPC_NDR_WINBIND
-                 SRV_NDR_WINBIND
-                 RPC_SAMR
-                 RPC_LSARPC
-                 RPC_SERVER
-                 WB_REQTRANS
-                 TDB_VALIDATE
-                 MESSAGING
-                 LIBLSA
-                 ''',
-                 enabled=bld.env.build_winbind,
-                 install_path='${SBINDIR}')
-
 bld.SAMBA3_BINARY('client/smbclient',
-                 source='''client/client.c
-                 client/clitar.c
-                 client/dnsbrowse.c''',
-                 deps='''
-                 talloc
-                 popt_samba3
-                 param
-                 ndr-standard
-                 SMBREADLINE
-                 libsmb
-                 msrpc3
-                 RPC_NDR_SRVSVC
-                 cli_smb_common
-                archive
-                 ''')
-
-bld.SAMBA3_BINARY('net',
-                 source='''utils/net.c
-                 utils/net_ads.c
-                 utils/net_help.c
-                 utils/net_rap.c
-                 utils/net_rpc.c
-                 utils/net_rpc_samsync.c
-                 utils/net_time.c
-                 utils/net_lookup.c
-                 utils/net_cache.c
-                 utils/net_groupmap.c
-                 utils/net_idmap.c
-                 utils/net_idmap_check.c
-                 utils/interact.c
-                 utils/net_status.c
-                 utils/net_rpc_printer.c
-                 utils/net_rpc_rights.c
-                 utils/net_rpc_service.c
-                 utils/net_rpc_registry.c
-                 utils/net_usershare.c
-                 utils/netlookup.c
-                 utils/net_sam.c
-                 utils/net_rpc_shell.c
-                 utils/net_util.c
-                 utils/net_rpc_sh_acct.c
-                 utils/net_rpc_audit.c
-                 utils/net_dns.c
-                 utils/net_ads_gpo.c
-                 utils/net_conf.c
-                 utils/net_conf_util.c
-                 utils/net_join.c
-                 utils/net_user.c
-                 utils/net_group.c
-                 utils/net_file.c
-                 utils/net_registry.c
-                 utils/net_registry_check.c
-                 utils/net_dom.c
-                 utils/net_share.c
-                 utils/net_g_lock.c
-                 utils/net_serverid.c
-                 utils/net_eventlog.c
-                 utils/net_printing.c
-                 utils/net_rpc_trust.c
-                 utils/net_rpc_conf.c
-                 utils/net_afs.c
-                 utils/net_notify.c
-                 registry/reg_parse.c
-                 registry/reg_format.c
-                 registry/reg_import.c
-                 utils/net_registry_util.c
-                 utils/net_help_common.c''',
-                 deps='''
-                 talloc
-                 netapi
-                 addns
-                 samba_intl
-                 popt_samba3
-                 pdb
-                 libsmb
-                 param
-                 KRBCLIENT
-                 ndr-standard
-                 msrpc3
-                 gpo
-                 ads
-                 smbd_base
-                 LIBADS_SERVER
-                 LIBADS_PRINTER
-                 SMBREADLINE
-                 PASSWD_UTIL
-                 LIBNET
-                 LIBNET_DSSYNC
-                 LIBNET_SAMSYNC
-                 LIBEVENTLOG
-                 REGFIO
-                 NDR_NTPRINTING
-                 RPC_NDR_WINREG
-                 RPC_CLIENT_SCHANNEL
-                 LIBCLI_SAMR
-                 libcli_lsa3
-                 libcli_netlogon3
-                 cli_spoolss
-                 RPC_NDR_SRVSVC
-                 RPC_NDR_SVCCTL
-                 RPC_NDR_DSSETUP
-                 RPC_NDR_INITSHUTDOWN
-                 printing_migrate
-                 trusts_util
-                 IDMAP_AUTORID_TDB''')
-
-bld.SAMBA3_BINARY('profiles',
-                 source='utils/profiles.c',
+                 source='''
+                        client/client.c
+                        client/clitar.c
+                        client/dnsbrowse.c
+                        ''',
                  deps='''
-                 talloc
-                 popt_samba3
-                 param
-                 REGFIO''')
+                      talloc
+                      popt_samba3
+                      smbconf
+                      ndr-standard
+                      SMBREADLINE
+                      libsmb
+                      msrpc3
+                      RPC_NDR_SRVSVC
+                      cli_smb_common
+                      archive
+                      ''')
 
 bld.SAMBA3_BINARY('smbspool',
                  source='client/smbspool.c',
                  deps='''
-                 talloc
-                 popt_samba3
-                 param
-                 libsmb
-                 samba3core''')
+                      talloc
+                      popt_samba3
+                      smbconf
+                      libsmb
+                      samba3core
+                      ''')
 
 bld.SAMBA3_BINARY('smbspool_krb5_wrapper',
                  source='client/smbspool_krb5_wrapper.c',
                  deps='''
-                 DYNCONFIG
-                 cups
-                 ''',
+                      DYNCONFIG
+                      cups
+                      ''',
                  install_path='${LIBEXECDIR}/samba',
                  enabled=bld.CONFIG_SET('HAVE_CUPS'))
 
-bld.SAMBA3_BINARY('testparm',
-                 source='utils/testparm.c',
+bld.SAMBA3_BINARY('locktest2',
+                 source='torture/locktest2.c',
                  deps='''
-                 talloc
-                 param
-                 popt_samba3''')
+                      talloc
+                      smbconf
+                      libsmb
+                      LOCKING
+                      ''',
+                 install=False)
 
 smbstatus_source = 'utils/status.c smbd/notify_msg.c'
 
@@ -1146,119 +1171,73 @@ else:
 bld.SAMBA3_BINARY('smbstatus',
                  source=smbstatus_source,
                  deps='''
-                 talloc
-                 param
-                 popt_samba3
-                 smbd_base
-                 LOCKING
-                 PROFILE''')
-
-bld.SAMBA3_BINARY('smbcontrol',
-                 source='utils/smbcontrol.c',
-                 deps='''
-                 talloc
-                 param
-                 popt_samba3
-                 PRINTBASE''')
-
-bld.SAMBA3_BINARY('smbtree',
-                 source='utils/smbtree.c',
-                 deps='''
-                 talloc
-                 param
-                 libsmb
-                 msrpc3
-                 popt_samba3
-                 RPC_NDR_SRVSVC''')
-
-bld.SAMBA3_BINARY('smbpasswd',
-                 source='utils/smbpasswd.c',
-                 deps='''
-                 talloc
-                 param
-                 pdb
-                 PASSWD_UTIL
-                 PASSCHANGE''')
-
-bld.SAMBA3_BINARY('pdbedit',
-                 source='utils/pdbedit.c',
-                 deps='''
-                 talloc
-                 param
-                 popt_samba3
-                 pdb
-                 PASSWD_UTIL''')
-
-bld.SAMBA3_BINARY('smbget',
-                 source='utils/smbget.c',
-                 deps='''
-                 talloc
-                 popt_samba3
-                 smbclient''')
-
-bld.SAMBA3_BINARY('nmblookup',
-                 source='utils/nmblookup.c',
-                 deps='''
-                 talloc
-                 param
-                 popt_samba3
-                 LIBNMB''')
+                      talloc
+                      smbconf
+                      popt_samba3
+                      smbd_base
+                      LOCKING
+                      PROFILE
+                      ''')
 
 bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
-                 source='''torture/torture.c
-                 torture/nbio.c
-                 torture/scanner.c
-                 torture/utable.c
-                 torture/denytest.c
-                 torture/mangle_test.c
-                 torture/nbench.c
-                 torture/test_async_echo.c
-                 torture/test_addrchange.c
-                 torture/test_posix_append.c
-                 torture/test_nttrans_create.c
-                 torture/test_nttrans_fsctl.c
-                 torture/test_case_insensitive.c
-                 torture/test_notify_online.c
-                 torture/test_chain3.c
-                 torture/test_smb2.c
-                 torture/test_authinfo_structs.c
-                 torture/test_smbsock_any_connect.c
-                 torture/test_cleanup.c
-                 torture/test_notify.c
-                 lib/tevent_barrier.c
-                 torture/test_dbwrap_watch.c
-                 torture/test_idmap_tdb_common.c
-                 torture/test_dbwrap_ctdb.c
-                 torture/test_buffersize.c
-                 torture/test_messaging_read.c
-                 torture/test_messaging_fd_passing.c
-                 torture/test_oplock_cancel.c
-                 torture/test_pthreadpool_tevent.c
-                 torture/bench_pthreadpool.c
-                 torture/wbc_async.c''',
+                 source='''
+                        torture/torture.c
+                        torture/nbio.c
+                        torture/scanner.c
+                        torture/utable.c
+                        torture/denytest.c
+                        torture/mangle_test.c
+                        torture/nbench.c
+                        torture/test_async_echo.c
+                        torture/test_addrchange.c
+                        torture/test_posix_append.c
+                        torture/test_nttrans_create.c
+                        torture/test_nttrans_fsctl.c
+                        torture/test_case_insensitive.c
+                        torture/test_notify_online.c
+                        torture/test_chain3.c
+                        torture/test_smb2.c
+                        torture/test_authinfo_structs.c
+                        torture/test_smbsock_any_connect.c
+                        torture/test_cleanup.c
+                        torture/test_notify.c
+                        lib/tevent_barrier.c
+                        torture/test_dbwrap_watch.c
+                        torture/test_idmap_tdb_common.c
+                        torture/test_dbwrap_ctdb.c
+                        torture/test_buffersize.c
+                        torture/test_messaging_read.c
+                        torture/test_messaging_fd_passing.c
+                        torture/test_oplock_cancel.c
+                        torture/test_pthreadpool_tevent.c
+                        torture/bench_pthreadpool.c
+                        torture/wbc_async.c
+                        torture/test_g_lock.c
+                        ''',
                  deps='''
-                 talloc
-                 param
-                 libsmb
-                 msrpc3
-                 TLDAP
-                 RPC_NDR_ECHO
-                 WB_REQTRANS
-                 LOCKING
-                 NDR_OPEN_FILES
-                 idmap
-                 IDMAP_TDB_COMMON
-                 samba-cluster-support
-                 ''',
+                      talloc
+                      smbconf
+                      libsmb
+                      msrpc3
+                      TLDAP
+                      RPC_NDR_ECHO
+                      WB_REQTRANS
+                      LOCKING
+                      NDR_OPEN_FILES
+                      idmap
+                      IDMAP_TDB_COMMON
+                      samba-cluster-support
+                      ''',
                  cflags='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
                  install=False)
 
 bld.SAMBA3_BINARY('smbconftort',
                  source='lib/smbconf/testsuite.c',
                  deps='''
-                 talloc
-                 param
-                 popt_samba3''',
+                      talloc
+                      smbconf
+                      popt_samba3
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('replacetort',
@@ -1269,121 +1248,60 @@ bld.SAMBA3_BINARY('replacetort',
 bld.SAMBA3_BINARY('msgtest',
                  source='torture/msgtest.c',
                  deps='''
-                 talloc
-                 param''',
+                      talloc
+                      smbconf
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('msg_sink',
                  source='torture/msg_sink.c',
                  deps='''
-                 talloc
-                 param''',
+                      talloc
+                      smbconf
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('msg_source',
                  source='torture/msg_source.c',
                  deps='''
-                 talloc
-                 param''',
+                      talloc
+                      smbconf
+                      ''',
                  install=False)
 
-bld.SAMBA3_BINARY('smbcacls',
-                 source='utils/smbcacls.c lib/util_sd.c',
-                 deps='''
-                 talloc
-                 popt_samba3
-                 msrpc3
-                 libcli_lsa3
-                 krb5samba''')
-
-bld.SAMBA3_BINARY('smbcquotas',
-                 source='utils/smbcquotas.c',
-                 deps='''
-                 talloc
-                 popt_samba3
-                 libsmb
-                 msrpc3
-                 libcli_lsa3''')
-
-bld.SAMBA3_BINARY('eventlogadm',
-                 source='utils/eventlogadm.c',
-                 deps='''
-                 talloc
-                 param
-                 LIBEVENTLOG''')
-
-bld.SAMBA3_BINARY('sharesec',
-                 source='utils/sharesec.c lib/util_sd.c',
-                 deps='''
-                 talloc
-                 msrpc3
-                 libcli_lsa3
-                 popt_samba3''')
-
 bld.SAMBA3_BINARY('pdbtest',
                  source='torture/pdbtest.c',
                  deps='''
-                 talloc
-                 pdb
-                 popt_samba3
-                 AUTH_COMMON
-                 auth''',
+                      talloc
+                      pdb
+                      popt_samba3
+                      AUTH_COMMON
+                      auth
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('vfstest',
-                 source='''torture/cmd_vfs.c
-                 torture/vfstest.c
-                 torture/vfstest_chain.c''',
-                 deps='''
-                 vfs
-                 popt_samba3
-                 SMBREADLINE''',
-                 install=False)
-
-bld.SAMBA3_BINARY('log2pcap',
-                 source='utils/log2pcaphex.c',
-                 deps='''talloc popt''',
-                 install=False)
-
-bld.SAMBA3_BINARY('locktest2',
-                 source='torture/locktest2.c',
-                 deps='''
-                 talloc
-                 param
-                 libsmb
-                 LOCKING''',
-                 install=False)
-
-bld.SAMBA3_BINARY('debug2html',
-                 source='''utils/debug2html.c utils/debugparse.c''',
-                 deps='''talloc popt''',
-                 install=False)
-
-bld.SAMBA3_BINARY('smbfilter',
-                 source='utils/smbfilter.c',
+                 source='''
+                        torture/cmd_vfs.c
+                        torture/vfstest.c
+                        torture/vfstest_chain.c
+                        ''',
                  deps='''
-                 talloc
-                 param
-                 LIBNMB''',
+                      vfs
+                      popt_samba3
+                      smbconf
+                      SMBREADLINE
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('versiontest',
                  source='lib/version_test.c',
                  deps='''
-                 SAMBA_VERSION
-                 param''',
+                      SAMBA_VERSION
+                      smbconf
+                      ''',
                  install=False)
 
-bld.SAMBA3_BINARY('ntlm_auth',
-                 source='''utils/ntlm_auth.c utils/ntlm_auth_diagnostics.c''',
-                 deps='''
-                 talloc
-                 krb5samba
-                 tiniparser
-                 libsmb
-                 popt_samba3
-                 gse gensec''')
-
 bld.SAMBA3_BINARY('timelimit',
                  source='script/tests/timelimit.c',
                  install=False)
@@ -1391,35 +1309,17 @@ bld.SAMBA3_BINARY('timelimit',
 bld.SAMBA3_BINARY('rpc_open_tcp',
                  source='torture/rpc_open_tcp.c',
                  deps='''
-                 talloc
-                 msrpc3''',
-                 install=False)
-
-bld.SAMBA3_BINARY('dbwrap_tool',
-                 source='utils/dbwrap_tool.c',
-                 deps='''
-                 talloc
-                 popt_samba3''')
-
-bld.SAMBA3_BINARY('dbwrap_torture',
-                 source='utils/dbwrap_torture.c',
-                 deps='''
-                 talloc
-                 popt_samba3''',
-                 install=False)
-
-bld.SAMBA3_BINARY('split_tokens',
-                 source='utils/split_tokens.c',
-                 deps='''
-                 talloc
-                 popt_samba3''',
+                      talloc
+                      msrpc3
+                      ''',
                  install=False)
 
 bld.SAMBA3_BINARY('vlp',
                  source='printing/tests/vlp.c',
                  deps='''
-                 talloc
-                 param''',
+                      talloc
+                      smbconf
+                      ''',
                  install=False)
 
 bld.SAMBA3_PYTHON('pysmbd',
@@ -1434,19 +1334,11 @@ bld.SAMBA3_PYTHON('pylibsmb',
                   realname='samba/samba3/libsmb_samba_internal.so'
                   )
 
-bld.SAMBA3_BINARY('samba-regedit',
-                  source="""utils/regedit.c utils/regedit_samba3.c
-                            utils/regedit_wrap.c utils/regedit_treeview.c
-                            utils/regedit_valuelist.c utils/regedit_dialog.c
-                            utils/regedit_hexedit.c utils/regedit_list.c""",
-                  deps='ncurses menu panel form registry param popt_samba3 smbregistry',
-                  enabled=bld.env.build_regedit)
-
 bld.SAMBA3_BINARY('spotlight2sparql',
                  source='''
                  rpc_server/mdssvc/sparql_parser_test.c
-                 rpc_server/mdssvc/sparql_parser.c
-                 rpc_server/mdssvc/sparql_lexer.c
+                 rpc_server/mdssvc/sparql_parser.y
+                 rpc_server/mdssvc/sparql_lexer.l
                  rpc_server/mdssvc/sparql_mapping.c''',
                  deps='samba3-util talloc ' + bld.env['libtracker'],
                  enabled=bld.env.with_spotlight,
@@ -1456,7 +1348,6 @@ bld.SAMBA3_BINARY('spotlight2sparql',
 
 bld.RECURSE('auth')
 bld.RECURSE('libgpo/gpext')
-bld.RECURSE('lib/pthreadpool')
 bld.RECURSE('librpc')
 bld.RECURSE('librpc/idl')
 bld.RECURSE('libsmb')
@@ -1470,10 +1361,13 @@ bld.RECURSE('../examples/auth')
 bld.RECURSE('../examples/libsmbclient')
 bld.RECURSE('../examples/pdb')
 bld.RECURSE('../examples/VFS')
+bld.RECURSE('../examples/fuse')
 bld.RECURSE('lib/netapi/tests')
 bld.RECURSE('lib/netapi/examples')
 bld.RECURSE('smbd/notifyd')
 bld.RECURSE('rpcclient')
+bld.RECURSE('utils')
+bld.RECURSE('nmbd')
 
 bld.ENFORCE_GROUP_ORDERING()
 bld.CHECK_PROJECT_RULES()