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_LIBRARY('gpo',
98 bld
.SAMBA3_SUBSYSTEM('AVAHI',
101 smbd/avahi_register.c
107 enabled
=bld
.env
.with_avahi
)
109 bld
.SAMBA3_SUBSYSTEM('GROUPDB',
112 groupdb/mapping_tdb.c
116 bld
.SAMBA3_SUBSYSTEM('TLDAP',
120 lib/tldap_gensec_bind.c
128 # libpdb.so should not expose internal symbols that are only usable
129 # to the statically linked modules that are merged into libpdb.
130 # Note that we always filter these symbols out in libpdb, even
131 # when modules are not linked statically. In the latter case
132 # symbols will not be present in the libpdb anyway so no hurt is
133 # done to the version script.
134 private_pdb_match
= []
135 private_pdb_match
.append('!idmap_init')
136 private_pdb_match
.append('!idmap_sids_to_xids')
137 private_pdb_match
.append('!idmap_xids_to_sids')
139 ldapsam_pdb_match
= ['!priv2ld', '!smbldap_search_domain_info',
140 '!ldapsam_*', '!groupmap_attr_list*', '!get_userattr_list',
141 '!dominfo_attr_list', '!get_attr_key2string',
142 '!sidmap_attr_list', '!attrib_map_*', '!idpool_attr_list',
144 private_pdb_match
.append('!pdb_nds_*')
145 private_pdb_match
.append('!pdb_ldapsam_init*')
146 private_pdb_match
.append('!pdb_*_init')
147 private_pdb_match
= private_pdb_match
+ ldapsam_pdb_match
149 bld
.SAMBA3_LIBRARY('samba-passdb',
152 private_library
=False,
153 grouping_library
=True,
155 public_headers_install
=True,
161 abi_match
=private_pdb_match
,
162 abi_directory
='passdb/ABI',
165 bld
.SAMBA3_SUBSYSTEM('pdb',
172 lib/util_sid_passdb.c
181 passdb/pdb_interface.c
183 passdb/pdb_unixid.c''',
194 bld
.SAMBA3_LIBRARY('smbldaphelper',
196 passdb/pdb_ldap_schema.c
197 passdb/pdb_ldap_util.c
199 deps
='smbldap secrets3',
200 allow_undefined_symbols
=True,
201 enabled
=bld
.CONFIG_SET('HAVE_LDAP'),
202 private_library
=True)
204 bld
.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
205 source
='lib/server_mutex.c',
208 # this includes only the low level parse code, not stuff
209 # that requires knowledge of security contexts
210 bld
.SAMBA3_SUBSYSTEM('REG_PARSE_PRS',
211 source
='registry/reg_parse_prs.c')
213 bld
.SAMBA3_SUBSYSTEM('REGFIO',
214 source
='registry/regfio.c',
215 deps
='samba-util REG_PARSE_PRS')
217 bld
.SAMBA3_SUBSYSTEM('REG_API_REGF',
218 source
='registry/reg_api_regf.c',
221 # Do not link against this use 'smbconf'
222 bld
.SAMBA3_SUBSYSTEM('SMBREGISTRY',
225 registry/reg_dispatcher.c
226 registry/reg_cachehook.c
227 registry/reg_objects.c
228 registry/reg_util_internal.c
230 registry/reg_backend_db.c
231 registry/reg_parse_internal.c
233 registry/reg_init_basic.c
250 # Do not link against this use 'smbconf'
251 bld
.SAMBA3_SUBSYSTEM('REG_SMBCONF',
253 registry/reg_backend_smbconf.c
254 registry/reg_init_smbconf.c
255 registry/reg_util_token.c
256 registry/reg_api_util.c
260 bld
.SAMBA3_SUBSYSTEM('REG_FULL',
262 registry/reg_backend_printing.c
263 registry/reg_backend_shares.c
264 registry/reg_backend_netlogon_params.c
265 registry/reg_backend_prod_options.c
266 registry/reg_backend_tcpip_params.c
267 registry/reg_backend_hkpt_params.c
268 registry/reg_backend_current_version.c
269 registry/reg_backend_perflib.c
270 registry/reg_init_full.c
271 registry/reg_perfcount.c''',
277 bld
.SAMBA3_LIBRARY('popt_samba3',
278 source
='lib/popt_common.c',
279 deps
='popt samba-util util_cmdline',
280 private_library
=True)
282 bld
.SAMBA3_LIBRARY('util_cmdline',
283 source
='lib/util_cmdline.c',
285 private_library
=True)
287 bld
.SAMBA3_SUBSYSTEM('KRBCLIENT',
288 source
='libads/kerberos.c libads/ads_status.c',
289 public_deps
='krb5samba asn1util k5crypto gssapi LIBTSOCKET CLDAP LIBNMB')
291 bld
.SAMBA3_SUBSYSTEM('samba3util',
298 lib/util_specialsids.c
305 lib/util_transfer_file.c
321 if bld
.env
.with_ctdb
:
322 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
323 lib/cluster_support.c
324 lib/dbwrap/dbwrap_ctdb.c
328 SAMBA_CLUSTER_SUPPORT_DEPS
='''
334 SAMBA_CLUSTER_SUPPORT_SOURCES
='''
335 lib/cluster_support.c
338 SAMBA_CLUSTER_SUPPORT_DEPS
='''
343 bld
.SAMBA3_LIBRARY('samba-cluster-support',
344 source
=SAMBA_CLUSTER_SUPPORT_SOURCES
,
345 deps
=SAMBA_CLUSTER_SUPPORT_DEPS
,
346 allow_undefined_symbols
=True,
347 private_library
=True)
349 bld
.SAMBA3_SUBSYSTEM('TDB_LIB',
351 lib/dbwrap/dbwrap_open.c
352 lib/dbwrap/dbwrap_watch.c
357 samba-cluster-support
360 bld
.SAMBA3_LIBRARY('messages_dgm',
363 lib/messages_dgm_ref.c
372 private_library
=True)
374 bld
.SAMBA3_LIBRARY('messages_util',
375 source
='''lib/messages_util.c''',
377 private_library
=True)
379 bld
.SAMBA3_SUBSYSTEM('samba3core',
386 lib/server_id_watch.c
387 lib/server_id_db_util.c
389 ../lib/util/debug_s3.c
396 lib/substitute_generic.c
403 lib/server_contexts.c
405 lib/server_prefork_util.c
438 bld
.SAMBA3_LIBRARY('smbd_shim',
439 source
='''lib/smbd_shim.c''',
441 private_library
=True)
443 bld
.SAMBA3_SUBSYSTEM('auth_generic',
444 source
='libsmb/auth_generic.c',
447 bld
.SAMBA3_LIBRARY('libsmb',
456 libsmb/clireadwrite.c
469 libsmb/reparse_symlink.c
471 libsmb/smbsock_connect.c
472 libsmb/cli_smb2_fnum.c
486 private_library
=True)
488 bld
.SAMBA3_SUBSYSTEM('CLDAP',
489 source
='libads/cldap.c',
490 deps
='cli-ldap-common cli_cldap LIBTSOCKET')
492 # NOTE: The secrets3 library is a low level library used by several subsystems.
493 # PLEASE DO NOT make it depend on high level libraries like PDB, if you are
494 # doing that your design is wrong and needs changing. -SSS
495 bld
.SAMBA3_LIBRARY('secrets3',
498 passdb/machine_account_secrets.c
508 private_library
=True)
510 bld
.SAMBA3_LIBRARY('smbldap',
511 source
='lib/smbldap.c',
512 deps
='ldap lber samba-util smbconf',
513 enabled
=bld
.CONFIG_SET("HAVE_LDAP"),
514 private_library
=False,
515 abi_directory
='lib/ABI',
516 abi_match
='smbldap_*',
519 public_headers
='include/smbldap.h include/smb_ldap.h')
521 bld
.SAMBA3_LIBRARY('ads',
525 libads/sasl_wrapping.c
527 libads/kerberos_util.c
530 libads/kerberos_keytab.c
550 private_library
=True)
552 bld
.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
553 source
='libads/authdata.c',
554 deps
='SERVER_MUTEX ndr-krb5pac krb5samba gssapi')
556 bld
.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
557 source
='libads/ldap_printer.c',
558 deps
='samba-util krb5samba')
560 # Only smbconf should link against this subsystem, else we will create
561 # a circular dependency.
562 bld
.SAMBA3_SUBSYSTEM('SMBCONF_PARAM',
566 lib/ldap_debug_handler.c
581 bld
.SAMBA3_LIBRARY('smbconf',
583 lib/smbconf/smbconf_init.c
584 lib/smbconf/smbconf_reg.c
599 public_headers
='../lib/smbconf/smbconf.h',
603 bld
.SAMBA3_LIBRARY('smbd_conn',
604 source
='smbd/conn.c',
605 deps
='samba3-util samba-util',
606 private_library
=True)
608 bld
.SAMBA3_SUBSYSTEM('sysquotas',
611 lib/sysquotas_linux.c
618 deps
='samba3-util samba-util')
623 if bld
.CONFIG_SET("HAVE_INOTIFY"):
624 NOTIFY_SOURCES
+= ' smbd/notify_inotify.c'
626 if bld
.CONFIG_SET('SAMBA_FAM_LIBS'):
627 NOTIFY_SOURCES
+= ' smbd/notify_fam.c'
628 NOTIFY_DEPS
+= ' ' + bld
.CONFIG_GET('SAMBA_FAM_LIBS')
630 bld
.SAMBA3_LIBRARY('smbd_base',
670 printing/printspoolss.c
677 smbd/aio.c smbd/statvfs.c
681 smbd/dnsregister.c smbd/globals.c
685 smbd/smb2_sesssetup.c
694 smbd/smb2_ioctl_dfs.c
695 smbd/smb2_ioctl_filesys.c
696 smbd/smb2_ioctl_named_pipe.c
697 smbd/smb2_ioctl_network_fs.c
698 smbd/smb2_keepalive.c
699 smbd/smb2_query_directory.c
704 smbd/smbXsrv_version.c
705 smbd/smbXsrv_client.c
706 smbd/smbXsrv_session.c
721 ''' + NOTIFY_SOURCES
,
751 bld
.env
['dmapi_lib'] +
752 bld
.env
['legacy_quota_libs'] +
754 private_library
=True)
756 bld
.SAMBA3_SUBSYSTEM('LOCKING',
761 locking/share_mode_lock.c
772 bld
.SAMBA3_SUBSYSTEM('LEASES_DB',
773 source
='locking/leases_db.c',
774 deps
='NDR_LEASES_DB')
776 bld
.SAMBA3_SUBSYSTEM('LEASES_UTIL',
777 source
='locking/leases_util.c',
778 deps
='NDR_OPEN_FILES')
780 if bld
.CONFIG_GET("WITH_PROFILE"):
781 bld
.SAMBA3_SUBSYSTEM('PROFILE',
782 source
='profile/profile.c',
785 bld
.SAMBA3_SUBSYSTEM('PROFILE',
786 source
='profile/profile_dummy.c',
789 bld
.SAMBA3_SUBSYSTEM('PRINTBASE',
792 printing/printing_db.c
799 bld
.SAMBA3_SUBSYSTEM('PRINTBACKEND',
802 printing/nt_printing.c
803 printing/nt_printing_tdb.c
804 printing/nt_printing_migrate_internal.c
805 printing/nt_printing_ads.c
806 printing/queue_process.c
816 bld
.SAMBA3_LIBRARY('printing_migrate',
818 printing/nt_printing_migrate.c
819 rpc_client/cli_winreg_spoolss.c
820 printing/nt_printing_os2.c
829 private_library
=True)
831 bld
.SAMBA3_SUBSYSTEM('PRINTING',
834 printing/print_svid.c
836 printing/print_cups.c
837 printing/print_generic.c
840 printing/print_standard.c
841 printing/print_iprint.c
842 printing/printer_list.c
850 bld
.SAMBA3_SUBSYSTEM('FNAME_UTIL',
851 source
='lib/filename_util.c',
854 bld
.SAMBA3_SUBSYSTEM('LIBNET',
855 source
='libnet/libnet_join.c',
856 deps
='NDR_LIBNET_JOIN INIT_SAMR net_keytab pdb')
858 bld
.SAMBA3_LIBRARY('net_keytab',
859 source
='libnet/libnet_keytab.c',
860 deps
='krb5samba ads',
861 private_library
=True)
864 bld
.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
866 libnet/libnet_dssync.c
867 libnet/libnet_dssync_passdb.c
868 libnet/libnet_dssync_keytab.c
875 bld
.SAMBA3_SUBSYSTEM('LIBNET_SAMSYNC',
877 libnet/libnet_samsync.c
878 libnet/libnet_samsync_ldif.c
879 libnet/libnet_samsync_passdb.c
880 libnet/libnet_samsync_display.c
881 libnet/libnet_samsync_keytab.c
888 bld
.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
889 source
='lib/eventlog/eventlog.c',
890 deps
='NDR_EVENTLOG tdb')
892 bld
.SAMBA3_SUBSYSTEM('LIBNMB',
899 libads/sitename_cache.c
909 bld
.SAMBA3_SUBSYSTEM('SERVICES',
911 services/svc_spoolss.c
912 services/svc_rcinit.c
913 services/svc_winreg_glue.c
914 services/svc_netlogon.c
915 services/svc_winreg.c
920 bld
.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
930 bld
.SAMBA3_SUBSYSTEM('PASSCHANGE',
931 source
='libsmb/passchange.c',
939 bld
.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
940 source
='lib/version.c',
943 bld
.SAMBA3_SUBSYSTEM('SLCACHE',
944 source
='libsmb/samlogon_cache.c',
950 bld
.SAMBA3_SUBSYSTEM('DCUTIL',
952 libsmb/namequery_dc.c
953 libsmb/trustdom_cache.c
962 bld
.SAMBA3_LIBRARY('trusts_util',
963 source
='libsmb/trusts_util.c',
969 private_library
=True)
971 bld
.SAMBA3_SUBSYSTEM('tdb-wrap3',
972 source
='lib/util_tdb.c',
973 deps
='talloc samba3-util')
975 bld
.SAMBA3_LIBRARY('samba3-util',
989 private_library
=True)
991 bld
.SAMBA_LIBRARY('xattr_tdb',
992 source
='lib/xattr_tdb.c',
993 deps
='NDR_XATTR dbwrap samba3-util',
994 private_library
=True)
996 bld
.SAMBA3_LIBRARY('CHARSET3',
1009 private_library
=True)
1011 bld
.SAMBA3_SUBSYSTEM('errors3',
1017 deps
='samba-errors')
1019 bld
.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
1020 source
='rpc_client/cli_samr.c',
1021 deps
='RPC_NDR_SAMR')
1023 bld
.SAMBA3_LIBRARY('libcli_lsa3',
1024 source
='rpc_client/cli_lsarpc.c',
1025 deps
='RPC_NDR_LSA INIT_LSA',
1026 private_library
=True)
1028 bld
.SAMBA3_LIBRARY('libcli_netlogon3',
1030 rpc_client/cli_netlogon.c
1031 rpc_client/util_netlogon.c
1039 NETLOGON_CREDS_CLI''',
1040 private_library
=True)
1042 bld
.SAMBA3_LIBRARY('cli_spoolss',
1044 rpc_client/cli_spoolss.c
1045 rpc_client/init_spoolss.c
1051 private_library
=True)
1053 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
1054 source
='rpc_client/cli_winreg.c',
1055 deps
='RPC_NDR_WINREG')
1057 bld
.SAMBA3_SUBSYSTEM('LIBCLI_WINREG_INTERNAL',
1058 source
='rpc_client/cli_winreg_int.c',
1059 deps
='LIBCLI_WINREG RPC_SERVER')
1061 bld
.SAMBA3_SUBSYSTEM('RPC_CLIENT_SCHANNEL',
1062 source
='rpc_client/cli_pipe_schannel.c',
1063 deps
='samba-util krb5samba')
1065 bld
.SAMBA3_SUBSYSTEM('INIT_LSA',
1066 source
='rpc_client/init_lsa.c',
1069 bld
.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
1070 source
='rpc_client/init_netlogon.c',
1073 bld
.SAMBA3_SUBSYSTEM('INIT_SAMR',
1074 source
='rpc_client/init_samr.c',
1077 bld
.SAMBA3_SUBSYSTEM('LIBLSA',
1080 bld
.SAMBA3_SUBSYSTEM('SPOOLSSD',
1081 source
='printing/spoolssd.c',
1087 ########################## BINARIES #################################
1089 bld
.SAMBA3_BINARY('smbd/smbd',
1090 source
='smbd/server.c smbd/smbd_cleanupd.c',
1100 install_path
='${SBINDIR}')
1103 bld
.SAMBA3_SUBSYSTEM('TDB_VALIDATE',
1104 source
='lib/tdb_validate.c',
1108 bld
.SAMBA3_BINARY('client/smbclient',
1127 bld
.SAMBA3_BINARY('smbspool',
1128 source
='client/smbspool.c',
1137 bld
.SAMBA3_BINARY('smbspool_krb5_wrapper',
1138 source
='client/smbspool_krb5_wrapper.c',
1143 install_path
='${LIBEXECDIR}/samba',
1144 enabled
=bld
.CONFIG_SET('HAVE_CUPS'))
1146 bld
.SAMBA3_BINARY('locktest2',
1147 source
='torture/locktest2.c',
1156 smbstatus_source
= 'utils/status.c smbd/notify_msg.c'
1158 if bld
.CONFIG_GET("WITH_PROFILE"):
1159 smbstatus_source
+= ' utils/status_profile.c'
1161 smbstatus_source
+= ' utils/status_profile_dummy.c'
1163 bld
.SAMBA3_BINARY('smbstatus',
1164 source
=smbstatus_source
,
1174 bld
.SAMBA3_BINARY('smbtorture' + bld
.env
.suffix3
,
1181 torture/mangle_test.c
1183 torture/test_async_echo.c
1184 torture/test_addrchange.c
1185 torture/test_posix_append.c
1186 torture/test_nttrans_create.c
1187 torture/test_nttrans_fsctl.c
1188 torture/test_case_insensitive.c
1189 torture/test_notify_online.c
1190 torture/test_chain3.c
1192 torture/test_authinfo_structs.c
1193 torture/test_smbsock_any_connect.c
1194 torture/test_cleanup.c
1195 torture/test_notify.c
1196 lib/tevent_barrier.c
1197 torture/test_dbwrap_watch.c
1198 torture/test_idmap_tdb_common.c
1199 torture/test_dbwrap_ctdb.c
1200 torture/test_buffersize.c
1201 torture/test_messaging_read.c
1202 torture/test_messaging_fd_passing.c
1203 torture/test_oplock_cancel.c
1204 torture/test_pthreadpool_tevent.c
1205 torture/bench_pthreadpool.c
1207 torture/test_g_lock.c
1221 samba-cluster-support
1223 cflags
='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld
.env
.WINBINDD_SOCKET_DIR
,
1226 bld
.SAMBA3_BINARY('smbconftort',
1227 source
='lib/smbconf/testsuite.c',
1235 bld
.SAMBA3_BINARY('replacetort',
1236 source
='../lib/replace/test/main.c',
1237 deps
='replace replace-test',
1240 bld
.SAMBA3_BINARY('msgtest',
1241 source
='torture/msgtest.c',
1248 bld
.SAMBA3_BINARY('msg_sink',
1249 source
='torture/msg_sink.c',
1256 bld
.SAMBA3_BINARY('msg_source',
1257 source
='torture/msg_source.c',
1264 bld
.SAMBA3_BINARY('pdbtest',
1265 source
='torture/pdbtest.c',
1275 bld
.SAMBA3_BINARY('vfstest',
1279 torture/vfstest_chain.c
1289 bld
.SAMBA3_BINARY('versiontest',
1290 source
='lib/version_test.c',
1297 bld
.SAMBA3_BINARY('timelimit',
1298 source
='script/tests/timelimit.c',
1301 bld
.SAMBA3_BINARY('rpc_open_tcp',
1302 source
='torture/rpc_open_tcp.c',
1309 bld
.SAMBA3_BINARY('vlp',
1310 source
='printing/tests/vlp.c',
1317 bld
.SAMBA3_PYTHON('pysmbd',
1318 source
='smbd/pysmbd.c',
1319 deps
='smbd_base pyrpc_util pytalloc-util',
1320 realname
='samba/samba3/smbd.so'
1323 bld
.SAMBA3_PYTHON('pylibsmb',
1324 source
='libsmb/pylibsmb.c',
1325 deps
='smbclient samba-credentials pycredentials',
1326 realname
='samba/samba3/libsmb_samba_internal.so'
1329 bld
.SAMBA3_BINARY('spotlight2sparql',
1331 rpc_server/mdssvc/sparql_parser_test.c
1332 rpc_server/mdssvc/sparql_parser.y
1333 rpc_server/mdssvc/sparql_lexer.l
1334 rpc_server/mdssvc/sparql_mapping.c''',
1335 deps
='samba3-util talloc ' + bld
.env
['libtracker'],
1336 enabled
=bld
.env
.with_spotlight
,
1339 ########################## INCLUDES #################################
1342 bld
.RECURSE('libgpo/gpext')
1343 bld
.RECURSE('librpc')
1344 bld
.RECURSE('librpc/idl')
1345 bld
.RECURSE('libsmb')
1346 bld
.RECURSE('modules')
1347 bld
.RECURSE('param')
1348 bld
.RECURSE('passdb')
1349 bld
.RECURSE('rpc_server')
1350 bld
.RECURSE('script')
1351 bld
.RECURSE('winbindd')
1352 bld
.RECURSE('../examples/auth')
1353 bld
.RECURSE('../examples/libsmbclient')
1354 bld
.RECURSE('../examples/pdb')
1355 bld
.RECURSE('../examples/VFS')
1356 bld
.RECURSE('../examples/fuse')
1357 bld
.RECURSE('lib/netapi/tests')
1358 bld
.RECURSE('lib/netapi/examples')
1359 bld
.RECURSE('smbd/notifyd')
1360 bld
.RECURSE('rpcclient')
1361 bld
.RECURSE('utils')
1364 bld
.ENFORCE_GROUP_ORDERING()
1365 bld
.CHECK_PROJECT_RULES()