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 t
= bld
.SAMBA_GENERATOR('build_env.h',
13 source
='script/build_env.sh',
14 target
='include/build_env.h',
15 rule
='${SRC} ${SRCDIR} ${BUILDDIR} ${CC} > ${TGT}')
16 # todo: work out what is really wanted here
17 t
.env
.SRCDIR
= bld
.path
.abspath()
18 t
.env
.BUILDDIR
= bld
.path
.abspath()
20 bld
.SETUP_BUILD_GROUPS()
22 ######################## SUBSYSTEMS #################################
24 bld
.SAMBA3_LIBRARY('netapi',
25 source
='''lib/netapi/netapi.c
27 lib/netapi/libnetapi.c
28 lib/netapi/joindomain.c
29 lib/netapi/serverinfo.c
30 lib/netapi/wkstainfo.c
34 lib/netapi/localgroup.c
40 lib/netapi/netlogon.c''',
54 public_headers
='../source3/lib/netapi/netapi.h',
55 pc_files
='libnet/netapi.pc',
58 bld
.SAMBA3_LIBRARY('gse',
59 source
='librpc/crypto/gse_krb5.c librpc/crypto/gse.c',
60 deps
='krb5samba gensec smbconf KRBCLIENT secrets3',
63 bld
.SAMBA3_LIBRARY('msrpc3',
66 rpc_client/rpc_transport_np.c
67 rpc_client/rpc_transport_sock.c
68 rpc_client/rpc_transport_tstream.c
69 librpc/rpc/dcerpc_helpers.c
87 bld
.SAMBA3_LIBRARY('gpo',
104 private_library
=True)
106 bld
.SAMBA3_SUBSYSTEM('AVAHI',
109 smbd/avahi_register.c
115 enabled
=bld
.env
.with_avahi
)
117 bld
.SAMBA3_SUBSYSTEM('GROUPDB',
120 groupdb/mapping_tdb.c
124 bld
.SAMBA3_SUBSYSTEM('TLDAP',
128 lib/tldap_gensec_bind.c
136 # libpdb.so should not expose internal symbols that are only usable
137 # to the statically linked modules that are merged into libpdb.
138 # Note that we always filter these symbols out in libpdb, even
139 # when modules are not linked statically. In the latter case
140 # symbols will not be present in the libpdb anyway so no hurt is
141 # done to the version script.
142 private_pdb_match
= []
143 private_pdb_match
.append('!idmap_init')
144 private_pdb_match
.append('!idmap_sids_to_xids')
145 private_pdb_match
.append('!idmap_xids_to_sids')
147 ldapsam_pdb_match
= ['!priv2ld', '!smbldap_search_domain_info',
148 '!ldapsam_*', '!groupmap_attr_list*', '!get_userattr_list',
149 '!dominfo_attr_list', '!get_attr_key2string',
150 '!sidmap_attr_list', '!attrib_map_*', '!idpool_attr_list',
152 private_pdb_match
.append('!pdb_nds_*')
153 private_pdb_match
.append('!pdb_ldapsam_init*')
154 private_pdb_match
.append('!pdb_*_init')
155 private_pdb_match
= private_pdb_match
+ ldapsam_pdb_match
157 bld
.SAMBA3_LIBRARY('samba-passdb',
160 private_library
=False,
161 grouping_library
=True,
163 public_headers_install
=True,
169 abi_match
=private_pdb_match
,
170 abi_directory
='passdb/ABI',
173 bld
.SAMBA3_SUBSYSTEM('pdb',
180 lib/util_sid_passdb.c
189 passdb/pdb_interface.c
191 passdb/pdb_unixid.c''',
202 bld
.SAMBA3_LIBRARY('smbldaphelper',
204 passdb/pdb_ldap_schema.c
205 passdb/pdb_ldap_util.c
207 deps
='smbldap secrets3',
208 allow_undefined_symbols
=True,
209 enabled
=bld
.CONFIG_SET('HAVE_LDAP'),
210 private_library
=True)
212 bld
.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
213 source
='lib/server_mutex.c',
216 # this includes only the low level parse code, not stuff
217 # that requires knowledge of security contexts
218 bld
.SAMBA3_SUBSYSTEM('REG_PARSE_PRS',
219 source
='registry/reg_parse_prs.c')
221 bld
.SAMBA3_SUBSYSTEM('REGFIO',
222 source
='registry/regfio.c',
223 deps
='samba-util REG_PARSE_PRS')
225 bld
.SAMBA3_SUBSYSTEM('REG_API_REGF',
226 source
='registry/reg_api_regf.c',
229 # Do not link against this use 'smbconf'
230 bld
.SAMBA3_SUBSYSTEM('SMBREGISTRY',
233 registry/reg_dispatcher.c
234 registry/reg_cachehook.c
235 registry/reg_objects.c
236 registry/reg_util_internal.c
238 registry/reg_backend_db.c
239 registry/reg_parse_internal.c
241 registry/reg_init_basic.c
258 # Do not link against this use 'smbconf'
259 bld
.SAMBA3_SUBSYSTEM('REG_SMBCONF',
261 registry/reg_backend_smbconf.c
262 registry/reg_init_smbconf.c
263 registry/reg_util_token.c
264 registry/reg_api_util.c
268 bld
.SAMBA3_SUBSYSTEM('REG_FULL',
270 registry/reg_backend_printing.c
271 registry/reg_backend_shares.c
272 registry/reg_backend_netlogon_params.c
273 registry/reg_backend_prod_options.c
274 registry/reg_backend_tcpip_params.c
275 registry/reg_backend_hkpt_params.c
276 registry/reg_backend_current_version.c
277 registry/reg_backend_perflib.c
278 registry/reg_init_full.c
279 registry/reg_perfcount.c''',
285 bld
.SAMBA3_LIBRARY('popt_samba3',
286 source
='lib/popt_common.c',
287 deps
='popt samba-util util_cmdline',
288 private_library
=True)
290 bld
.SAMBA3_LIBRARY('util_cmdline',
291 source
='lib/util_cmdline.c',
293 private_library
=True)
295 bld
.SAMBA3_SUBSYSTEM('KRBCLIENT',
296 source
='libads/kerberos.c libads/ads_status.c',
297 public_deps
='krb5samba asn1util k5crypto gssapi LIBTSOCKET CLDAP LIBNMB')
299 bld
.SAMBA3_SUBSYSTEM('samba3util',
306 lib/util_specialsids.c
313 lib/util_transfer_file.c
329 if bld
.env
.with_ctdb
:
330 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
331 lib/cluster_support.c
332 lib/dbwrap/dbwrap_ctdb.c
336 SAMBA_CLUSTER_SUPPORT_DEPS
='''
342 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
343 lib/cluster_support.c
346 SAMBA_CLUSTER_SUPPORT_DEPS
='''
351 bld
.SAMBA3_LIBRARY('samba-cluster-support',
352 source
=SAMBA_CLUSTER_SUPPORT_SOURCES
,
353 deps
=SAMBA_CLUSTER_SUPPORT_DEPS
,
354 allow_undefined_symbols
=True,
355 private_library
=True)
357 bld
.SAMBA3_SUBSYSTEM('TDB_LIB',
359 lib/dbwrap/dbwrap_open.c
360 lib/dbwrap/dbwrap_watch.c
365 samba-cluster-support
368 bld
.SAMBA3_LIBRARY('messages_dgm',
371 lib/messages_dgm_ref.c
380 private_library
=True)
382 bld
.SAMBA3_LIBRARY('messages_util',
383 source
='''lib/messages_util.c''',
385 private_library
=True)
387 bld
.SAMBA3_SUBSYSTEM('samba3core',
394 lib/server_id_watch.c
395 lib/server_id_db_util.c
397 ../lib/util/debug_s3.c
404 lib/substitute_generic.c
411 lib/server_contexts.c
413 lib/server_prefork_util.c
446 bld
.SAMBA3_LIBRARY('smbd_shim',
447 source
='''lib/smbd_shim.c''',
449 private_library
=True)
451 bld
.SAMBA3_SUBSYSTEM('auth_generic',
452 source
='libsmb/auth_generic.c',
455 bld
.SAMBA3_LIBRARY('libsmb',
464 libsmb/clireadwrite.c
477 libsmb/reparse_symlink.c
479 libsmb/smbsock_connect.c
480 libsmb/cli_smb2_fnum.c
494 private_library
=True)
496 bld
.SAMBA3_SUBSYSTEM('CLDAP',
497 source
='libads/cldap.c',
498 deps
='cli-ldap-common cli_cldap LIBTSOCKET')
500 # NOTE: The secrets3 library is a low level library used by several subsystems.
501 # PLEASE DO NOT make it depend on high level libraries like PDB, if you are
502 # doing that your design is wrong and needs changing. -SSS
503 bld
.SAMBA3_LIBRARY('secrets3',
506 passdb/machine_account_secrets.c
516 private_library
=True)
518 bld
.SAMBA3_LIBRARY('smbldap',
519 source
='lib/smbldap.c',
520 deps
='ldap lber samba-util smbconf',
521 enabled
=bld
.CONFIG_SET("HAVE_LDAP"),
522 private_library
=False,
523 abi_directory
='lib/ABI',
524 abi_match
='smbldap_*',
527 public_headers
='include/smbldap.h include/smb_ldap.h')
529 bld
.SAMBA3_LIBRARY('ads',
533 libads/sasl_wrapping.c
535 libads/kerberos_util.c
538 libads/kerberos_keytab.c
558 private_library
=True)
560 bld
.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
561 source
='libads/authdata.c',
562 deps
='SERVER_MUTEX ndr-krb5pac krb5samba gssapi')
564 bld
.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
565 source
='libads/ldap_printer.c',
566 deps
='samba-util krb5samba')
568 # Only smbconf should link against this subsystem, else we will create
569 # a circular dependency.
570 bld
.SAMBA3_SUBSYSTEM('SMBCONF_PARAM',
574 lib/ldap_debug_handler.c
589 bld
.SAMBA3_LIBRARY('smbconf',
591 lib/smbconf/smbconf_init.c
592 lib/smbconf/smbconf_reg.c
607 public_headers
='../lib/smbconf/smbconf.h',
611 bld
.SAMBA3_LIBRARY('smbd_conn',
612 source
='smbd/conn.c',
613 deps
='samba3-util samba-util',
614 private_library
=True)
616 bld
.SAMBA3_SUBSYSTEM('sysquotas',
619 lib/sysquotas_linux.c
626 deps
='samba3-util samba-util')
631 if bld
.CONFIG_SET("HAVE_INOTIFY"):
632 NOTIFY_SOURCES
+= ' smbd/notify_inotify.c'
634 if bld
.CONFIG_SET('SAMBA_FAM_LIBS'):
635 NOTIFY_SOURCES
+= ' smbd/notify_fam.c'
636 NOTIFY_DEPS
+= ' ' + bld
.CONFIG_GET('SAMBA_FAM_LIBS')
638 bld
.SAMBA3_LIBRARY('smbd_base',
678 printing/printspoolss.c
685 smbd/aio.c smbd/statvfs.c
689 smbd/dnsregister.c smbd/globals.c
693 smbd/smb2_sesssetup.c
702 smbd/smb2_ioctl_dfs.c
703 smbd/smb2_ioctl_filesys.c
704 smbd/smb2_ioctl_named_pipe.c
705 smbd/smb2_ioctl_network_fs.c
706 smbd/smb2_keepalive.c
707 smbd/smb2_query_directory.c
712 smbd/smbXsrv_version.c
713 smbd/smbXsrv_client.c
714 smbd/smbXsrv_session.c
729 ''' + NOTIFY_SOURCES
,
759 bld
.env
['dmapi_lib'] +
760 bld
.env
['legacy_quota_libs'] +
762 private_library
=True)
764 bld
.SAMBA3_SUBSYSTEM('LOCKING',
769 locking/share_mode_lock.c
780 bld
.SAMBA3_SUBSYSTEM('LEASES_DB',
781 source
='locking/leases_db.c',
782 deps
='NDR_LEASES_DB')
784 bld
.SAMBA3_SUBSYSTEM('LEASES_UTIL',
785 source
='locking/leases_util.c',
786 deps
='NDR_OPEN_FILES')
788 if bld
.CONFIG_GET("WITH_PROFILE"):
789 bld
.SAMBA3_SUBSYSTEM('PROFILE',
790 source
='profile/profile.c',
793 bld
.SAMBA3_SUBSYSTEM('PROFILE',
794 source
='profile/profile_dummy.c',
797 bld
.SAMBA3_SUBSYSTEM('PRINTBASE',
800 printing/printing_db.c
807 bld
.SAMBA3_SUBSYSTEM('PRINTBACKEND',
810 printing/nt_printing.c
811 printing/nt_printing_tdb.c
812 printing/nt_printing_migrate_internal.c
813 printing/nt_printing_ads.c
814 printing/queue_process.c
824 bld
.SAMBA3_LIBRARY('printing_migrate',
826 printing/nt_printing_migrate.c
827 rpc_client/cli_winreg_spoolss.c
828 printing/nt_printing_os2.c
837 private_library
=True)
839 bld
.SAMBA3_SUBSYSTEM('PRINTING',
842 printing/print_svid.c
844 printing/print_cups.c
845 printing/print_generic.c
848 printing/print_standard.c
849 printing/print_iprint.c
850 printing/printer_list.c
858 bld
.SAMBA3_SUBSYSTEM('FNAME_UTIL',
859 source
='lib/filename_util.c',
862 bld
.SAMBA3_SUBSYSTEM('LIBNET',
863 source
='libnet/libnet_join.c',
864 deps
='NDR_LIBNET_JOIN INIT_SAMR net_keytab pdb')
866 bld
.SAMBA3_LIBRARY('net_keytab',
867 source
='libnet/libnet_keytab.c',
868 deps
='krb5samba ads',
869 private_library
=True)
872 bld
.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
874 libnet/libnet_dssync.c
875 libnet/libnet_dssync_passdb.c
876 libnet/libnet_dssync_keytab.c
883 bld
.SAMBA3_SUBSYSTEM('LIBNET_SAMSYNC',
885 libnet/libnet_samsync.c
886 libnet/libnet_samsync_ldif.c
887 libnet/libnet_samsync_passdb.c
888 libnet/libnet_samsync_display.c
889 libnet/libnet_samsync_keytab.c
896 bld
.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
897 source
='lib/eventlog/eventlog.c',
898 deps
='NDR_EVENTLOG tdb')
900 bld
.SAMBA3_SUBSYSTEM('LIBNMB',
907 libads/sitename_cache.c
917 bld
.SAMBA3_SUBSYSTEM('SERVICES',
919 services/svc_spoolss.c
920 services/svc_rcinit.c
921 services/svc_winreg_glue.c
922 services/svc_netlogon.c
923 services/svc_winreg.c
928 bld
.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
938 bld
.SAMBA3_SUBSYSTEM('PASSCHANGE',
939 source
='libsmb/passchange.c',
947 bld
.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
948 source
='lib/version.c',
951 bld
.SAMBA3_SUBSYSTEM('SLCACHE',
952 source
='libsmb/samlogon_cache.c',
958 bld
.SAMBA3_SUBSYSTEM('DCUTIL',
960 libsmb/namequery_dc.c
961 libsmb/trustdom_cache.c
970 bld
.SAMBA3_LIBRARY('trusts_util',
971 source
='libsmb/trusts_util.c',
977 private_library
=True)
979 bld
.SAMBA3_SUBSYSTEM('tdb-wrap3',
980 source
='lib/util_tdb.c',
981 deps
='talloc samba3-util')
983 bld
.SAMBA3_LIBRARY('samba3-util',
997 private_library
=True)
999 bld
.SAMBA_LIBRARY('xattr_tdb',
1000 source
='lib/xattr_tdb.c',
1001 deps
='NDR_XATTR dbwrap samba3-util',
1002 private_library
=True)
1004 bld
.SAMBA3_LIBRARY('CHARSET3',
1017 private_library
=True)
1019 bld
.SAMBA3_SUBSYSTEM('errors3',
1025 deps
='samba-errors')
1027 bld
.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
1028 source
='rpc_client/cli_samr.c',
1029 deps
='RPC_NDR_SAMR')
1031 bld
.SAMBA3_LIBRARY('libcli_lsa3',
1032 source
='rpc_client/cli_lsarpc.c',
1033 deps
='RPC_NDR_LSA INIT_LSA',
1034 private_library
=True)
1036 bld
.SAMBA3_LIBRARY('libcli_netlogon3',
1038 rpc_client/cli_netlogon.c
1039 rpc_client/util_netlogon.c
1047 NETLOGON_CREDS_CLI''',
1048 private_library
=True)
1050 bld
.SAMBA3_LIBRARY('cli_spoolss',
1052 rpc_client/cli_spoolss.c
1053 rpc_client/init_spoolss.c
1059 private_library
=True)
1061 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
1062 source
='rpc_client/cli_winreg.c',
1063 deps
='RPC_NDR_WINREG')
1065 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG_INTERNAL',
1066 source
='rpc_client/cli_winreg_int.c',
1067 deps
='LIBCLI_WINREG RPC_SERVER')
1069 bld
.SAMBA3_SUBSYSTEM('RPC_CLIENT_SCHANNEL',
1070 source
='rpc_client/cli_pipe_schannel.c',
1071 deps
='samba-util krb5samba')
1073 bld
.SAMBA3_SUBSYSTEM('INIT_LSA',
1074 source
='rpc_client/init_lsa.c',
1077 bld
.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
1078 source
='rpc_client/init_netlogon.c',
1081 bld
.SAMBA3_SUBSYSTEM('INIT_SAMR',
1082 source
='rpc_client/init_samr.c',
1085 bld
.SAMBA3_SUBSYSTEM('LIBLSA',
1088 bld
.SAMBA3_SUBSYSTEM('SPOOLSSD',
1089 source
='printing/spoolssd.c',
1095 ########################## BINARIES #################################
1097 bld
.SAMBA3_BINARY('smbd/smbd',
1098 source
='smbd/server.c smbd/smbd_cleanupd.c',
1108 install_path
='${SBINDIR}')
1111 bld
.SAMBA3_SUBSYSTEM('TDB_VALIDATE',
1112 source
='lib/tdb_validate.c',
1116 bld
.SAMBA3_BINARY('client/smbclient',
1135 bld
.SAMBA3_BINARY('smbspool',
1136 source
='client/smbspool.c',
1145 bld
.SAMBA3_BINARY('smbspool_krb5_wrapper',
1146 source
='client/smbspool_krb5_wrapper.c',
1151 install_path
='${LIBEXECDIR}/samba',
1152 enabled
=bld
.CONFIG_SET('HAVE_CUPS'))
1154 bld
.SAMBA3_BINARY('locktest2',
1155 source
='torture/locktest2.c',
1164 smbstatus_source
= 'utils/status.c smbd/notify_msg.c'
1166 if bld
.CONFIG_GET("WITH_PROFILE"):
1167 smbstatus_source
+= ' utils/status_profile.c'
1169 smbstatus_source
+= ' utils/status_profile_dummy.c'
1171 bld
.SAMBA3_BINARY('smbstatus',
1172 source
=smbstatus_source
,
1182 bld
.SAMBA3_BINARY('smbtorture' + bld
.env
.suffix3
,
1189 torture/mangle_test.c
1191 torture/test_async_echo.c
1192 torture/test_addrchange.c
1193 torture/test_posix_append.c
1194 torture/test_nttrans_create.c
1195 torture/test_nttrans_fsctl.c
1196 torture/test_case_insensitive.c
1197 torture/test_notify_online.c
1198 torture/test_chain3.c
1200 torture/test_authinfo_structs.c
1201 torture/test_smbsock_any_connect.c
1202 torture/test_cleanup.c
1203 torture/test_notify.c
1204 lib/tevent_barrier.c
1205 torture/test_dbwrap_watch.c
1206 torture/test_idmap_tdb_common.c
1207 torture/test_dbwrap_ctdb.c
1208 torture/test_buffersize.c
1209 torture/test_messaging_read.c
1210 torture/test_messaging_fd_passing.c
1211 torture/test_oplock_cancel.c
1212 torture/test_pthreadpool_tevent.c
1213 torture/bench_pthreadpool.c
1228 samba-cluster-support
1230 cflags
='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld
.env
.WINBINDD_SOCKET_DIR
,
1233 bld
.SAMBA3_BINARY('smbconftort',
1234 source
='lib/smbconf/testsuite.c',
1242 bld
.SAMBA3_BINARY('replacetort',
1243 source
='../lib/replace/test/main.c',
1244 deps
='replace replace-test',
1247 bld
.SAMBA3_BINARY('msgtest',
1248 source
='torture/msgtest.c',
1255 bld
.SAMBA3_BINARY('msg_sink',
1256 source
='torture/msg_sink.c',
1263 bld
.SAMBA3_BINARY('msg_source',
1264 source
='torture/msg_source.c',
1271 bld
.SAMBA3_BINARY('pdbtest',
1272 source
='torture/pdbtest.c',
1282 bld
.SAMBA3_BINARY('vfstest',
1286 torture/vfstest_chain.c
1296 bld
.SAMBA3_BINARY('versiontest',
1297 source
='lib/version_test.c',
1304 bld
.SAMBA3_BINARY('timelimit',
1305 source
='script/tests/timelimit.c',
1308 bld
.SAMBA3_BINARY('rpc_open_tcp',
1309 source
='torture/rpc_open_tcp.c',
1316 bld
.SAMBA3_BINARY('vlp',
1317 source
='printing/tests/vlp.c',
1324 bld
.SAMBA3_PYTHON('pysmbd',
1325 source
='smbd/pysmbd.c',
1326 deps
='smbd_base pyrpc_util pytalloc-util',
1327 realname
='samba/samba3/smbd.so'
1330 bld
.SAMBA3_PYTHON('pylibsmb',
1331 source
='libsmb/pylibsmb.c',
1332 deps
='smbclient samba-credentials pycredentials',
1333 realname
='samba/samba3/libsmb_samba_internal.so'
1336 bld
.SAMBA3_BINARY('spotlight2sparql',
1338 rpc_server/mdssvc/sparql_parser_test.c
1339 rpc_server/mdssvc/sparql_parser.c
1340 rpc_server/mdssvc/sparql_lexer.c
1341 rpc_server/mdssvc/sparql_mapping.c''',
1342 deps
='samba3-util talloc ' + bld
.env
['libtracker'],
1343 enabled
=bld
.env
.with_spotlight
,
1346 ########################## INCLUDES #################################
1349 bld
.RECURSE('libgpo/gpext')
1350 bld
.RECURSE('lib/pthreadpool')
1351 bld
.RECURSE('librpc')
1352 bld
.RECURSE('librpc/idl')
1353 bld
.RECURSE('libsmb')
1354 bld
.RECURSE('modules')
1355 bld
.RECURSE('param')
1356 bld
.RECURSE('passdb')
1357 bld
.RECURSE('rpc_server')
1358 bld
.RECURSE('script')
1359 bld
.RECURSE('winbindd')
1360 bld
.RECURSE('../examples/auth')
1361 bld
.RECURSE('../examples/libsmbclient')
1362 bld
.RECURSE('../examples/pdb')
1363 bld
.RECURSE('../examples/VFS')
1364 bld
.RECURSE('../examples/fuse')
1365 bld
.RECURSE('lib/netapi/tests')
1366 bld
.RECURSE('lib/netapi/examples')
1367 bld
.RECURSE('smbd/notifyd')
1368 bld
.RECURSE('rpcclient')
1369 bld
.RECURSE('utils')
1372 bld
.ENFORCE_GROUP_ORDERING()
1373 bld
.CHECK_PROJECT_RULES()