3 from samba_utils
import *
4 import samba_version
, samba3
8 config_h
= "../include/config.h"
10 bld
.SAMBA_BLDOPTIONS('smbd/build_options.c')
12 bld
.SETUP_BUILD_GROUPS()
14 ######################## SUBSYSTEMS #################################
16 bld
.SAMBA3_LIBRARY('netapi',
17 source
='''lib/netapi/netapi.c
19 lib/netapi/libnetapi.c
20 lib/netapi/joindomain.c
21 lib/netapi/serverinfo.c
22 lib/netapi/wkstainfo.c
26 lib/netapi/localgroup.c
32 lib/netapi/netlogon.c''',
46 public_headers
='../source3/lib/netapi/netapi.h',
47 pc_files
='libnet/netapi.pc',
50 bld
.SAMBA3_LIBRARY('gse',
51 source
='librpc/crypto/gse_krb5.c librpc/crypto/gse.c',
52 deps
='krb5samba gensec smbconf KRBCLIENT secrets3',
55 bld
.SAMBA3_LIBRARY('msrpc3',
58 rpc_client/rpc_transport_np.c
59 rpc_client/rpc_transport_sock.c
60 rpc_client/rpc_transport_tstream.c
61 librpc/rpc/dcerpc_helpers.c
79 bld
.SAMBA3_SUBSYSTEM('AVAHI',
88 enabled
=bld
.env
.with_avahi
)
90 bld
.SAMBA3_SUBSYSTEM('GROUPDB',
97 bld
.SAMBA3_SUBSYSTEM('TLDAP',
101 lib/tldap_gensec_bind.c
109 bld
.SAMBA3_BINARY('test_tldap',
110 source
='lib/test_tldap.c',
119 # libpdb.so should not expose internal symbols that are only usable
120 # to the statically linked modules that are merged into libpdb.
121 # Note that we always filter these symbols out in libpdb, even
122 # when modules are not linked statically. In the latter case
123 # symbols will not be present in the libpdb anyway so no hurt is
124 # done to the version script.
125 private_pdb_match
= []
126 private_pdb_match
.append('!idmap_init')
127 private_pdb_match
.append('!idmap_sids_to_xids')
128 private_pdb_match
.append('!idmap_xids_to_sids')
130 ldapsam_pdb_match
= ['!priv2ld', '!smbldap_search_domain_info',
131 '!ldapsam_*', '!groupmap_attr_list*', '!get_userattr_list',
132 '!dominfo_attr_list', '!get_attr_key2string',
133 '!sidmap_attr_list', '!attrib_map_*', '!idpool_attr_list',
135 private_pdb_match
.append('!pdb_nds_*')
136 private_pdb_match
.append('!pdb_ldapsam_init*')
137 private_pdb_match
.append('!pdb_*_init')
138 private_pdb_match
= private_pdb_match
+ ldapsam_pdb_match
140 bld
.SAMBA3_LIBRARY('samba-passdb',
143 private_library
=False,
144 grouping_library
=True,
146 public_headers_install
=True,
152 abi_match
=private_pdb_match
,
153 abi_directory
='passdb/ABI',
156 bld
.SAMBA3_SUBSYSTEM('pdb',
163 lib/util_sid_passdb.c
172 passdb/pdb_interface.c
174 passdb/pdb_unixid.c''',
185 bld
.SAMBA3_LIBRARY('smbldaphelper',
187 passdb/pdb_ldap_schema.c
188 passdb/pdb_ldap_util.c
190 deps
='smbldap secrets3',
191 allow_undefined_symbols
=True,
192 enabled
=bld
.CONFIG_SET('HAVE_LDAP'),
193 private_library
=True)
195 bld
.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
196 source
='lib/server_mutex.c',
199 # this includes only the low level parse code, not stuff
200 # that requires knowledge of security contexts
201 bld
.SAMBA3_SUBSYSTEM('REG_PARSE_PRS',
202 source
='registry/reg_parse_prs.c')
204 bld
.SAMBA3_SUBSYSTEM('REGFIO',
205 source
='registry/regfio.c',
206 deps
='samba-util REG_PARSE_PRS')
208 bld
.SAMBA3_SUBSYSTEM('REG_API_REGF',
209 source
='registry/reg_api_regf.c',
212 # Do not link against this use 'smbconf'
213 bld
.SAMBA3_SUBSYSTEM('SMBREGISTRY',
216 registry/reg_dispatcher.c
217 registry/reg_cachehook.c
218 registry/reg_objects.c
219 registry/reg_util_internal.c
221 registry/reg_backend_db.c
222 registry/reg_parse_internal.c
224 registry/reg_init_basic.c
241 # Do not link against this use 'smbconf'
242 bld
.SAMBA3_SUBSYSTEM('REG_SMBCONF',
244 registry/reg_backend_smbconf.c
245 registry/reg_init_smbconf.c
246 registry/reg_util_token.c
247 registry/reg_api_util.c
251 bld
.SAMBA3_SUBSYSTEM('REG_FULL',
253 registry/reg_backend_printing.c
254 registry/reg_backend_shares.c
255 registry/reg_backend_netlogon_params.c
256 registry/reg_backend_prod_options.c
257 registry/reg_backend_tcpip_params.c
258 registry/reg_backend_hkpt_params.c
259 registry/reg_backend_current_version.c
260 registry/reg_backend_perflib.c
261 registry/reg_init_full.c
262 registry/reg_perfcount.c''',
268 bld
.SAMBA3_LIBRARY('popt_samba3',
269 source
='lib/popt_common.c',
270 deps
='popt samba-util util_cmdline',
271 private_library
=True)
273 bld
.SAMBA3_LIBRARY('util_cmdline',
274 source
='lib/util_cmdline.c',
276 private_library
=True)
278 bld
.SAMBA3_SUBSYSTEM('KRBCLIENT',
279 source
='libads/kerberos.c libads/ads_status.c',
280 public_deps
='krb5samba asn1util k5crypto gssapi LIBTSOCKET CLDAP LIBNMB')
282 bld
.SAMBA3_SUBSYSTEM('samba3util',
289 lib/util_specialsids.c
296 lib/util_transfer_file.c
311 if bld
.env
.with_ctdb
:
312 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
313 lib/cluster_support.c
314 lib/dbwrap/dbwrap_ctdb.c
316 lib/messages_ctdb_ref.c
319 SAMBA_CLUSTER_SUPPORT_DEPS
='''
325 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
326 lib/cluster_support.c
329 SAMBA_CLUSTER_SUPPORT_DEPS
='''
334 bld
.SAMBA3_LIBRARY('samba-cluster-support',
335 source
=SAMBA_CLUSTER_SUPPORT_SOURCES
,
336 deps
=SAMBA_CLUSTER_SUPPORT_DEPS
,
337 allow_undefined_symbols
=True,
338 private_library
=True)
340 bld
.SAMBA3_SUBSYSTEM('TDB_LIB',
342 lib/dbwrap/dbwrap_open.c
343 lib/dbwrap/dbwrap_watch.c
348 samba-cluster-support
351 bld
.SAMBA3_LIBRARY('messages_dgm',
354 lib/messages_dgm_ref.c
363 private_library
=True)
365 bld
.SAMBA3_LIBRARY('messages_util',
366 source
='''lib/messages_util.c''',
368 private_library
=True)
370 bld
.SAMBA3_SUBSYSTEM('samba3core',
376 lib/server_id_watch.c
377 lib/server_id_db_util.c
379 ../lib/util/debug_s3.c
386 lib/substitute_generic.c
393 lib/server_contexts.c
395 lib/server_prefork_util.c
427 bld
.SAMBA3_LIBRARY('smbd_shim',
428 source
='''lib/smbd_shim.c''',
430 private_library
=True)
432 bld
.SAMBA3_SUBSYSTEM('auth_generic',
433 source
='libsmb/auth_generic.c',
436 bld
.SAMBA3_LIBRARY('libsmb',
445 libsmb/clireadwrite.c
458 libsmb/reparse_symlink.c
460 libsmb/smbsock_connect.c
461 libsmb/cli_smb2_fnum.c
475 private_library
=True)
477 bld
.SAMBA3_SUBSYSTEM('CLDAP',
478 source
='libads/cldap.c',
479 deps
='cli-ldap-common cli_cldap LIBTSOCKET')
481 # NOTE: The secrets3 library is a low level library used by several subsystems.
482 # PLEASE DO NOT make it depend on high level libraries like PDB, if you are
483 # doing that your design is wrong and needs changing. -SSS
484 bld
.SAMBA3_LIBRARY('secrets3',
487 passdb/machine_account_secrets.c
497 private_library
=True)
499 bld
.SAMBA3_LIBRARY('smbldap',
500 source
='lib/smbldap.c',
501 deps
='ldap lber samba-util smbconf',
502 enabled
=bld
.CONFIG_SET("HAVE_LDAP"),
503 private_library
=False,
504 abi_directory
='lib/ABI',
505 abi_match
='smbldap_*',
508 public_headers
='include/smbldap.h include/smb_ldap.h')
510 bld
.SAMBA3_LIBRARY('ads',
514 libads/sasl_wrapping.c
516 libads/kerberos_util.c
519 libads/kerberos_keytab.c
525 libads/net_ads_setspn.c
540 private_library
=True)
542 bld
.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
543 source
='libads/authdata.c',
544 deps
='SERVER_MUTEX ndr-krb5pac krb5samba gssapi')
546 bld
.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
547 source
='libads/ldap_printer.c',
548 deps
='samba-util krb5samba')
550 # Only smbconf should link against this subsystem, else we will create
551 # a circular dependency.
552 bld
.SAMBA3_SUBSYSTEM('SMBCONF_PARAM',
556 lib/ldap_debug_handler.c
571 bld
.SAMBA3_LIBRARY('smbconf',
573 lib/smbconf/smbconf_init.c
574 lib/smbconf/smbconf_reg.c
589 public_headers
='../lib/smbconf/smbconf.h',
593 bld
.SAMBA3_LIBRARY('smbd_conn',
594 source
='smbd/conn.c',
595 deps
='samba3-util samba-util',
596 private_library
=True)
598 bld
.SAMBA3_SUBSYSTEM('sysquotas',
601 lib/sysquotas_linux.c
608 deps
='samba3-util samba-util tirpc')
613 if bld
.CONFIG_SET("HAVE_INOTIFY"):
614 NOTIFY_SOURCES
+= ' smbd/notify_inotify.c'
616 if bld
.CONFIG_SET('SAMBA_FAM_LIBS'):
617 NOTIFY_SOURCES
+= ' smbd/notify_fam.c'
618 NOTIFY_DEPS
+= ' ' + bld
.CONFIG_GET('SAMBA_FAM_LIBS')
620 bld
.SAMBA3_LIBRARY('smbd_base',
660 printing/printspoolss.c
668 smbd/aio.c smbd/statvfs.c
672 smbd/dnsregister.c smbd/globals.c
676 smbd/smb2_sesssetup.c
685 smbd/smb2_ioctl_dfs.c
686 smbd/smb2_ioctl_filesys.c
687 smbd/smb2_ioctl_named_pipe.c
688 smbd/smb2_ioctl_network_fs.c
689 smbd/smb2_keepalive.c
690 smbd/smb2_query_directory.c
695 smbd/smbXsrv_version.c
696 smbd/smbXsrv_client.c
697 smbd/smbXsrv_session.c
712 ''' + NOTIFY_SOURCES
,
743 bld
.env
['dmapi_lib'] +
744 bld
.env
['legacy_quota_libs'] +
746 private_library
=True)
748 bld
.SAMBA3_SUBSYSTEM('LOCKING',
753 locking/share_mode_lock.c
764 bld
.SAMBA3_SUBSYSTEM('LEASES_DB',
765 source
='locking/leases_db.c',
766 deps
='NDR_LEASES_DB')
768 bld
.SAMBA3_SUBSYSTEM('LEASES_UTIL',
769 source
='locking/leases_util.c',
770 deps
='NDR_OPEN_FILES')
772 if bld
.CONFIG_GET("WITH_PROFILE"):
773 bld
.SAMBA3_SUBSYSTEM('PROFILE',
774 source
='profile/profile.c',
777 bld
.SAMBA3_SUBSYSTEM('PROFILE',
778 source
='profile/profile_dummy.c',
781 bld
.SAMBA3_SUBSYSTEM('PRINTBASE',
784 printing/printing_db.c
791 bld
.SAMBA3_SUBSYSTEM('PRINTBACKEND',
794 printing/nt_printing.c
795 printing/nt_printing_tdb.c
796 printing/nt_printing_migrate_internal.c
797 printing/nt_printing_ads.c
798 printing/queue_process.c
808 bld
.SAMBA3_LIBRARY('printing_migrate',
810 printing/nt_printing_migrate.c
811 rpc_client/cli_winreg_spoolss.c
812 printing/nt_printing_os2.c
821 private_library
=True)
823 bld
.SAMBA3_SUBSYSTEM('PRINTING',
826 printing/print_svid.c
828 printing/print_cups.c
829 printing/print_generic.c
832 printing/print_standard.c
833 printing/print_iprint.c
834 printing/printer_list.c
842 bld
.SAMBA3_SUBSYSTEM('FNAME_UTIL',
843 source
='lib/filename_util.c',
846 bld
.SAMBA3_SUBSYSTEM('LIBNET',
847 source
='libnet/libnet_join.c',
848 deps
='NDR_LIBNET_JOIN INIT_SAMR net_keytab pdb')
850 bld
.SAMBA3_LIBRARY('net_keytab',
851 source
='libnet/libnet_keytab.c',
852 deps
='krb5samba ads',
853 private_library
=True)
856 bld
.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
858 libnet/libnet_dssync.c
859 libnet/libnet_dssync_passdb.c
860 libnet/libnet_dssync_keytab.c
867 bld
.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
868 source
='lib/eventlog/eventlog.c',
869 deps
='NDR_EVENTLOG tdb')
871 bld
.SAMBA3_SUBSYSTEM('LIBNMB',
878 libads/sitename_cache.c
888 bld
.SAMBA3_SUBSYSTEM('SERVICES',
890 services/svc_spoolss.c
891 services/svc_rcinit.c
892 services/svc_winreg_glue.c
893 services/svc_netlogon.c
894 services/svc_winreg.c
899 bld
.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
909 bld
.SAMBA3_SUBSYSTEM('PASSCHANGE',
910 source
='libsmb/passchange.c',
918 bld
.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
919 source
='lib/version.c',
922 bld
.SAMBA3_SUBSYSTEM('SLCACHE',
923 source
='libsmb/samlogon_cache.c',
929 bld
.SAMBA3_SUBSYSTEM('DCUTIL',
931 libsmb/namequery_dc.c
932 libsmb/trustdom_cache.c
941 bld
.SAMBA3_LIBRARY('trusts_util',
942 source
='libsmb/trusts_util.c',
948 private_library
=True)
950 bld
.SAMBA3_SUBSYSTEM('tdb-wrap3',
951 source
='lib/util_tdb.c',
952 deps
='talloc samba3-util')
954 bld
.SAMBA3_LIBRARY('samba3-util',
968 private_library
=True)
970 bld
.SAMBA_LIBRARY('xattr_tdb',
971 source
='lib/xattr_tdb.c',
972 deps
='NDR_XATTR dbwrap samba3-util',
973 private_library
=True)
975 bld
.SAMBA3_LIBRARY('CHARSET3',
988 private_library
=True)
990 bld
.SAMBA3_SUBSYSTEM('errors3',
998 bld
.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
999 source
='rpc_client/cli_samr.c',
1000 deps
='RPC_NDR_SAMR')
1002 bld
.SAMBA3_LIBRARY('libcli_lsa3',
1003 source
='rpc_client/cli_lsarpc.c',
1004 deps
='RPC_NDR_LSA INIT_LSA',
1005 private_library
=True)
1007 bld
.SAMBA3_LIBRARY('libcli_netlogon3',
1009 rpc_client/cli_netlogon.c
1010 rpc_client/util_netlogon.c
1018 NETLOGON_CREDS_CLI''',
1019 private_library
=True)
1021 bld
.SAMBA3_LIBRARY('cli_spoolss',
1023 rpc_client/cli_spoolss.c
1024 rpc_client/init_spoolss.c
1030 private_library
=True)
1032 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
1033 source
='rpc_client/cli_winreg.c',
1034 deps
='RPC_NDR_WINREG')
1036 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG_INTERNAL',
1037 source
='rpc_client/cli_winreg_int.c',
1038 deps
='LIBCLI_WINREG RPC_SERVER')
1040 bld
.SAMBA3_SUBSYSTEM('RPC_CLIENT_SCHANNEL',
1041 source
='rpc_client/cli_pipe_schannel.c',
1042 deps
='samba-util krb5samba')
1044 bld
.SAMBA3_SUBSYSTEM('INIT_LSA',
1045 source
='rpc_client/init_lsa.c',
1048 bld
.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
1049 source
='rpc_client/init_netlogon.c',
1052 bld
.SAMBA3_SUBSYSTEM('INIT_SAMR',
1053 source
='rpc_client/init_samr.c',
1056 bld
.SAMBA3_SUBSYSTEM('LIBLSA',
1059 bld
.SAMBA3_SUBSYSTEM('SPOOLSSD',
1060 source
='printing/spoolssd.c',
1066 ########################## BINARIES #################################
1068 bld
.SAMBA3_BINARY('smbd/smbd',
1069 source
='smbd/server.c smbd/smbd_cleanupd.c',
1079 install_path
='${SBINDIR}')
1082 bld
.SAMBA3_SUBSYSTEM('TDB_VALIDATE',
1083 source
='lib/tdb_validate.c',
1087 bld
.SAMBA3_BINARY('client/smbclient',
1106 bld
.SAMBA3_BINARY('smbspool',
1107 source
='client/smbspool.c',
1116 bld
.SAMBA3_BINARY('smbspool_krb5_wrapper',
1117 source
='client/smbspool_krb5_wrapper.c',
1122 install_path
='${LIBEXECDIR}/samba',
1123 enabled
=bld
.CONFIG_SET('HAVE_CUPS'))
1125 bld
.SAMBA3_BINARY('locktest2',
1126 source
='torture/locktest2.c',
1135 smbstatus_source
= 'utils/status.c smbd/notify_msg.c'
1137 if bld
.CONFIG_GET("WITH_PROFILE"):
1138 smbstatus_source
+= ' utils/status_profile.c'
1140 smbstatus_source
+= ' utils/status_profile_dummy.c'
1142 bld
.SAMBA3_BINARY('smbstatus',
1143 source
=smbstatus_source
,
1153 bld
.SAMBA3_BINARY('smbtorture' + bld
.env
.suffix3
,
1160 torture/mangle_test.c
1162 torture/test_async_echo.c
1163 torture/test_addrchange.c
1164 torture/test_posix_append.c
1165 torture/test_nttrans_create.c
1166 torture/test_nttrans_fsctl.c
1167 torture/test_case_insensitive.c
1168 torture/test_notify_online.c
1169 torture/test_chain3.c
1171 torture/test_authinfo_structs.c
1172 torture/test_smbsock_any_connect.c
1173 torture/test_cleanup.c
1174 torture/test_notify.c
1175 lib/tevent_barrier.c
1176 torture/test_dbwrap_watch.c
1177 torture/test_dbwrap_do_locked.c
1178 torture/test_idmap_tdb_common.c
1179 torture/test_dbwrap_ctdb.c
1180 torture/test_buffersize.c
1181 torture/test_messaging_read.c
1182 torture/test_messaging_fd_passing.c
1183 torture/test_messaging_send_all.c
1184 torture/test_oplock_cancel.c
1185 torture/test_pthreadpool_tevent.c
1186 torture/bench_pthreadpool.c
1188 torture/test_g_lock.c
1189 torture/test_namemap_cache.c
1203 samba-cluster-support
1205 cflags
='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld
.env
.WINBINDD_SOCKET_DIR
,
1208 bld
.SAMBA3_BINARY('smbconftort',
1209 source
='lib/smbconf/testsuite.c',
1217 bld
.SAMBA3_BINARY('replacetort',
1218 source
='../lib/replace/test/main.c',
1219 deps
='replace replace-test',
1222 bld
.SAMBA3_BINARY('msgtest',
1223 source
='torture/msgtest.c',
1230 bld
.SAMBA3_BINARY('msg_sink',
1231 source
='torture/msg_sink.c',
1238 bld
.SAMBA3_BINARY('msg_source',
1239 source
='torture/msg_source.c',
1246 bld
.SAMBA3_BINARY('pdbtest',
1247 source
='torture/pdbtest.c',
1257 bld
.SAMBA3_BINARY('vfstest',
1261 torture/vfstest_chain.c
1271 bld
.SAMBA3_BINARY('versiontest',
1272 source
='lib/version_test.c',
1279 bld
.SAMBA3_BINARY('timelimit',
1280 source
='script/tests/timelimit.c',
1283 bld
.SAMBA3_BINARY('rpc_open_tcp',
1284 source
='torture/rpc_open_tcp.c',
1291 bld
.SAMBA3_BINARY('vlp',
1292 source
='printing/tests/vlp.c',
1299 bld
.SAMBA3_PYTHON('pysmbd',
1300 source
='smbd/pysmbd.c',
1301 deps
='smbd_base pyrpc_util pytalloc-util',
1302 realname
='samba/samba3/smbd.so'
1305 bld
.SAMBA3_PYTHON('pylibsmb',
1306 source
='libsmb/pylibsmb.c',
1307 deps
='smbclient samba-credentials pycredentials',
1308 realname
='samba/samba3/libsmb_samba_internal.so'
1311 bld
.SAMBA3_BINARY('spotlight2sparql',
1313 rpc_server/mdssvc/sparql_parser_test.c
1314 rpc_server/mdssvc/sparql_parser.y
1315 rpc_server/mdssvc/sparql_lexer.l
1316 rpc_server/mdssvc/sparql_mapping.c''',
1317 deps
='samba3-util talloc ' + bld
.env
['libtracker'],
1318 enabled
=bld
.env
.with_spotlight
,
1321 ########################## INCLUDES #################################
1324 bld
.RECURSE('libgpo/gpext')
1325 bld
.RECURSE('librpc')
1326 bld
.RECURSE('librpc/idl')
1327 bld
.RECURSE('libsmb')
1328 bld
.RECURSE('modules')
1329 bld
.RECURSE('param')
1330 bld
.RECURSE('passdb')
1331 bld
.RECURSE('rpc_server')
1332 bld
.RECURSE('script')
1333 bld
.RECURSE('winbindd')
1334 bld
.RECURSE('../examples/auth')
1335 bld
.RECURSE('../examples/libsmbclient')
1336 bld
.RECURSE('../examples/pdb')
1337 bld
.RECURSE('../examples/VFS')
1338 bld
.RECURSE('../examples/fuse')
1339 bld
.RECURSE('lib/netapi/tests')
1340 bld
.RECURSE('lib/netapi/examples')
1341 bld
.RECURSE('smbd/notifyd')
1342 bld
.RECURSE('rpcclient')
1343 bld
.RECURSE('utils')
1346 bld
.ENFORCE_GROUP_ORDERING()
1347 bld
.CHECK_PROJECT_RULES()