From f858121d8f94bd0da6fb93c4e6ab5f4a0e3c9c51 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Nov 2016 13:47:32 +0100 Subject: [PATCH] s3:waf: Make PARAM and SMBREGISTRY a subsystem of smbconf only This is the only way to resolve cirular dependencies with these libraries. I've tried several ways but this is the only way to do it correctly. In future we should try to seperate them by passing down information or making a more lightweight loadparm mechanism. +---------+ +-------------+ | | | | | param <---------+ +--------+ smbregistry | | | | | | | +----+----+ | | +------^------+ | +---+----v--+ | | | | | +----------> smbconf +------------+ | | +-----------+ Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam Reviewed-by: Andrew Bartlett --- examples/fuse/wscript_build | 2 +- source3/libsmb/wscript | 2 +- source3/nmbd/wscript_build | 2 +- source3/param/wscript_build | 8 +-- source3/rpcclient/wscript_build | 2 +- source3/smbd/notifyd/wscript_build | 4 +- source3/utils/wscript_build | 22 +++---- source3/winbindd/wscript_build | 2 +- source3/wscript_build | 95 +++++++++++++++--------------- 9 files changed, 70 insertions(+), 69 deletions(-) diff --git a/examples/fuse/wscript_build b/examples/fuse/wscript_build index aa32ecb1cc0..9ec5fc0a0f2 100644 --- a/examples/fuse/wscript_build +++ b/examples/fuse/wscript_build @@ -3,5 +3,5 @@ if bld.env.HAVE_FUSE: bld.SAMBA_BINARY('smb2mount', source='smb2mount.c clifuse.c', - deps='param popt_samba3 libsmb fuse', + deps='smbconf popt_samba3 libsmb fuse', install=False) diff --git a/source3/libsmb/wscript b/source3/libsmb/wscript index 4f8b2171673..6d862f71998 100644 --- a/source3/libsmb/wscript +++ b/source3/libsmb/wscript @@ -19,7 +19,7 @@ def build(bld): libsmb_setget.c''', public_deps=''' talloc - param + smbconf libsmb KRBCLIENT msrpc3 diff --git a/source3/nmbd/wscript_build b/source3/nmbd/wscript_build index 0d1b267fcfd..843c900a4ba 100644 --- a/source3/nmbd/wscript_build +++ b/source3/nmbd/wscript_build @@ -33,7 +33,7 @@ bld.SAMBA3_BINARY('nmbd', deps=''' talloc tevent - param + smbconf libsmb popt_samba3 ''', diff --git a/source3/param/wscript_build b/source3/param/wscript_build index 6c440f1c7c7..c60e917dba0 100644 --- a/source3/param/wscript_build +++ b/source3/param/wscript_build @@ -6,7 +6,7 @@ bld.SAMBA3_SUBSYSTEM('PARAM_UTIL', bld.SAMBA3_SUBSYSTEM('LOADPARM_CTX', source='loadparm_ctx.c', - deps='''talloc param''') + deps='''talloc smbconf''') bld.SAMBA_GENERATOR('s3_param_proto_h', source= '../../script/generate_param.py ../../docs-xml/smbdotconf/parameters.all.xml', @@ -16,18 +16,18 @@ bld.SAMBA_GENERATOR('s3_param_proto_h', bld.SAMBA3_PYTHON('pys3param', source='pyparam.c', - deps='param', + deps='smbconf', public_deps='samba-hostconfig pytalloc-util talloc', realname='samba/samba3/param.so') bld.SAMBA3_SUBSYSTEM('param_service', source='service.c', - deps = 'USER_UTIL param PRINTING') + deps = 'USER_UTIL smbconf PRINTING') bld.SAMBA3_BINARY('test_lp_load', source='test_lp_load.c', deps=''' talloc - param + smbconf popt_samba3''', install=False) diff --git a/source3/rpcclient/wscript_build b/source3/rpcclient/wscript_build index 7f13c108cd7..c24a5670db9 100644 --- a/source3/rpcclient/wscript_build +++ b/source3/rpcclient/wscript_build @@ -28,7 +28,7 @@ bld.SAMBA3_BINARY('rpcclient', popt_samba3 pdb libsmb - param + smbconf ndr-standard msrpc3 SMBREADLINE diff --git a/source3/smbd/notifyd/wscript_build b/source3/smbd/notifyd/wscript_build index d9976bd521c..55cfd8837c4 100644 --- a/source3/smbd/notifyd/wscript_build +++ b/source3/smbd/notifyd/wscript_build @@ -8,12 +8,12 @@ bld.SAMBA3_BINARY('notifyd-tests', source='tests.c', install=False, deps=''' - param + smbconf ''') bld.SAMBA3_BINARY('notifydd', source='notifydd.c', install=False, deps='''notifyd - param + smbconf ''') diff --git a/source3/utils/wscript_build b/source3/utils/wscript_build index bf9479288c9..0b9356a7980 100644 --- a/source3/utils/wscript_build +++ b/source3/utils/wscript_build @@ -9,14 +9,14 @@ bld.SAMBA3_BINARY('profiles', deps=''' talloc popt_samba3 - param + smbconf REGFIO''') bld.SAMBA3_BINARY('smbcontrol', source='smbcontrol.c', deps=''' talloc - param + smbconf popt_samba3 PRINTBASE''') @@ -24,7 +24,7 @@ bld.SAMBA3_BINARY('smbtree', source='smbtree.c', deps=''' talloc - param + smbconf libsmb msrpc3 popt_samba3 @@ -34,7 +34,7 @@ bld.SAMBA3_BINARY('smbpasswd', source='smbpasswd.c', deps=''' talloc - param + smbconf pdb PASSWD_UTIL PASSCHANGE''') @@ -43,7 +43,7 @@ bld.SAMBA3_BINARY('pdbedit', source='pdbedit.c', deps=''' talloc - param + smbconf popt_samba3 pdb PASSWD_UTIL''') @@ -59,7 +59,7 @@ bld.SAMBA3_BINARY('nmblookup', source='nmblookup.c', deps=''' talloc - param + smbconf popt_samba3 LIBNMB''') @@ -85,7 +85,7 @@ bld.SAMBA3_BINARY('eventlogadm', source='eventlogadm.c', deps=''' talloc - param + smbconf LIBEVENTLOG''') bld.SAMBA3_BINARY('sharesec', @@ -110,7 +110,7 @@ bld.SAMBA3_BINARY('smbfilter', source='smbfilter.c', deps=''' talloc - param + smbconf LIBNMB''', install=False) @@ -149,14 +149,14 @@ bld.SAMBA3_BINARY('samba-regedit', regedit_wrap.c regedit_treeview.c regedit_valuelist.c regedit_dialog.c regedit_hexedit.c regedit_list.c""", - deps='ncurses menu panel form registry param popt_samba3 smbregistry', + deps='ncurses menu panel form registry smbconf popt_samba3', enabled=bld.env.build_regedit) bld.SAMBA3_BINARY('testparm', source='testparm.c', deps=''' talloc - param + smbconf popt_samba3''') bld.SAMBA3_BINARY('net', @@ -218,7 +218,7 @@ bld.SAMBA3_BINARY('net', popt_samba3 pdb libsmb - param + smbconf KRBCLIENT ndr-standard msrpc3 diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build index 47c9bb1a142..3f780930c6e 100644 --- a/source3/winbindd/wscript_build +++ b/source3/winbindd/wscript_build @@ -116,7 +116,7 @@ bld.SAMBA3_MODULE('idmap_autorid', bld.SAMBA3_LIBRARY('nss_info', source='nss_info.c', - deps='samba-util param', + deps='samba-util smbconf', private_library=True) bld.SAMBA3_MODULE('nss_info_template', diff --git a/source3/wscript_build b/source3/wscript_build index 6fa3ce6944a..2ecf8a73e06 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -57,7 +57,7 @@ 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', @@ -213,26 +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', @@ -246,7 +226,8 @@ bld.SAMBA3_SUBSYSTEM('REG_API_REGF', source='registry/reg_api_regf.c', deps='samba-util') -bld.SAMBA3_LIBRARY('smbregistry', +# Do not link against this use 'smbconf' +bld.SAMBA3_SUBSYSTEM('SMBREGISTRY', source=''' registry/reg_api.c registry/reg_dispatcher.c @@ -272,10 +253,9 @@ bld.SAMBA3_LIBRARY('smbregistry', errors3 dbwrap samba3-util - ''', - allow_undefined_symbols=True, - private_library=True) + ''') +# Do not link against this use 'smbconf' bld.SAMBA3_SUBSYSTEM('REG_SMBCONF', source=''' registry/reg_backend_smbconf.c @@ -283,7 +263,7 @@ bld.SAMBA3_SUBSYSTEM('REG_SMBCONF', registry/reg_util_token.c registry/reg_api_util.c ''', - deps='smbregistry') + deps='SMBREGISTRY') bld.SAMBA3_SUBSYSTEM('REG_FULL', source=''' @@ -298,7 +278,7 @@ bld.SAMBA3_SUBSYSTEM('REG_FULL', registry/reg_init_full.c registry/reg_perfcount.c''', deps=''' - REG_SMBCONF + smbconf tdb-wrap3 ''') @@ -451,7 +431,7 @@ bld.SAMBA3_SUBSYSTEM('samba3core', SAMBA_VERSION PTHREADPOOL interfaces - param + smbconf dbwrap samba3-util errors3 @@ -529,7 +509,7 @@ bld.SAMBA3_LIBRARY('secrets3', ''', deps=''' NDR_SECRETS - param + smbconf samba3util dbwrap ''', @@ -537,7 +517,7 @@ bld.SAMBA3_LIBRARY('secrets3', 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', @@ -568,7 +548,7 @@ bld.SAMBA3_LIBRARY('ads', ldap lber KRBCLIENT - param + smbconf LIBNMB libsmb DCUTIL @@ -584,6 +564,27 @@ 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 @@ -598,9 +599,8 @@ bld.SAMBA3_LIBRARY('smbconf', charset cli_smb_common errors3 - param + SMBCONF_PARAM samba-util - smbregistry talloc util_reg ''', @@ -826,7 +826,7 @@ bld.SAMBA3_LIBRARY('printing_migrate', cli_spoolss RPC_NDR_WINREG LIBCLI_WINREG - param + smbconf ''', private_library=True) @@ -1037,7 +1037,7 @@ bld.SAMBA3_LIBRARY('libcli_netlogon3', RPC_NDR_NETLOGON INIT_NETLOGON cliauth - param + smbconf NETLOGON_CREDS_CLI''', private_library=True) @@ -1048,7 +1048,7 @@ bld.SAMBA3_LIBRARY('cli_spoolss', ''', deps=''' RPC_NDR_SPOOLSS - param + smbconf secrets3''', private_library=True) @@ -1116,7 +1116,7 @@ bld.SAMBA3_BINARY('client/smbclient', deps=''' talloc popt_samba3 - param + smbconf ndr-standard SMBREADLINE libsmb @@ -1131,7 +1131,7 @@ bld.SAMBA3_BINARY('smbspool', deps=''' talloc popt_samba3 - param + smbconf libsmb samba3core ''') @@ -1149,7 +1149,7 @@ bld.SAMBA3_BINARY('locktest2', source='torture/locktest2.c', deps=''' talloc - param + smbconf libsmb LOCKING ''', @@ -1166,7 +1166,7 @@ bld.SAMBA3_BINARY('smbstatus', source=smbstatus_source, deps=''' talloc - param + smbconf popt_samba3 smbd_base LOCKING @@ -1209,7 +1209,7 @@ bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3, ''', deps=''' talloc - param + smbconf libsmb msrpc3 TLDAP @@ -1228,7 +1228,7 @@ bld.SAMBA3_BINARY('smbconftort', source='lib/smbconf/testsuite.c', deps=''' talloc - param + smbconf popt_samba3 ''', install=False) @@ -1242,7 +1242,7 @@ bld.SAMBA3_BINARY('msgtest', source='torture/msgtest.c', deps=''' talloc - param + smbconf ''', install=False) @@ -1250,7 +1250,7 @@ bld.SAMBA3_BINARY('msg_sink', source='torture/msg_sink.c', deps=''' talloc - param + smbconf ''', install=False) @@ -1258,7 +1258,7 @@ bld.SAMBA3_BINARY('msg_source', source='torture/msg_source.c', deps=''' talloc - param + smbconf ''', install=False) @@ -1282,6 +1282,7 @@ bld.SAMBA3_BINARY('vfstest', deps=''' vfs popt_samba3 + smbconf SMBREADLINE ''', install=False) @@ -1290,7 +1291,7 @@ bld.SAMBA3_BINARY('versiontest', source='lib/version_test.c', deps=''' SAMBA_VERSION - param + smbconf ''', install=False) @@ -1310,7 +1311,7 @@ bld.SAMBA3_BINARY('vlp', source='printing/tests/vlp.c', deps=''' talloc - param + smbconf ''', install=False) -- 2.34.1