wafsamba: Require public libraries to have a pc file specified, or explicitly specifi...
[samba.git] / source3 / wscript_build
1 #!/usr/bin/env python
2
3 from samba_utils import *
4 import samba_version, samba3
5
6 # enable building of public headers in the build tree
7 bld.env.build_public_headers = 'include/public'
8
9 # these are includes which appear in public headers, but with #ifdef conditional
10 # compilation, so they are safe
11 bld.env.public_headers_skip = ['lib/ldb_compat.h']
12
13 # s3 public headers refer to non-public headers
14 bld.env.public_headers_allow_broken = True
15
16 TDB_LIB_SRC = '''
17           lib/dbwrap/dbwrap_open.c
18           lib/dbwrap/dbwrap_tdb.c
19           lib/dbwrap/dbwrap_ctdb.c
20           lib/g_lock.c'''
21
22 TDB_VALIDATE_SRC = '''lib/tdb_validate.c'''
23
24 SMBLDAP_SRC = '''lib/smbldap.c lib/smbldap_util.c'''
25
26 VERSION_SRC = '''lib/version.c'''
27
28 AFS_SRC = 'lib/afs.c'
29
30 AFS_SETTOKEN_SRC = 'lib/afs_settoken.c'
31
32 AVAHI_SRC = 'lib/avahi.c smbd/avahi_register.c'
33
34 SERVER_MUTEX_SRC = 'lib/server_mutex.c'
35
36 PASSCHANGE_SRC = '''libsmb/passchange.c'''
37
38 COMPRESSION_SRC = '../lib/compression/mszip.c'
39
40 DRSUAPI_SRC = '''${COMPRESSION_SRC}'''
41
42 LIBCLI_SPOOLSS_SRC = '''rpc_client/cli_spoolss.c
43                      rpc_client/init_spoolss.c'''
44
45 LIBCLI_LSA_SRC = '''rpc_client/cli_lsarpc.c'''
46
47 LIBCLI_SAMR_SRC = 'rpc_client/cli_samr.c'
48
49 LIBRPCCLI_NETLOGON_SRC = 'rpc_client/cli_netlogon.c rpc_client/util_netlogon.c'
50
51 # this includes only the low level parse code, not stuff
52 # that requires knowledge of security contexts
53 REG_PARSE_PRS_SRC = '''registry/reg_parse_prs.c'''
54
55 LIB_SRC = '''
56           lib/messages.c lib/messages_local.c
57           lib/messages_ctdbd.c lib/ctdb_packet.c lib/ctdbd_conn.c
58           lib/talloc_dict.c
59           lib/util_sconn.c
60           lib/serverid.c
61           lib/util_transfer_file.c
62           lib/addrchange.c
63           ${TDB_LIB_SRC}
64           ../lib/util/debug_s3.c
65           lib/dumpcore.c
66           lib/interface.c lib/pidfile.c
67           lib/system.c lib/sendfile.c lib/recvfile.c lib/time.c
68           lib/username.c
69           lib/access.c lib/smbrun.c
70           lib/wins_srv.c
71           lib/util_sid.c
72           lib/util_file.c
73           lib/util.c
74           lib/util_sock.c lib/sock_exec.c
75           lib/substitute.c lib/substitute_generic.c
76           lib/ms_fnmatch.c
77           lib/tallocmsg.c lib/dmallocmsg.c
78           libsmb/clisigning.c libsmb/smb_signing.c
79           intl/lang_tdb.c
80           lib/conn_tdb.c lib/gencache.c
81           lib/sessionid_tdb.c
82           lib/module.c lib/events.c
83           lib/server_contexts.c
84           lib/server_prefork.c
85           lib/ldap_escape.c
86           lib/fncall.c
87           libads/krb5_errs.c lib/system_smbd.c lib/audit.c
88           lib/file_id.c lib/idmap_cache.c'''
89
90 POPT_LIB_SRC = '''lib/popt_common.c'''
91
92 PARAM_UTIL_SRC = '''param/util.c'''
93
94 PARAM_WITHOUT_REG_SRC = '''param/loadparm.c param/loadparm_server_role.c
95                            lib/sharesec.c lib/ldap_debug_handler.c lib/util_names.c'''
96
97 KRBCLIENT_SRC = '''libads/kerberos.c libads/ads_status.c libsmb/clikrb5.c'''
98
99 LIBGPO_SRC0 = '''../libgpo/gpo_ldap.c ../libgpo/gpo_ini.c ../libgpo/gpo_util.c
100               ../libgpo/gpo_fetch.c libgpo/gpo_filesync.c ../libgpo/gpo_sec.c
101               libgpo/gpo_reg.c'''
102 LIBGPO_SRC = '''${LIBGPO_SRC0}'''
103
104 LIBADS_SRC = '''libads/ldap.c
105              libads/sasl.c libads/sasl_wrapping.c
106              libads/krb5_setpw.c
107              libads/kerberos_util.c
108              libads/ldap_user.c
109              libads/ads_struct.c libads/kerberos_keytab.c
110              libads/disp_sec.c libads/ldap_utils.c
111              libads/ldap_schema.c libads/util.c libads/ndr.c'''
112
113 LIBADS_SERVER_SRC = '''libads/kerberos_verify.c libads/authdata.c'''
114
115 LIBADS_PRINTER_SRC = '''libads/ldap_printer.c'''
116
117 SECRETS_SRC = '''passdb/secrets.c passdb/machine_account_secrets.c
118                  passdb/machine_sid.c passdb/secrets_lsa.c'''
119
120 LIBNMB_SRC = '''libsmb/unexpected.c libsmb/namecache.c libsmb/nmblib.c
121              libsmb/namequery.c libsmb/conncache.c
122              libads/dns.c libads/sitename_cache.c'''
123
124 LIBNTLMSSP_SRC = '''
125                libsmb/ntlmssp.c
126                libsmb/ntlmssp_wrap.c'''
127
128 TLDAP_SRC = '''lib/tldap.c lib/tldap_util.c lib/util_tsock.c'''
129
130 LIBSMB_SRC = '''libsmb/clientgen.c libsmb/cliconnect.c libsmb/clifile.c
131              libsmb/clispnego.c
132              libsmb/clirap.c libsmb/clierror.c libsmb/climessage.c
133              libsmb/clireadwrite.c libsmb/clilist.c libsmb/cliprint.c
134              libsmb/clitrans.c libsmb/clisecdesc.c libsmb/clidgram.c
135              libsmb/clistr.c libsmb/cliquota.c libsmb/clifsinfo.c libsmb/clidfs.c
136              libsmb/clioplock.c libsmb/clirap2.c
137              libsmb/smb_seal.c libsmb/async_smb.c  libsmb/read_smb.c
138              libsmb/smb2cli_base.c
139              libsmb/smb2cli_negprot.c
140              libsmb/smb2cli_session.c
141              libsmb/smb2cli_tcon.c
142              libsmb/smb2cli_create.c
143              libsmb/smb2cli_close.c
144              libsmb/smb2cli_flush.c
145              libsmb/smb2cli_read.c
146              libsmb/smb2cli_write.c
147              libsmb/smb2cli_query_directory.c
148              libsmb/cli_np_tstream.c
149              libsmb/reparse_symlink.c
150              libsmb/clisymlink.c
151              libsmb/smbsock_connect.c'''
152
153 LIBMSRPC_SRC = '''
154                rpc_client/cli_pipe.c
155                librpc/crypto/gse_krb5.c
156                librpc/crypto/gse.c
157                librpc/crypto/cli_spnego.c
158                librpc/rpc/rpc_common.c
159                rpc_client/rpc_transport_np.c
160                rpc_client/rpc_transport_sock.c
161                rpc_client/rpc_transport_tstream.c
162                librpc/rpc/dcerpc_helpers.c
163                '''
164
165 #
166 # registry-related objects
167 #
168
169 REG_INIT_BASIC_SRC = '''registry/reg_init_basic.c'''
170 REG_INIT_SMBCONF_SRC = '''registry/reg_init_smbconf.c'''
171 REG_INIT_FULL_SRC = '''registry/reg_init_full.c'''
172
173 REGFIO_SRC = '''registry/regfio.c ${REG_PARSE_PRS_SRC}'''
174
175 REG_API_REGF_SRC = '''registry/reg_api_regf.c'''
176
177 REGSRCS_SRC = '''registry/reg_objects.c'''
178
179 REG_BACKENDS_BASE_SRC = '''registry/reg_backend_db.c'''
180
181 REG_BACKENDS_SMBCONF_SRC = '''registry/reg_backend_smbconf.c'''
182
183 REG_BACKENDS_EXTRA_SRC = '''registry/reg_backend_printing.c
184                          registry/reg_backend_shares.c
185                          registry/reg_backend_netlogon_params.c
186                          registry/reg_backend_prod_options.c
187                          registry/reg_backend_tcpip_params.c
188                          registry/reg_backend_hkpt_params.c
189                          registry/reg_backend_current_version.c
190                          registry/reg_backend_perflib.c'''
191
192 REG_BASE_SRC = '''registry/reg_api.c
193                registry/reg_dispatcher.c
194                registry/reg_cachehook.c
195                ${REGSRCS_SRC}
196                registry/reg_util_internal.c
197                lib/util_nttoken.c
198                ${REG_BACKENDS_BASE_SRC}
199                ${REG_INIT_BASIC_SRC}'''
200
201 REG_SMBCONF_SRC = '''
202                   ${REG_BACKENDS_SMBCONF_SRC}
203                   ${REG_INIT_SMBCONF_SRC}
204                   registry/reg_util_token.c
205                   registry/reg_api_util.c'''
206
207 REG_FULL_SRC = '''
208                ${REG_BACKENDS_EXTRA_SRC}
209                ${REG_INIT_FULL_SRC}
210                registry/reg_perfcount.c'''
211
212 SERVICES_SRC = '''services/svc_spoolss.c
213                   services/svc_rcinit.c
214                   services/svc_winreg_glue.c
215                   services/svc_netlogon.c
216                   services/svc_winreg.c
217                   services/svc_wins.c'''
218
219 LIB_EVENTLOG_SRC = '''lib/eventlog/eventlog.c'''
220
221 RPC_CLIENT_SCHANNEL_SRC = '''rpc_client/cli_pipe_schannel.c'''
222
223 LOCKING_SRC = '''locking/locking.c locking/brlock.c locking/posix.c'''
224
225 PRIVILEGES_SRC = '''lib/privileges.c'''
226
227 PASSDB_GET_SET_SRC = '''passdb/pdb_get_set.c'''
228
229 PASSDB_SRC = '''${PASSDB_GET_SET_SRC} passdb/passdb.c
230                 lib/util_wellknown.c lib/util_builtin.c passdb/pdb_compat.c
231                 lib/util_unixsids.c passdb/lookup_sid.c
232                 passdb/login_cache.c
233                 passdb/account_pol.c ${PRIVILEGES_SRC}
234                 lib/util_nscd.c lib/winbind_util.c ${SERVER_MUTEX_SRC}
235                 passdb/pdb_util.c passdb/pdb_interface.c'''
236 #FIXME: lib/winbind_util.c probably is not part of PASSDB_SRC
237
238 GROUPDB_SRC = '''groupdb/mapping.c groupdb/mapping_tdb.c'''
239
240 PROFILE_SRC = '''profile/profile.c'''
241 PROFILES_SRC = '''utils/profiles.c'''
242
243 OPLOCK_SRC = '''smbd/oplock.c smbd/oplock_irix.c smbd/oplock_linux.c
244              smbd/oplock_onefs.c'''
245
246 NOTIFY_SRC = '''smbd/notify.c smbd/notify_inotify.c smbd/notify_internal.c'''
247
248 FNAME_UTIL_SRC = '''lib/filename_util.c'''
249
250
251 PLAINTEXT_AUTH_SRC = '''auth/pampass.c auth/pass_check.c'''
252
253 SLCACHE_SRC = '''libsmb/samlogon_cache.c'''
254
255 DCUTIL_SRC  = '''libsmb/namequery_dc.c libsmb/trustdom_cache.c libsmb/trusts_util.c libsmb/dsgetdcname.c'''
256
257 WINBINDD_SRC1 = '''winbindd/winbindd.c
258                    winbindd/winbindd_group.c
259                    winbindd/winbindd_util.c
260                    winbindd/winbindd_cache.c
261                    winbindd/winbindd_pam.c
262                    winbindd/winbindd_misc.c
263                    winbindd/winbindd_cm.c
264                    winbindd/winbindd_wins_byip.c
265                    winbindd/winbindd_wins_byname.c
266                    winbindd/winbindd_msrpc.c
267                    winbindd/winbindd_rpc.c
268                    winbindd/winbindd_reconnect.c
269                    winbindd/winbindd_ads.c
270                    winbindd/winbindd_samr.c
271                    winbindd/winbindd_dual.c
272                    winbindd/winbindd_dual_ndr.c
273                    winbindd/winbindd_dual_srv.c
274                    winbindd/winbindd_async.c
275                    winbindd/winbindd_creds.c
276                    winbindd/winbindd_cred_cache.c
277                    winbindd/winbindd_ccache_access.c
278                    winbindd/winbindd_domain.c
279                    winbindd/winbindd_idmap.c
280                    winbindd/winbindd_locator.c
281                    winbindd/winbindd_ndr.c
282                    winbindd/wb_ping.c
283                    winbindd/wb_lookupsid.c
284                    winbindd/wb_lookupsids.c
285                    winbindd/wb_lookupname.c
286                    winbindd/wb_sid2uid.c
287                    winbindd/wb_sid2gid.c
288                    winbindd/wb_uid2sid.c
289                    winbindd/wb_gid2sid.c
290                    winbindd/wb_queryuser.c
291                    winbindd/wb_lookupuseraliases.c
292                    winbindd/wb_lookupusergroups.c
293                    winbindd/wb_getpwsid.c
294                    winbindd/wb_gettoken.c
295                    winbindd/wb_seqnum.c
296                    winbindd/wb_seqnums.c
297                    winbindd/wb_group_members.c
298                    winbindd/wb_getgrsid.c
299                    winbindd/wb_query_user_list.c
300                    winbindd/wb_fill_pwent.c
301                    winbindd/wb_next_pwent.c
302                    winbindd/wb_next_grent.c
303                    winbindd/wb_dsgetdcname.c
304                    winbindd/winbindd_lookupsid.c
305                    winbindd/winbindd_lookupsids.c
306                    winbindd/winbindd_lookupname.c
307                    winbindd/winbindd_sid_to_uid.c
308                    winbindd/winbindd_sid_to_gid.c
309                    winbindd/winbindd_uid_to_sid.c
310                    winbindd/winbindd_gid_to_sid.c
311                    winbindd/winbindd_sids_to_xids.c
312                    winbindd/winbindd_allocate_uid.c
313                    winbindd/winbindd_allocate_gid.c
314                    winbindd/winbindd_getpwsid.c
315                    winbindd/winbindd_getpwnam.c
316                    winbindd/winbindd_getpwuid.c
317                    winbindd/winbindd_getsidaliases.c
318                    winbindd/winbindd_getuserdomgroups.c
319                    winbindd/winbindd_getgroups.c
320                    winbindd/winbindd_show_sequence.c
321                    winbindd/winbindd_getgrgid.c
322                    winbindd/winbindd_getgrnam.c
323                    winbindd/winbindd_getusersids.c
324                    winbindd/winbindd_lookuprids.c
325                    winbindd/winbindd_setpwent.c
326                    winbindd/winbindd_getpwent.c
327                    winbindd/winbindd_endpwent.c
328                    winbindd/winbindd_setgrent.c
329                    winbindd/winbindd_getgrent.c
330                    winbindd/winbindd_endgrent.c
331                    winbindd/winbindd_dsgetdcname.c
332                    winbindd/winbindd_getdcname.c
333                    winbindd/winbindd_list_users.c
334                    winbindd/winbindd_list_groups.c
335                    winbindd/winbindd_check_machine_acct.c
336                    winbindd/winbindd_change_machine_acct.c
337                    winbindd/winbindd_ping_dc.c
338                    winbindd/winbindd_pam_auth.c
339                    winbindd/winbindd_pam_logoff.c
340                    winbindd/winbindd_pam_chauthtok.c
341                    winbindd/winbindd_pam_auth_crap.c
342                    winbindd/winbindd_pam_chng_pswd_auth_crap.c'''
343
344 WINBINDD_SRC = '''${WINBINDD_SRC1}
345                   ${TDB_VALIDATE_SRC}'''
346
347 MANGLE_SRC = '''smbd/mangle.c smbd/mangle_hash.c smbd/mangle_hash2.c'''
348
349 SMBD_SRC_MAIN = '''smbd/server.c smbd/msg_idmap.c'''
350
351 BUILDOPT_SRC = '''smbd/build_options.c'''
352
353 SMBD_SRC_SRV = '''smbd/server_reload.c smbd/files.c smbd/connection.c
354                smbd/utmp.c smbd/session.c
355                smbd/dfree.c smbd/dir.c smbd/password.c smbd/conn_msg.c
356                smbd/conn_idle.c
357                smbd/share_access.c smbd/fileio.c
358                smbd/ipc.c smbd/lanman.c smbd/negprot.c
359                smbd/message.c smbd/nttrans.c smbd/pipes.c
360                smbd/reply.c smbd/sesssetup.c smbd/trans2.c smbd/uid.c
361                smbd/dosmode.c smbd/filename.c smbd/open.c smbd/close.c
362                smbd/blocking.c smbd/sec_ctx.c smbd/srvstr.c
363                smbd/vfs.c smbd/perfcount.c smbd/statcache.c smbd/seal.c
364                smbd/posix_acls.c lib/sysacls.c
365                smbd/process.c smbd/service.c smbd/error.c
366                printing/printspoolss.c printing/spoolssd.c
367                lib/sysquotas.c lib/sysquotas_linux.c
368                lib/sysquotas_xfs.c lib/sysquotas_4A.c
369                lib/sysquotas_nfs.c
370                smbd/fake_file.c
371                smbd/quotas.c smbd/ntquotas.c smbd/msdfs.c
372                smbd/aio.c smbd/statvfs.c
373                smbd/dmapi.c smbd/signing.c
374                smbd/file_access.c
375                smbd/dnsregister.c smbd/globals.c
376                smbd/smb2_server.c
377                smbd/smb2_signing.c
378                smbd/smb2_glue.c
379                smbd/smb2_negprot.c
380                smbd/smb2_sesssetup.c
381                smbd/smb2_tcon.c
382                smbd/smb2_create.c
383                smbd/smb2_close.c
384                smbd/smb2_flush.c
385                smbd/smb2_read.c
386                smbd/smb2_write.c
387                smbd/smb2_lock.c
388                smbd/smb2_ioctl.c
389                smbd/smb2_keepalive.c
390                smbd/smb2_find.c
391                smbd/smb2_notify.c
392                smbd/smb2_getinfo.c
393                smbd/smb2_setinfo.c
394                smbd/smb2_break.c
395                smbd/server_exit.c
396                ${MANGLE_SRC}'''
397
398 SMBD_SRC_BASE = '''${SMBD_SRC_SRV}
399                 ${OPLOCK_SRC} ${NOTIFY_SRC}
400                 ${BUILDOPT_SRC}'''
401
402 PRINTING_SRC = '''printing/pcap.c printing/print_svid.c printing/print_aix.c
403                printing/print_cups.c printing/print_generic.c
404                printing/lpq_parse.c printing/load.c printing/print_standard.c
405                printing/print_iprint.c printing/printer_list.c'''
406
407 PRINTBASE_SRC = '''printing/notify.c printing/printing_db.c'''
408 PRINTBACKEND_SRC = '''printing/printing.c
409                       printing/nt_printing.c
410                       printing/nt_printing_tdb.c
411                       printing/nt_printing_migrate_internal.c
412                       printing/nt_printing_ads.c
413                       printing/queue_process.c'''
414
415 NMBD_SRC1 = '''nmbd/asyncdns.c nmbd/nmbd.c nmbd/nmbd_become_dmb.c
416             nmbd/nmbd_become_lmb.c nmbd/nmbd_browserdb.c
417             nmbd/nmbd_browsesync.c nmbd/nmbd_elections.c
418             nmbd/nmbd_incomingdgrams.c nmbd/nmbd_incomingrequests.c
419             nmbd/nmbd_lmhosts.c nmbd/nmbd_logonnames.c nmbd/nmbd_mynames.c
420             nmbd/nmbd_namelistdb.c nmbd/nmbd_namequery.c
421             nmbd/nmbd_nameregister.c nmbd/nmbd_namerelease.c
422             nmbd/nmbd_nodestatus.c nmbd/nmbd_packets.c
423             nmbd/nmbd_processlogon.c nmbd/nmbd_responserecordsdb.c
424             nmbd/nmbd_sendannounce.c nmbd/nmbd_serverlistdb.c
425             nmbd/nmbd_subnetdb.c nmbd/nmbd_winsproxy.c nmbd/nmbd_winsserver.c
426             nmbd/nmbd_workgroupdb.c nmbd/nmbd_synclists.c'''
427
428 NMBD_SRC = '${NMBD_SRC1}'
429
430 SWAT_SRC1 = '''web/cgi.c web/diagnose.c web/startstop.c web/statuspage.c
431                web/swat.c web/neg_lang.c'''
432
433 SWAT_SRC = '''${SWAT_SRC1}'''
434
435 STATUS_SRC = '''utils/status.c utils/status_profile.c'''
436
437 SMBCONTROL_SRC = '''utils/smbcontrol.c'''
438
439 SMBTREE_SRC = '''utils/smbtree.c'''
440
441 TESTPARM_SRC = 'utils/testparm.c'
442
443 SMBTA_UTIL_SRC = '''utils/smbta-util.c'''
444
445 TEST_LP_LOAD_SRC = '''param/test_lp_load.c'''
446
447 PASSWD_UTIL_SRC = 'utils/passwd_util.c'
448
449 SMBPASSWD_SRC = '''utils/smbpasswd.c'''
450
451 PDBEDIT_SRC = '''utils/pdbedit.c'''
452
453 SMBGET_SRC = '''utils/smbget.c'''
454
455 RPCCLIENT_SRC1 = '''rpcclient/rpcclient.c rpcclient/cmd_lsarpc.c
456                     rpcclient/cmd_samr.c rpcclient/cmd_spoolss.c
457                     rpcclient/cmd_netlogon.c rpcclient/cmd_srvsvc.c
458                     rpcclient/cmd_dfs.c rpcclient/cmd_epmapper.c
459                     rpcclient/cmd_dssetup.c rpcclient/cmd_echo.c
460                     rpcclient/cmd_shutdown.c rpcclient/cmd_test.c
461                     rpcclient/cmd_wkssvc.c rpcclient/cmd_ntsvcs.c
462                     rpcclient/cmd_drsuapi.c rpcclient/cmd_eventlog.c
463                     rpcclient/cmd_winreg.c'''
464
465 RPCCLIENT_SRC = '''${RPCCLIENT_SRC1}'''
466
467 LIBSMBCLIENT_THREAD_SRC = '''libsmb/libsmb_thread_impl.c
468                         libsmb/libsmb_thread_posix.c'''
469
470 LIBSMBCLIENT_SRC0 = '''libsmb/libsmb_cache.c
471                     libsmb/libsmb_compat.c
472                     libsmb/libsmb_context.c
473                     libsmb/libsmb_dir.c
474                     libsmb/libsmb_file.c
475                     libsmb/libsmb_misc.c
476                     libsmb/libsmb_path.c
477                     libsmb/libsmb_printjob.c
478                     libsmb/libsmb_server.c
479                     libsmb/libsmb_stat.c
480                     libsmb/libsmb_xattr.c
481                     libsmb/libsmb_setget.c'''
482
483 LIBSMBCLIENT_SRC1 = '''${LIBSMBCLIENT_SRC0}'''
484
485 LIBSMBCLIENT_SRC = '${LIBSMBCLIENT_SRC1}'
486
487 LIBSMBSHAREMODES_SRC0 = 'libsmb/smb_share_modes.c'
488
489 LIBSMBSHAREMODES_SRC = '${LIBSMBSHAREMODES_SRC0}'
490
491 LIBNETAPI_SRC0 = '''lib/netapi/netapi.c
492                     lib/netapi/cm.c
493                     lib/netapi/libnetapi.c
494                     lib/netapi/joindomain.c
495                     lib/netapi/serverinfo.c
496                     lib/netapi/getdc.c
497                     lib/netapi/user.c
498                     lib/netapi/group.c
499                     lib/netapi/localgroup.c
500                     lib/netapi/samr.c
501                     lib/netapi/sid.c
502                     lib/netapi/share.c
503                     lib/netapi/file.c
504                     lib/netapi/shutdown.c
505                     lib/netapi/netlogon.c'''
506
507 LIBNETAPI_SRC = '''${LIBNETAPI_SRC0}'''
508
509 # FIXME:  bigballofmud
510
511 CLIENT_SRC1 = '''client/client.c client/clitar.c
512                  client/dnsbrowse.c'''
513
514 CLIENT_SRC = '''${CLIENT_SRC1}'''
515
516 LIB_SMBCONF_SRC = 'lib/smbconf/smbconf_init.c lib/smbconf/smbconf_reg.c'
517
518 SMBCONFTORT_SRC0 = 'lib/smbconf/testsuite.c'
519
520 SMBCONFTORT_SRC = '''${SMBCONFTORT_SRC0}'''
521
522 LIBNET_SRC = 'libnet/libnet_join.c libnet/libnet_keytab.c'
523
524
525 LIBNET_DSSYNC_SRC = '''libnet/libnet_dssync.c
526                        libnet/libnet_dssync_passdb.c
527                        libnet/libnet_dssync_keytab.c'''
528
529 LIBNET_SAMSYNC_SRC = '''libnet/libnet_samsync.c
530                         libnet/libnet_samsync_ldif.c
531                         libnet/libnet_samsync_passdb.c
532                         libnet/libnet_samsync_display.c
533                         libnet/libnet_samsync_keytab.c'''
534
535 NET_SRC1 = '''utils/net.c utils/net_ads.c utils/net_help.c
536               utils/net_rap.c utils/net_rpc.c utils/net_rpc_samsync.c
537               utils/net_rpc_join.c utils/net_time.c utils/net_lookup.c
538               utils/net_cache.c utils/net_groupmap.c
539               utils/net_idmap.c utils/net_idmap_check.c
540               utils/net_status.c utils/net_rpc_printer.c utils/net_rpc_rights.c
541               utils/net_rpc_service.c utils/net_rpc_registry.c utils/net_usershare.c
542               utils/netlookup.c utils/net_sam.c utils/net_rpc_shell.c
543               utils/net_util.c utils/net_rpc_sh_acct.c utils/net_rpc_audit.c
544               utils/net_dns.c utils/net_ads_gpo.c
545               utils/net_conf.c utils/net_join.c utils/net_user.c
546               utils/net_group.c utils/net_file.c utils/net_registry.c
547               utils/net_dom.c utils/net_share.c
548               utils/net_g_lock.c
549               utils/net_serverid.c
550               utils/net_eventlog.c
551               utils/net_printing.c
552               utils/net_rpc_trust.c
553               registry/reg_parse.c registry/reg_format.c
554               registry/reg_parse_internal.c registry/reg_import.c
555               lib/cbuf.c lib/srprs.c'''
556
557 NET_SRC2 = 'utils/net_registry_util.c utils/net_help_common.c'
558
559 NET_SRC = '''${NET_SRC1}
560              ${NET_SRC2}'''
561
562 CUPS_SRC = '''client/smbspool.c'''
563
564 NMBLOOKUP_SRC = '''utils/nmblookup.c'''
565
566 SMBTORTURE_SRC1 = '''torture/torture.c torture/nbio.c torture/scanner.c torture/utable.c
567                 torture/denytest.c torture/mangle_test.c
568                 torture/nbench.c
569                 torture/test_async_echo.c
570                 torture/test_addrchange.c
571                 torture/test_posix_append.c
572                 torture/test_nttrans_create.c
573                 torture/test_case_insensitive.c
574                 torture/test_notify_online.c
575                 torture/test_smb2.c
576                 torture/test_smbsock_any_connect.c'''
577
578 SMBTORTURE_SRC = '''${SMBTORTURE_SRC1}
579         torture/wbc_async.c'''
580
581 MASKTEST_SRC = '''torture/masktest.c'''
582
583 MSGTEST_SRC = '''torture/msgtest.c'''
584
585 LOCKTEST_SRC = '''torture/locktest.c'''
586
587 PDBTEST_SRC = '''torture/pdbtest.c'''
588
589 VFSTEST_SRC = '''torture/cmd_vfs.c torture/vfstest.c'''
590
591 SMBICONV_SRC = '''torture/smbiconv.c'''
592
593 LOG2PCAP_SRC = '''utils/log2pcaphex.c'''
594
595 LOCKTEST2_SRC = '''torture/locktest2.c'''
596
597 SMBCACLS_SRC = '''utils/smbcacls.c'''
598
599 SMBCQUOTAS_SRC = '''utils/smbcquotas.c'''
600
601 EVTLOGADM_SRC0 = 'utils/eventlogadm.c'
602
603 EVTLOGADM_SRC = '''${EVTLOGADM_SRC0}'''
604
605 SHARESEC_SRC0 = 'utils/sharesec.c'
606 SHARESEC_SRC  = '''${SHARESEC_SRC0}'''
607
608 DEBUG2HTML_SRC = '''utils/debug2html.c utils/debugparse.c'''
609
610 SMBFILTER_SRC = '''utils/smbfilter.c'''
611
612 WINBIND_WINS_NSS_SRC = '''../nsswitch/wins.c'''
613
614 WBINFO_SRC = '''../nsswitch/wbinfo.c'''
615
616 NTLM_AUTH_SRC1 = '''utils/ntlm_auth.c utils/ntlm_auth_diagnostics.c'''
617
618 NTLM_AUTH_SRC = '''${NTLM_AUTH_SRC1}'''
619
620 VLP_SRC = '''printing/tests/vlp.c'''
621
622 RPC_OPEN_TCP_SRC = 'torture/rpc_open_tcp.c'
623
624 DBWRAP_TOOL_SRC = 'utils/dbwrap_tool.c'
625
626 DBWRAP_TORTURE_SRC = 'utils/dbwrap_torture.c'
627
628 SPLIT_TOKENS_SRC = 'utils/split_tokens.c'
629
630 LIBS='ICONV'
631
632 if bld.env.toplevel_build:
633     config_h = "../include/config.h"
634 else:
635     config_h = "include/config.h"
636
637 bld.SAMBA_GENERATOR('build_options',
638                     source= config_h + ' script/mkbuildoptions-waf.awk',
639                     target='smbd/build_options.c',
640                     rule='${AWK} -f ${SRC[1].abspath(env)} > ${TGT} < ${SRC[0].abspath(env)}')
641
642 t = bld.SAMBA_GENERATOR('build_env.h',
643                         source='script/build_env.sh',
644                         target='include/build_env.h',
645                         rule='${SRC} ${SRCDIR} ${BUILDDIR} ${CC} > ${TGT}')
646 # todo: work out what is really wanted here
647 t.env.SRCDIR = bld.path.abspath()
648 t.env.BUILDDIR = bld.path.abspath()
649
650 bld.SETUP_BUILD_GROUPS()
651
652 if not bld.env.toplevel_build:
653     # when using a toplevel build, these are already supplied
654     samba_version.load_version(bld.env)
655     bld.SAMBA_MKVERSION('include/version.h')
656     bld.RECURSE('../lib/replace')
657     bld.RECURSE('../dynconfig')
658     bld.env.suffix3 = ''
659
660
661 ######################## SUBSYSTEMS #################################
662
663 bld.SAMBA3_LIBRARY('netapi',
664                     source=LIBNETAPI_SRC,
665                     public_deps='''talloc tdb_compat cap wbclient smbd_shim libsmb KRBCLIENT
666                     pdb SMBLDAP param samba-util
667                     LIBMSRPC_GEN msrpc3 ads LIBNET DCUTIL NDR_LIBNETAPI
668                     RPC_CLIENT_SCHANNEL smbconf REG_SMBCONF TOKEN_UTIL
669                     LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON
670                     RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_INITSHUTDOWN
671                     INIT_NETLOGON INIT_SAMR popt_samba3''',
672                     public_headers='../source3/lib/netapi/netapi.h',
673                     pc_files=[],
674                     vnum='0',
675                     vars=locals())
676
677 bld.SAMBA3_LIBRARY('libsmb/smbclient',
678                     source=LIBSMBCLIENT_SRC,
679                     public_deps='''talloc tdb_compat wbclient cap param  smbd_shim libsmb KRBCLIENT pdb SMBLDAP
680                     LIBMSRPC_GEN msrpc3 libcli_lsa3 RPC_NDR_SRVSVC popt_samba3''',
681                     public_headers='include/libsmbclient.h',
682                     vnum='0',
683                     pc_files=[],
684                     vars=locals())
685
686 bld.SAMBA3_LIBRARY('smbsharemodes',
687                     source=LIBSMBSHAREMODES_SRC,
688                     public_deps='''talloc tdb_compat''',
689                     deps='''ccan''',
690                     public_headers='include/smb_share_modes.h',
691                     pc_files=[],
692                     vnum='0',
693                     vars=locals())
694
695 bld.SAMBA3_LIBRARY('nss_wins',
696                   source=WINBIND_WINS_NSS_SRC,
697                   deps='''winbind-client param libsmb smbd_shim LIBTSOCKET KRBCLIENT
698                   cap wbclient''',
699                   realname='libnss_wins.so.2',
700                   vnum='2')
701
702 bld.SAMBA3_LIBRARY('msrpc3',
703                    source='${LIBMSRPC_SRC}',
704                    deps='''ndr ndr-standard
705                     RPC_NDR_EPMAPPER NTLMSSP_COMMON COMMON_SCHANNEL LIBCLI_AUTH
706                     LIBTSOCKET KRB5_WRAP dcerpc-binding
707                     libsmb''',
708                    vars=locals(),
709                    private_library=True)
710
711 bld.SAMBA3_SUBSYSTEM('LIBMSRPC_GEN',
712                     source='',
713                     deps='''ndr-standard NDR_DSSETUP NDR_SPOOLSS''',
714                     vars=locals())
715
716 bld.SAMBA3_SUBSYSTEM('LIBGPO',
717                     source='${LIBGPO_SRC}',
718                     deps='gpext talloc',
719                     vars=locals())
720
721 bld.SAMBA3_SUBSYSTEM('AVAHI',
722                     source=AVAHI_SRC,
723                     deps='avahi-common avahi-client',
724                     enabled=bld.env.with_avahi)
725
726 bld.SAMBA3_SUBSYSTEM('GROUPDB',
727                     source=GROUPDB_SRC,
728                     deps='tdb_compat')
729
730 bld.SAMBA3_SUBSYSTEM('TLDAP',
731                     source=TLDAP_SRC,
732                     deps='asn1util LIBTSOCKET')
733
734 bld.SAMBA3_LIBRARY('pdb',
735                    source=PASSDB_SRC,
736                    deps='SECRETS3 SMBLDAP GROUPDB wbclient LIBCLI_AUTH flag_mapping',
737                    private_library=True,
738                    vars=locals())
739
740 bld.SAMBA3_SUBSYSTEM('PARAM_UTIL',
741                     source=PARAM_UTIL_SRC,
742                     deps='samba-util')
743
744 if bld.env.toplevel_build:
745     bld.SAMBA3_SUBSYSTEM('LOADPARM_CTX',
746                          source='param/loadparm_ctx.c',
747                          deps='''s3_param_h param''',
748                          vars=locals())
749
750 bld.SAMBA_GENERATOR('param/param_global_h',
751                     source= 'param/loadparm.c ../script/mkparamdefs.pl',
752                     target='param/param_global.h',
753                     rule='${PERL} ${SRC[1].abspath(env)} ${SRC[0].abspath(env)} --file ${TGT} --generate-scope=GLOBAL')
754
755 bld.SAMBA3_SUBSYSTEM('param',
756                    source=PARAM_WITHOUT_REG_SRC,
757                    deps='samba-util PARAM_UTIL smbd_conn ldap lber LOADPARM_CTX samba3core smbconf param_local_h param/param_global_h''')
758
759 if bld.env.toplevel_build:
760     bld.SAMBA3_PYTHON('pys3param',
761                       source='param/pyparam.c',
762                       deps='param',
763                       public_deps='samba-hostconfig pytalloc-util talloc',
764                       realname='samba/samba3/param.so')
765     
766 bld.SAMBA3_SUBSYSTEM('param_service',
767                      source='param/service.c',
768                      deps = 'USER_UTIL param USER_UTIL PRINTING')
769
770 bld.SAMBA3_SUBSYSTEM('REGFIO',
771                     source=REGFIO_SRC,
772                     deps='samba-util',
773                     vars=locals())
774
775 bld.SAMBA3_SUBSYSTEM('REG_API_REGF',
776                     source=REG_API_REGF_SRC,
777                     deps='samba-util',
778                     vars=locals())
779
780 bld.SAMBA3_LIBRARY('smbregistry',
781                    source=REG_BASE_SRC,
782                    deps='''smbd_shim tdb-wrap3 NDR_SECURITY UTIL_TDB talloc
783                    replace util_reg samba-util security
784                    errors3 adt_tree dbwrap util_str util_sec util_malloc''',
785                    vars=locals(),
786                    allow_undefined_symbols=True,
787                    private_library=True)
788
789 bld.SAMBA3_SUBSYSTEM('REG_SMBCONF',
790                     source=REG_SMBCONF_SRC,
791                     deps='smbregistry',
792                     vars=locals())
793
794 bld.SAMBA3_SUBSYSTEM('REG_FULL',
795                     source=REG_FULL_SRC,
796                     deps='REG_SMBCONF',
797                     vars=locals())
798
799 bld.SAMBA3_LIBRARY('popt_samba3',
800                    source=POPT_LIB_SRC,
801                    deps='popt samba-util util_cmdline',
802                    vars=locals(),
803                    private_library=True)
804
805 bld.SAMBA3_LIBRARY('util_cmdline',
806                    source='lib/util_cmdline.c',
807                    deps='SECRETS3 popt',
808                    private_library=True)
809
810 bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
811                     source=KRBCLIENT_SRC,
812                     public_deps='KRB5_WRAP k5crypto',
813                     vars=locals())
814
815 bld.SAMBA3_SUBSYSTEM('samba3core',
816                    source=LIB_SRC,
817                    deps='LIBTSOCKET LIBCRYPTO ndr security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg PTHREADPOOL interfaces cap string_init param util_str CHARSET3 namearray dbwrap util_sec util_malloc memcache ccan errors3',
818                    vars=locals())
819
820 bld.SAMBA3_LIBRARY('smbd_shim',
821                    source='''lib/smbd_shim.c''', 
822                    private_library=True)
823
824 bld.SAMBA3_SUBSYSTEM('LIBSMB_ERR',
825                     source='',
826                     deps='errors3 pdb ldap lber MSRPC_PARSE LIBCLI_AUTH dcerpc-binding',
827                     vars=locals())
828
829 bld.SAMBA3_SUBSYSTEM('LIBNTLMSSP',
830                     source=LIBNTLMSSP_SRC,
831                     deps='LIBSMB_ERR NDR_NTLMSSP NTLMSSP_COMMON gensec_runtime',
832                     vars=locals())
833
834 bld.SAMBA3_LIBRARY('libsmb',
835                    source=LIBSMB_SRC,
836                    deps='LIBNTLMSSP CLDAP LIBNMB LIBNBT LIBDRSUAPI SPNEGO_PARSE LIBTSOCKET KRBCLIENT cli_smb_common util_cmdline tevent',
837                    vars=locals(),
838                    private_library=True)
839
840 bld.SAMBA3_SUBSYSTEM('LIBDRSUAPI',
841                     source=DRSUAPI_SRC,
842                     deps='z LZXPRESS NDR_DRSUAPI NDR_DRSBLOBS',
843                     vars=locals())
844
845 bld.SAMBA3_SUBSYSTEM('CLDAP',
846                     source='libads/cldap.c',
847                     deps='cli-ldap-common cli_cldap LIBTSOCKET',
848                     vars=locals())
849
850 bld.SAMBA3_SUBSYSTEM('SECRETS3',
851                    source=SECRETS_SRC,
852                    deps='NDR_SECRETS param samba3core pdb',
853                    vars=locals())
854
855 bld.SAMBA3_SUBSYSTEM('SMBLDAP',
856                     source=SMBLDAP_SRC,
857                     deps='ldap lber',
858                     vars=locals(),
859                     enabled=bld.env.HAVE_LDAP)
860
861 bld.SAMBA3_LIBRARY('ads',
862                    source=LIBADS_SRC,
863                    deps='cli-ldap-common KRB5_WRAP ldap lber KRBCLIENT param LIBNMB libsmb DCUTIL',
864                    private_library=True,
865                    vars=locals())
866
867 bld.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
868                     source=LIBADS_SERVER_SRC,
869                     deps='ndr-krb5pac KRB5_WRAP',
870                     vars=locals())
871
872 bld.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
873                     source=LIBADS_PRINTER_SRC,
874                     deps='samba-util',
875                     vars=locals())
876
877 bld.SAMBA3_SUBSYSTEM('LIBAFS',
878                     source=AFS_SRC,
879                     deps='samba-util',
880                     vars=locals())
881
882 bld.SAMBA3_SUBSYSTEM('LIBAFS_SETTOKEN',
883                     source=AFS_SETTOKEN_SRC,
884                     deps='samba-util',
885                     vars=locals())
886
887 bld.SAMBA3_LIBRARY('smbconf',
888                    source=LIB_SMBCONF_SRC,
889                    deps='''LIBSMBCONF smbregistry REG_SMBCONF talloc param
890                    util_reg samba-util errors3 charset SAMBA_VERSION''',
891                    public_headers='../lib/smbconf/smbconf.h',
892                    pc_files=[],
893                    vnum='0')
894
895 bld.SAMBA3_LIBRARY('smbd_conn',
896                    source='smbd/conn.c',
897                    deps='string_init samba-util namearray',
898                    private_library=True)
899
900 bld.SAMBA3_LIBRARY('smbd_base',
901                     source=SMBD_SRC_BASE,
902                     deps='''tdb_compat tevent dl krb5 ldap gssapi gssapi_krb5
903                     samba-util wbclient crypt nsl cups cap z pdb
904                     param samba3core libsmb popt_samba3 KRBCLIENT AVAHI
905                     LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER LIBADS_PRINTER
906                     vfs vfs_default vfs_posixacl auth rpc LOCKING LIBAFS LIBAFS_SETTOKEN PROFILE
907                     PRINTING PRINTBACKEND NDR_XATTR NDR_NOTIFY REGFIO
908                     smbconf REG_FULL FNAME_UTIL
909                     LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON cli_spoolss
910                     RPC_NDR_SRVSVC npa_tstream INIT_NETLOGON INIT_SAMR
911                     cli_smb_common RPC_SERVER smbd_conn param_service
912                     smbd_shim
913                     ''',
914                     private_library=True,
915                     vars=locals())
916
917 bld.SAMBA3_SUBSYSTEM('LOCKING',
918                     source='${LOCKING_SRC}',
919                     deps='''tdb_compat talloc''',
920                     vars=locals())
921
922 bld.SAMBA3_SUBSYSTEM('PROFILE',
923                     source='${PROFILE_SRC}',
924                     deps='samba-util',
925                     vars=locals())
926
927 bld.SAMBA3_SUBSYSTEM('PRINTBASE',
928                     source=PRINTBASE_SRC,
929                     deps='samba-util tdb',
930                     vars=locals())
931
932 bld.SAMBA3_SUBSYSTEM('PRINTBACKEND',
933                     source=PRINTBACKEND_SRC,
934                     deps='PRINTBASE LIBADS_PRINTER tdb printing_migrate',
935                     vars=locals())
936
937 bld.SAMBA3_LIBRARY('printing_migrate',
938                     source='printing/nt_printing_migrate.c rpc_client/cli_winreg_spoolss.c printing/nt_printing_os2.c',
939                     deps='NDR_NTPRINTING cli_spoolss RPC_NDR_WINREG LIBCLI_WINREG param',
940                     vars=locals(),
941                     private_library=True)
942
943 bld.SAMBA3_SUBSYSTEM('PRINTING',
944                     source=PRINTING_SRC,
945                     deps='NDR_PRINTCAP tdb',
946                     vars=locals())
947
948 bld.SAMBA3_SUBSYSTEM('PASSWD_UTIL',
949                     source=PASSWD_UTIL_SRC,
950                     deps='samba-util',
951                     vars=locals())
952
953 bld.SAMBA3_SUBSYSTEM('FNAME_UTIL',
954                     source=FNAME_UTIL_SRC,
955                     deps='samba-util',
956                     vars=locals())
957
958 bld.SAMBA3_SUBSYSTEM('LIBNET',
959                     source=LIBNET_SRC,
960                     deps='NDR_LIBNET_JOIN KRB5_WRAP',
961                     vars=locals())
962
963 bld.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
964                     source=LIBNET_DSSYNC_SRC,
965                     deps='LIBNET LIBCLI_DRSUAPI',
966                     vars=locals())
967
968 bld.SAMBA3_SUBSYSTEM('LIBNET_SAMSYNC',
969                     source=LIBNET_SAMSYNC_SRC,
970                     deps='LIBNET LIBCLI_SAMSYNC',
971                     vars=locals())
972
973 bld.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
974                     source=LIB_EVENTLOG_SRC,
975                     deps='NDR_EVENTLOG tdb',
976                     vars=locals())
977
978 bld.SAMBA3_SUBSYSTEM('LIBNMB',
979                      source=LIBNMB_SRC,
980                      deps='lmhosts resolv',
981                      vars=locals())
982
983 bld.SAMBA3_SUBSYSTEM('LIBNBT',
984                     source='',
985                     deps='NDR_SVCCTL NDR_NBT NDR_NBT_BUF LIBCLI_NETLOGON LIBCLI_NDR_NETLOGON',
986                     vars=locals())
987
988 bld.SAMBA3_SUBSYSTEM('SERVICES',
989                     source=SERVICES_SRC,
990                     deps='samba-util',
991                     vars=locals())
992
993 bld.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
994                     source=PLAINTEXT_AUTH_SRC,
995                     deps='pam PAM_ERRORS',
996                     vars=locals())
997
998 bld.SAMBA3_SUBSYSTEM('PASSCHANGE',
999                     source=PASSCHANGE_SRC,
1000                     deps='LIBCLI_SAMR',
1001                     vars=locals())
1002
1003 bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
1004                     source=VERSION_SRC,
1005                     deps='samba-util',
1006                     vars=locals())
1007
1008 bld.SAMBA3_SUBSYSTEM('SLCACHE',
1009                     source=SLCACHE_SRC,
1010                     deps='samba-util tdb',
1011                     vars=locals())
1012
1013 bld.SAMBA3_SUBSYSTEM('DCUTIL',
1014                     source=DCUTIL_SRC,
1015                      deps='ads LIBRPCCLI_NETLOGON msrpc3 libcli_lsa3 INIT_NETLOGON',
1016                     vars=locals())
1017
1018 bld.SAMBA3_SUBSYSTEM('tdb-wrap3',
1019                     source='lib/util_tdb.c',
1020                      deps='tdb-wrap',
1021                     vars=locals())
1022
1023 bld.SAMBA3_LIBRARY('dbwrap',
1024                    source='lib/dbwrap/dbwrap.c lib/dbwrap/dbwrap_util.c lib/dbwrap/dbwrap_rbt.c',
1025                    deps='samba-util UTIL_TDB errors',
1026                    private_library=True)
1027
1028 bld.SAMBA3_LIBRARY('util_malloc',
1029                    source='''lib/util_malloc.c''',
1030                    deps='samba-util',
1031                    private_library=True)
1032
1033 bld.SAMBA3_LIBRARY('string_init',
1034                    source='''lib/string_init.c''',
1035                    deps='samba-util',
1036                    private_library=True)
1037
1038 bld.SAMBA3_LIBRARY('util_str',
1039                    source='''lib/util_str.c''',
1040                    deps='samba-util charset',
1041                    private_library=True)
1042
1043 bld.SAMBA3_LIBRARY('util_sec',
1044                    source='''lib/util_sec.c''',
1045                    deps='samba-util',
1046                    private_library=True)
1047
1048 bld.SAMBA3_LIBRARY('namearray',
1049                    source='lib/namearray.c',
1050                    deps='samba-util',
1051                    private_library=True)
1052
1053 bld.SAMBA3_LIBRARY('adt_tree',
1054                    source='lib/adt_tree.c',
1055                    deps='samba-util',
1056                    private_library=True)
1057
1058 bld.SAMBA3_LIBRARY('memcache',
1059                    source='lib/memcache.c',
1060                    deps='samba-util util_malloc',
1061                    private_library=True)
1062
1063 bld.SAMBA3_LIBRARY('CHARSET3',
1064                     source='''lib/charcnv.c lib/fstring.c''',
1065                     public_deps='ICONV_WRAPPER charset',
1066                     deps='samba-util util_str',
1067                    private_library=True)
1068
1069 bld.SAMBA3_SUBSYSTEM('errors3',
1070                      source='libsmb/errormap.c libsmb/smberr.c lib/errmap_unix.c',
1071                      deps='errors')
1072
1073 bld.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
1074                     source=LIBCLI_SAMR_SRC,
1075                     deps='RPC_NDR_SAMR')
1076
1077 bld.SAMBA3_LIBRARY('libcli_lsa3',
1078                    source=LIBCLI_LSA_SRC,
1079                    deps='RPC_NDR_LSA INIT_LSA', 
1080                    private_library=True)
1081
1082 bld.SAMBA3_SUBSYSTEM('LIBRPCCLI_NETLOGON',
1083                     source=LIBRPCCLI_NETLOGON_SRC,
1084                     deps='RPC_NDR_NETLOGON')
1085
1086 bld.SAMBA3_LIBRARY('cli_spoolss',
1087                    source=LIBCLI_SPOOLSS_SRC,
1088                    deps='RPC_NDR_SPOOLSS param SECRETS3',
1089                    private_library=True)
1090
1091 bld.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
1092                     source='rpc_client/cli_winreg.c',
1093                     deps='RPC_NDR_WINREG')
1094
1095 bld.SAMBA3_SUBSYSTEM('LIBCLI_WINREG_INTERNAL',
1096                     source='rpc_client/cli_winreg_int.c',
1097                     deps='LIBCLI_WINREG RPC_NCACN_NP')
1098
1099 bld.SAMBA3_SUBSYSTEM('RPC_CLIENT_SCHANNEL',
1100                     source=RPC_CLIENT_SCHANNEL_SRC,
1101                     deps='samba-util',
1102                     vars=locals())
1103
1104 bld.SAMBA3_SUBSYSTEM('INIT_LSA',
1105                     source='rpc_client/init_lsa.c',
1106                     deps='samba-util')
1107
1108 bld.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
1109                     source='rpc_client/init_netlogon.c',
1110                     deps='samba-util')
1111
1112 bld.SAMBA3_SUBSYSTEM('INIT_SAMR',
1113                     source='rpc_client/init_samr.c',
1114                     deps='samba-util')
1115
1116 ########################## BINARIES #################################
1117
1118 bld.SAMBA3_BINARY('smbd/smbd',
1119                  source='${SMBD_SRC_MAIN}',
1120                  deps='smbd_base EPMD',
1121                  install_path='${SBINDIR}',
1122                  vars=locals())
1123
1124 bld.SAMBA3_BINARY('nmbd/nmbd',
1125                  source=NMBD_SRC,
1126                  deps='''talloc tdb_compat tevent z cap wbclient dl
1127                  pdb param ldap smbd_shim libsmb
1128                  popt_samba3 KRBCLIENT NDR_SAMR NDR_LSA PROFILE''',
1129                  install_path='${SBINDIR}',
1130                  vars=locals())
1131
1132 bld.SAMBA3_BINARY('winbindd/winbindd',
1133                  source=WINBINDD_SRC,
1134                  deps='''talloc tdb_compat tevent cap dl z
1135                  wbclient pdb ldap param smbd_shim libsmb
1136                  popt_samba3 KRBCLIENT LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER
1137                  SRV_NDR_WBINT RPC_NDR_WBINT NDR_WBINT LIBAFS
1138                  LIBAFS_SETTOKEN PROFILE SLCACHE DCUTIL idmap nss_info
1139                  TOKEN_UTIL
1140                  LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON
1141                  RPC_NDR_DSSETUP npa_tstream INIT_NETLOGON
1142                  RPC_NCACN_NP RPC_PIPE_REGISTER RPC_SAMR RPC_LSARPC
1143                  PAM_ERRORS WB_REQTRANS auth
1144                  ''',
1145                  enabled=bld.env.build_winbind,
1146                  install_path='${SBINDIR}',
1147                  vars=locals())
1148
1149 bld.SAMBA3_BINARY('web/swat',
1150                  source=SWAT_SRC,
1151                  deps='''talloc tevent cap samba3core libsmb wbclient param
1152                  smbd_shim pdb popt_samba3 KRBCLIENT cups
1153                  LIBMSRPC_GEN msrpc3 LOCKING PLAINTEXT_AUTH PRINTBASE PRINTING FNAME_UTIL
1154                  LIBCLI_SAMR INIT_LSA PASSCHANGE''',
1155                  enabled=bld.env.build_swat,
1156                  install_path='${SBINDIR}',
1157                  vars=locals())
1158
1159 bld.SAMBA3_BINARY('rpcclient/rpcclient',
1160                  source=RPCCLIENT_SRC,
1161                  deps='''talloc tdb_compat cap popt_samba3 pdb libsmb smbd_shim
1162                  param wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3
1163                  ads SMBREADLINE DCUTIL RPC_NDR_WINREG RPC_NDR_ECHO
1164                  RPC_CLIENT_SCHANNEL
1165                  LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON cli_spoolss
1166                  RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_DSSETUP RPC_NDR_DFS
1167                  RPC_NDR_DRSUAPI RPC_NDR_NTSVCS RPC_NDR_EVENTLOG INIT_NETLOGON
1168                  INIT_SAMR
1169                  ''',
1170                  vars=locals())
1171
1172 bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3,
1173                  source=CLIENT_SRC,
1174                  deps='''talloc tdb_compat cap popt_samba3 pdb libsmb smbd_shim
1175                  param wbclient param KRBCLIENT LIBMSRPC_GEN
1176                  msrpc3 SMBREADLINE libsmb/smbclient RPC_NDR_SRVSVC INIT_LSA
1177                  cli_smb_common''',
1178                  vars=locals())
1179
1180 bld.SAMBA3_BINARY('net',
1181                  source=NET_SRC,
1182                  deps='''talloc tdb_compat netapi addns cap intl popt_samba3 pdb libsmb smbd_shim
1183                  param wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3 LIBGPO ads LIBADS_SERVER LIBADS_PRINTER
1184                  LIBAFS LIBAFS_SETTOKEN SMBREADLINE PASSWD_UTIL LIBNET
1185                  LIBNET_DSSYNC LIBNET_SAMSYNC LIBEVENTLOG DCUTIL
1186                  REGFIO NDR_NTPRINTING RPC_NDR_WINREG
1187                  RPC_CLIENT_SCHANNEL TOKEN_UTIL
1188                  LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON cli_spoolss
1189                  RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_SVCCTL RPC_NDR_DSSETUP
1190                  RPC_NDR_INITSHUTDOWN RPC_NDR_DRSUAPI INIT_NETLOGON INIT_SAMR
1191                  printing_migrate
1192                  ''',
1193                  vars=locals())
1194
1195 bld.SAMBA3_BINARY('profiles',
1196                  source=PROFILES_SRC,
1197                  deps='''talloc tdb_compat cap tevent popt_samba3 param samba3core LIBSMB_ERR smbd_shim REGFIO''',
1198                  vars=locals())
1199
1200 bld.SAMBA3_BINARY('smbspool',
1201                  source=CUPS_SRC,
1202                  deps='''talloc tdb_compat tevent cap wbclient popt_samba3 param libsmb smbd_shim samba3core
1203                  KRBCLIENT asn1util LIBTSOCKET NDR_SAMR NDR_LSA''',
1204                  vars=locals())
1205
1206 bld.SAMBA3_BINARY('testparm',
1207                  source=TESTPARM_SRC,
1208                  deps='''talloc tevent ldap cap 
1209                  wbclient asn1util LIBTSOCKET pdb param smbd_shim
1210                  LIBSMB_ERR popt_samba3''',
1211                  vars=locals())
1212
1213 bld.SAMBA3_BINARY('smbta-util',
1214                  source=SMBTA_UTIL_SRC,
1215                  deps='''talloc tdb_compat tevent cap param popt_samba3 smbd_shim
1216                  LIBSMB_ERR''',
1217                  vars=locals())
1218
1219 bld.SAMBA3_BINARY('smbstatus',
1220                  source=STATUS_SRC,
1221                  deps='''talloc tdb_compat tevent cap param popt_samba3 smbd_shim
1222                  LIBSMB_ERR LOCKING PROFILE FNAME_UTIL''',
1223                  vars=locals())
1224
1225 bld.SAMBA3_BINARY('smbcontrol',
1226                  source=SMBCONTROL_SRC,
1227                  deps='''talloc tdb_compat tevent cap param smbd_shim LIBSMB_ERR popt_samba3 PRINTBASE''',
1228                  vars=locals())
1229
1230 bld.SAMBA3_BINARY('smbtree',
1231                  source=SMBTREE_SRC,
1232                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
1233                  libsmb LIBSMB_ERR popt_samba3 KRBCLIENT pdb SMBLDAP LIBMSRPC_GEN msrpc3 PROFILE
1234                  RPC_NDR_SRVSVC''',
1235                  vars=locals())
1236
1237 bld.SAMBA3_BINARY('smbpasswd',
1238                  source=SMBPASSWD_SRC,
1239                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
1240                  libsmb LIBSMB_ERR popt_samba3 KRBCLIENT pdb SMBLDAP LIBMSRPC_GEN msrpc3 PASSWD_UTIL
1241                  LIBCLI_SAMR INIT_LSA PASSCHANGE''',
1242                  vars=locals())
1243
1244 bld.SAMBA3_BINARY('pdbedit',
1245                  source=PDBEDIT_SRC,
1246                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
1247                  LIBNTLMSSP LIBSMB_ERR popt_samba3 pdb SMBLDAP
1248                  PASSWD_UTIL cli-ldap-common''',
1249                  vars=locals())
1250
1251 bld.SAMBA3_BINARY('smbget',
1252                  source=SMBGET_SRC,
1253                  deps='''talloc tdb_compat libsmb/smbclient popt_samba3''',
1254                  vars=locals())
1255
1256 bld.SAMBA3_BINARY('nmblookup' + bld.env.suffix3,
1257                  source=NMBLOOKUP_SRC,
1258                  deps='''talloc tdb_compat tevent cap param smbd_shim popt_samba3 LIBSMB_ERR LIBNMB''',
1259                  vars=locals())
1260
1261 bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
1262                  source=SMBTORTURE_SRC,
1263                  deps='''talloc tdb_compat tevent cap wbclient param libsmb KRBCLIENT TLDAP
1264                  smbd_shim popt_samba3 asn1util LIBTSOCKET NDR_LSA msrpc3 LIBMSRPC_GEN RPC_NDR_ECHO WB_REQTRANS''',
1265                  vars=locals())
1266
1267 bld.SAMBA3_BINARY('smbconftort',
1268                  source=SMBCONFTORT_SRC,
1269                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim LIBSMB_ERR popt_samba3''',
1270                  vars=locals())
1271
1272 bld.SAMBA3_BINARY('replacetort',
1273                  source='../lib/replace/test/main.c',
1274                  deps='replace replace-test',
1275                  install=False)
1276
1277 bld.SAMBA3_BINARY('masktest' + bld.env.suffix3,
1278                  source=MASKTEST_SRC,
1279                  deps='''talloc tdb_compat cap wbclient param smbd_shim libsmb KRBCLIENT
1280                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA''',
1281                  vars=locals())
1282
1283 bld.SAMBA3_BINARY('msgtest',
1284                  source=MSGTEST_SRC,
1285                  deps='''talloc tdb_compat tevent cap param LIBSMB_ERR smbd_shim''',
1286                  vars=locals())
1287
1288 bld.SAMBA3_BINARY('smbcacls',
1289                  source=SMBCACLS_SRC,
1290                  deps='''talloc tdb_compat cap wbclient param libsmb KRBCLIENT
1291                  smbd_shim pdb popt_samba3 SMBLDAP LIBMSRPC_GEN
1292                  msrpc3 libcli_lsa3''',
1293                  vars=locals())
1294
1295 bld.SAMBA3_BINARY('smbcquotas',
1296                  source=SMBCQUOTAS_SRC,
1297                  deps='''talloc tdb_compat cap wbclient param  smbd_shim libsmb KRBCLIENT
1298                  popt_samba3 pdb SMBLDAP LIBMSRPC_GEN msrpc3
1299                  libcli_lsa3''',
1300                  vars=locals())
1301
1302 bld.SAMBA3_BINARY('eventlogadm',
1303                  source=EVTLOGADM_SRC,
1304                  deps='''talloc tevent cap popt_samba3 samba3core param
1305                  smbd_shim LIBSMB_ERR pdb wbclient LIBEVENTLOG''',
1306                  vars=locals())
1307
1308 bld.SAMBA3_BINARY('sharesec',
1309                  source=SHARESEC_SRC,
1310                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim LIBSMB_ERR popt_samba3''',
1311                  vars=locals())
1312
1313 bld.SAMBA3_BINARY('locktest' + bld.env.suffix3,
1314                  source=LOCKTEST_SRC,
1315                  deps='''talloc tdb_compat tevent cap wbclient param KRBCLIENT libsmb smbd_shim
1316                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA LOCKING FNAME_UTIL''',
1317                  vars=locals())
1318
1319 bld.SAMBA3_BINARY('pdbtest',
1320                  source=PDBTEST_SRC,
1321                  deps='''talloc tdb_compat cap wbclient param libsmb KRBCLIENT smbd_shim pdb
1322                  SMBLDAP popt_samba3 NDR_SAMR NDR_LSA''',
1323                  vars=locals())
1324
1325 bld.SAMBA3_BINARY('vfstest',
1326                  source=VFSTEST_SRC,
1327                  deps='smbd_base SMBREADLINE',
1328                  vars=locals())
1329
1330 bld.SAMBA3_BINARY('smbiconv',
1331                  source=SMBICONV_SRC,
1332                  deps='''talloc tdb_compat tevent cap param smbd_shim popt_samba3 LIBSMB_ERR''',
1333                  vars=locals())
1334
1335 bld.SAMBA3_BINARY('log2pcap',
1336                  source=LOG2PCAP_SRC,
1337                  deps='''talloc popt''',
1338                  vars=locals())
1339
1340 bld.SAMBA3_BINARY('locktest2',
1341                  source=LOCKTEST2_SRC,
1342                  deps='''talloc tdb_compat tevent cap wbclient param KRBCLIENT libsmb smbd_shim
1343                  asn1util LIBTSOCKET NDR_SAMR NDR_LSA LOCKING FNAME_UTIL''',
1344                  vars=locals())
1345
1346 bld.SAMBA3_BINARY('debug2html',
1347                  source=DEBUG2HTML_SRC,
1348                  deps='''talloc popt''',
1349                  vars=locals())
1350
1351 bld.SAMBA3_BINARY('smbfilter',
1352                  source=SMBFILTER_SRC,
1353                  deps='''talloc tevent cap wbclient param libsmb smbd_shim KRBCLIENT asn1util LIBTSOCKET
1354                  NDR_SAMR NDR_LSA''',
1355                  vars=locals())
1356
1357 bld.SAMBA3_BINARY('versiontest',
1358                  source='lib/version_test.c',
1359                  deps='SAMBA_VERSION samba3core param',
1360                  vars=locals())
1361
1362 bld.SAMBA3_BINARY('wbinfo' + bld.env.suffix3,
1363                  source=WBINFO_SRC,
1364                  deps='''talloc wbclient tevent cap
1365                  asn1util LIBTSOCKET pdb ldap param smbd_shim
1366                  LIBNTLMSSP popt_samba3 LIBAFS_SETTOKEN''',
1367                  vars=locals())
1368
1369 bld.SAMBA3_BINARY('ntlm_auth' + bld.env.suffix3,
1370                  source=NTLM_AUTH_SRC,
1371                  deps='''tdb_compat talloc cap KRB5_WRAP k5crypto wbclient param smbd_shim
1372                  samba3core LIBNTLMSSP popt_samba3 asn1util LIBTSOCKET
1373                  pdb SMBLDAP winbind-client LIBINIPARSER LIBADS_SERVER
1374                  NDR_SAMR NDR_LSA NDR_NETLOGON cli-ldap-common LIBNMB SLCACHE SPNEGO_PARSE KRBCLIENT''',
1375                  vars=locals())
1376
1377 bld.SAMBA3_BINARY('timelimit',
1378                  source='script/tests/timelimit.c',
1379                  vars=locals())
1380
1381 bld.SAMBA3_BINARY('rpc_open_tcp',
1382                  source=RPC_OPEN_TCP_SRC,
1383                  deps='''talloc tdb_compat tevent cap wbclient KRBCLIENT param samba3core libsmb smbd_shim
1384                  LIBSMB_ERR asn1util LIBTSOCKET LIBMSRPC_GEN msrpc3''',
1385                  vars=locals())
1386
1387 bld.SAMBA3_BINARY('test_lp_load',
1388                  source=TEST_LP_LOAD_SRC,
1389                  deps='''talloc tdb_compat tevent cap wbclient param  smbd_shim popt_samba3 LIBNTLMSSP''',
1390                  vars=locals())
1391
1392 bld.SAMBA3_BINARY('dbwrap_tool',
1393                  source=DBWRAP_TOOL_SRC,
1394                  deps='''talloc tdb_compat tevent cap param smbd_shim LIBSMB_ERR''',
1395                  vars=locals())
1396
1397 bld.SAMBA3_BINARY('dbwrap_torture',
1398                  source=DBWRAP_TORTURE_SRC,
1399                  deps='''talloc tdb_compat tevent cap param  smbd_shim LIBSMB_ERR
1400                  popt_samba3''',
1401                  vars=locals())
1402
1403 bld.SAMBA3_BINARY('split_tokens',
1404                  source=SPLIT_TOKENS_SRC,
1405                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim popt_samba3
1406                  LIBNTLMSSP''',
1407                  vars=locals())
1408
1409 bld.SAMBA3_BINARY('vlp',
1410                  source=VLP_SRC,
1411                  deps='''talloc tdb_compat PARAM_UTIL UTIL_TDB samba3core param''',
1412                  vars=locals())
1413
1414 swat_dir = os.path.join(bld.curdir, '../swat')
1415 swat_files = recursive_dirlist(swat_dir, swat_dir, '*')
1416 bld.INSTALL_FILES('${SWATDIR}', swat_files, base_name='../swat')
1417
1418 # additional compatibility rules.
1419 # these rules allow us to have a common set of waf rules for toplevel and source3
1420 # builds. Effectively these are build rule aliases
1421
1422 if not bld.env.toplevel_build:
1423     bld.SAMBA3_SUBSYSTEM('POPT_SAMBA', source='', deps='popt_samba3')
1424     bld.SAMBA3_SUBSYSTEM('ldb3',
1425                         source='lib/ldb_compat.c',
1426                         deps='samba-util')
1427     bld.SAMBA3_SUBSYSTEM('ldb', source='', deps='ldb3')
1428     bld.SAMBA3_SUBSYSTEM('dcerpc', '', deps='tevent-util')
1429     bld.SAMBA3_SUBSYSTEM('cli-ldap', '', deps='tevent-util')
1430     bld.SAMBA3_SUBSYSTEM('LOADPARM_CTX', '')
1431
1432 ########################## INCLUDES #################################
1433
1434 bld.RECURSE('../lib/util/charset')
1435 bld.RECURSE('../auth')
1436 bld.RECURSE('../auth/kerberos')
1437 bld.RECURSE('../lib/addns')
1438 bld.RECURSE('../lib/async_req')
1439 bld.RECURSE('../lib/ccan')
1440 bld.RECURSE('../lib/socket')
1441 bld.RECURSE('../lib/param')
1442 bld.RECURSE('../libcli/auth')
1443 bld.RECURSE('../libcli/drsuapi')
1444 bld.RECURSE('../libcli/ldap')
1445 bld.RECURSE('../libcli/cldap')
1446 bld.RECURSE('../libcli/named_pipe_auth')
1447 bld.RECURSE('../libcli/netlogon')
1448 bld.RECURSE('../libcli/samsync')
1449 bld.RECURSE('../libcli/security')
1450 bld.RECURSE('../libcli/smb')
1451 bld.RECURSE('../libcli/util')
1452 bld.RECURSE('../libcli/smbreadline')
1453 bld.RECURSE('../libcli/nbt')
1454 bld.RECURSE('../libcli/registry')
1455 bld.RECURSE('../lib/crypto')
1456 bld.RECURSE('../lib/iniparser/src')
1457 bld.RECURSE('../lib/nss_wrapper')
1458 bld.RECURSE('../lib/popt')
1459 bld.RECURSE('../librpc')
1460 bld.RECURSE('../lib/smbconf')
1461 bld.RECURSE('../lib/socket_wrapper')
1462 bld.RECURSE('../lib/uid_wrapper')
1463 bld.RECURSE('../lib/talloc')
1464 bld.RECURSE('../lib/tdb_compat')
1465 bld.RECURSE('../lib/util')
1466 bld.RECURSE('../lib/tevent')
1467 bld.RECURSE('../lib/tsocket')
1468 bld.RECURSE('../lib/zlib')
1469 bld.RECURSE('../libds/common')
1470 bld.RECURSE('../nsswitch')
1471 bld.RECURSE('../nsswitch/libwbclient')
1472 bld.RECURSE('auth')
1473 bld.RECURSE('libgpo/gpext')
1474 bld.RECURSE('lib/pthreadpool')
1475 bld.RECURSE('librpc')
1476 bld.RECURSE('librpc/idl')
1477 bld.RECURSE('modules')
1478 bld.RECURSE('pam_smbpass')
1479 bld.RECURSE('passdb')
1480 bld.RECURSE('rpc_server')
1481 bld.RECURSE('winbindd')
1482
1483
1484 bld.ENFORCE_GROUP_ORDERING()
1485 bld.CHECK_PROJECT_RULES()
1486
1487 bld.SYMBOL_CHECK()