s3:pylibsmb: Make .list() work for SMBv2
[samba.git] / source3 / wscript_build
1 #!/usr/bin/env python
2
3 LIBS='ICONV'
4
5 config_h = "../include/config.h"
6
7 bld.SAMBA_BLDOPTIONS('smbd/build_options.c')
8
9 bld.SETUP_BUILD_GROUPS()
10
11 ######################## SUBSYSTEMS #################################
12
13 bld.SAMBA3_LIBRARY('netapi',
14                     source='''lib/netapi/netapi.c
15                     lib/netapi/cm.c
16                     lib/netapi/libnetapi.c
17                     lib/netapi/joindomain.c
18                     lib/netapi/serverinfo.c
19                     lib/netapi/wkstainfo.c
20                     lib/netapi/getdc.c
21                     lib/netapi/user.c
22                     lib/netapi/group.c
23                     lib/netapi/localgroup.c
24                     lib/netapi/samr.c
25                     lib/netapi/sid.c
26                     lib/netapi/share.c
27                     lib/netapi/file.c
28                     lib/netapi/shutdown.c
29                     lib/netapi/netlogon.c''',
30                     public_deps='''
31                     talloc
32                     util_cmdline
33                     msrpc3
34                     ads
35                     NDR_LIBNETAPI
36                     LIBNET
37                     RPC_CLIENT_SCHANNEL
38                     libcli_netlogon3
39                     LIBCLI_SAMR
40                     INIT_SAMR
41                     auth
42                     ''',
43                     public_headers='../source3/lib/netapi/netapi.h',
44                     pc_files='libnet/netapi.pc',
45                     vnum='0')
46
47 bld.SAMBA3_LIBRARY('gse',
48                    source='librpc/crypto/gse_krb5.c librpc/crypto/gse.c',
49                    deps='krb5samba gensec smbconf KRBCLIENT secrets3',
50                    private_library=True)
51
52 bld.SAMBA3_LIBRARY('msrpc3',
53                    source='''
54                           rpc_client/cli_pipe.c
55                           rpc_client/rpc_transport_np.c
56                           rpc_client/rpc_transport_sock.c
57                           rpc_client/rpc_transport_tstream.c
58                           librpc/rpc/dcerpc_helpers.c
59                           ''',
60                    deps='''
61                         ndr
62                         ndr-standard
63                         RPC_NDR_EPMAPPER
64                         NTLMSSP_COMMON
65                         COMMON_SCHANNEL
66                         LIBCLI_AUTH
67                         LIBTSOCKET
68                         gse
69                         dcerpc-binding
70                         libsmb
71                         ndr-table
72                         NETLOGON_CREDS_CLI
73                    ''',
74                    private_library=True)
75
76 bld.SAMBA3_SUBSYSTEM('AVAHI',
77                     source='''
78                            lib/avahi.c
79                            smbd/avahi_register.c
80                            ''',
81                     deps='''
82                          avahi-common
83                          avahi-client
84                          ''',
85                     enabled=bld.env.with_avahi)
86
87 bld.SAMBA3_SUBSYSTEM('GROUPDB',
88                     source='''
89                            groupdb/mapping.c
90                            groupdb/mapping_tdb.c
91                            ''',
92                     deps='tdb')
93
94 bld.SAMBA3_SUBSYSTEM('TLDAP',
95                     source='''
96                            lib/tldap.c
97                            lib/tldap_util.c
98                            lib/tldap_gensec_bind.c
99                            ''',
100                     deps='''
101                          asn1util
102                          LIBTSOCKET
103                          samba3util
104                          ''')
105
106 bld.SAMBA3_BINARY('test_tldap',
107                   source='lib/test_tldap.c',
108                   deps='''
109                        asn1util
110                        LIBTSOCKET
111                        samba3util
112                        smbconf
113                        cmocka
114                        ''',
115                   install=False)
116
117 # libpdb.so should not expose internal symbols that are only usable
118 # to the statically linked modules that are merged into libpdb.
119 # Note that we always filter these symbols out in libpdb, even
120 # when modules are not linked statically. In the latter case
121 # symbols will not be present in the libpdb anyway so no hurt is
122 # done to the version script.
123 private_pdb_match = []
124 private_pdb_match.append('!idmap_init')
125 private_pdb_match.append('!idmap_sids_to_xids')
126 private_pdb_match.append('!idmap_xids_to_sids')
127
128 ldapsam_pdb_match = ['!priv2ld', '!smbldap_search_domain_info',
129                      '!ldapsam_*', '!groupmap_attr_list*', '!get_userattr_list',
130                      '!dominfo_attr_list', '!get_attr_key2string',
131                      '!sidmap_attr_list', '!attrib_map_*', '!idpool_attr_list',
132                      '!get_attr_list']
133 private_pdb_match.append('!pdb_nds_*')
134 private_pdb_match.append('!pdb_ldapsam_init*')
135 private_pdb_match.append('!pdb_*_init')
136 private_pdb_match = private_pdb_match + ldapsam_pdb_match
137
138 bld.SAMBA3_LIBRARY('samba-passdb',
139                    source='',
140                    deps='pdb',
141                    private_library=False,
142                    grouping_library=True,
143                    pc_files=[],
144                    public_headers_install=True,
145                    public_headers='''
146                                   include/passdb.h
147                                   passdb/machine_sid.h
148                                   passdb/lookup_sid.h
149                                   ''',
150                    abi_match=private_pdb_match,
151                    abi_directory='passdb/ABI',
152                    vnum='0.27.1')
153
154 bld.SAMBA3_SUBSYSTEM('pdb',
155                    source='''
156                           passdb/pdb_get_set.c
157                           passdb/passdb.c
158                           lib/util_wellknown.c
159                           lib/util_builtin.c
160                           passdb/pdb_compat.c
161                           lib/util_sid_passdb.c
162                           lib/util_unixsids.c
163                           passdb/lookup_sid.c
164                           passdb/login_cache.c
165                           passdb/account_pol.c
166                           lib/privileges.c
167                           lib/util_nscd.c
168                           lib/winbind_util.c
169                           passdb/pdb_util.c
170                           passdb/pdb_interface.c
171                           passdb/pdb_secrets.c
172                           passdb/pdb_unixid.c''',
173                    deps='''
174                         secrets3
175                         GROUPDB
176                         SERVER_MUTEX
177                         wbclient
178                         LIBCLI_AUTH
179                         flag_mapping
180                         samba-credentials
181                         ''')
182
183 bld.SAMBA3_LIBRARY('smbldaphelper',
184                    source='''
185                           passdb/pdb_ldap_schema.c
186                           passdb/pdb_ldap_util.c
187                           ''',
188                    deps='smbldap secrets3',
189                    allow_undefined_symbols=True,
190                    enabled=bld.CONFIG_SET('HAVE_LDAP'),
191                    private_library=True)
192
193 bld.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
194                      source='lib/server_mutex.c',
195                      deps='talloc')
196
197 # this includes only the low level parse code, not stuff
198 # that requires knowledge of security contexts
199 bld.SAMBA3_SUBSYSTEM('REG_PARSE_PRS',
200                      source='registry/reg_parse_prs.c')
201
202 bld.SAMBA3_SUBSYSTEM('REGFIO',
203                     source='registry/regfio.c',
204                     deps='samba-util REG_PARSE_PRS')
205
206 bld.SAMBA3_SUBSYSTEM('REG_API_REGF',
207                     source='registry/reg_api_regf.c',
208                     deps='samba-util')
209
210 # Do not link against this use 'smbconf'
211 bld.SAMBA3_SUBSYSTEM('SMBREGISTRY',
212                    source='''
213                           registry/reg_api.c
214                           registry/reg_dispatcher.c
215                           registry/reg_cachehook.c
216                           registry/reg_objects.c
217                           registry/reg_util_internal.c
218                           lib/util_nttoken.c
219                           registry/reg_backend_db.c
220                           registry/reg_parse_internal.c
221                           lib/srprs.c
222                           registry/reg_init_basic.c
223                           ''',
224                    deps='''
225                         smbd_shim
226                         tdb-wrap3
227                         NDR_SECURITY
228                         util_tdb
229                         talloc
230                         replace
231                         util_reg
232                         samba-util
233                         samba-security
234                         errors3
235                         dbwrap
236                         samba3-util
237                         ''')
238
239 # Do not link against this use 'smbconf'
240 bld.SAMBA3_SUBSYSTEM('REG_SMBCONF',
241                     source='''
242                            registry/reg_backend_smbconf.c
243                            registry/reg_init_smbconf.c
244                            registry/reg_util_token.c
245                            registry/reg_api_util.c
246                            ''',
247                     deps='SMBREGISTRY')
248
249 bld.SAMBA3_SUBSYSTEM('REG_FULL',
250                     source='''
251                            registry/reg_backend_printing.c
252                            registry/reg_backend_shares.c
253                            registry/reg_backend_netlogon_params.c
254                            registry/reg_backend_prod_options.c
255                            registry/reg_backend_tcpip_params.c
256                            registry/reg_backend_hkpt_params.c
257                            registry/reg_backend_current_version.c
258                            registry/reg_backend_perflib.c
259                            registry/reg_init_full.c
260                            registry/reg_perfcount.c''',
261                     deps='''
262                          smbconf
263                          tdb-wrap3
264                          ''')
265
266 bld.SAMBA3_LIBRARY('popt_samba3',
267                    source='lib/popt_common.c',
268                    deps='popt samba-util smbconf',
269                    private_library=True)
270
271 bld.SAMBA3_LIBRARY('popt_samba3_cmdline',
272                    source='lib/popt_common_cmdline.c',
273                    deps='popt_samba3 util_cmdline cmdline_contexts',
274                    private_library=True)
275
276 bld.SAMBA3_LIBRARY('util_cmdline',
277                    source='lib/util_cmdline.c',
278                    deps='secrets3',
279                    private_library=True)
280
281 bld.SAMBA3_LIBRARY('cmdline_contexts',
282                    source='lib/cmdline_contexts.c',
283                    deps='samba3core',
284                    private_library=True)
285
286 bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
287                      source='libads/kerberos.c libads/ads_status.c',
288                      public_deps='krb5samba asn1util k5crypto gssapi LIBTSOCKET CLDAP LIBNMB')
289
290 bld.SAMBA3_SUBSYSTEM('samba3util',
291                    source='''
292                           lib/system.c
293                           lib/sendfile.c
294                           lib/recvfile.c
295                           lib/time.c
296                           lib/util_sid.c
297                           lib/util_specialsids.c
298                           lib/util_file.c
299                           lib/util.c
300                           lib/util_path.c
301                           lib/util_procid.c
302                           lib/util_sock.c
303                           lib/util_tsock.c
304                           lib/util_transfer_file.c
305                           lib/sys_popen.c
306                           ''',
307                    deps='''
308                         CHARSET3
309                         ndr
310                         LIBTSOCKET
311                         samba-security
312                         NDR_SECURITY
313                         samba-util
314                         util_tdb
315                         sys_rw
316                         iov_buf
317                         ''')
318
319 if bld.env.with_ctdb:
320     SAMBA_CLUSTER_SUPPORT_SOURCES='''
321                      lib/cluster_support.c
322                      lib/dbwrap/dbwrap_ctdb.c
323                      lib/messages_ctdb.c
324                      lib/messages_ctdb_ref.c
325                      lib/ctdbd_conn.c
326                    '''
327     SAMBA_CLUSTER_SUPPORT_DEPS='''
328                      talloc
329                      tevent
330                      tdb
331                    '''
332 else:
333     SAMBA_CLUSTER_SUPPORT_SOURCES='''
334                      lib/cluster_support.c
335                      lib/ctdb_dummy.c
336                    '''
337     SAMBA_CLUSTER_SUPPORT_DEPS='''
338                      talloc
339                      tevent
340                    '''
341
342 bld.SAMBA3_LIBRARY('samba-cluster-support',
343                    source=SAMBA_CLUSTER_SUPPORT_SOURCES,
344                    deps=SAMBA_CLUSTER_SUPPORT_DEPS,
345                    allow_undefined_symbols=True,
346                    private_library=True)
347
348 bld.SAMBA3_SUBSYSTEM('TDB_LIB',
349                      source='''
350                             lib/dbwrap/dbwrap_open.c
351                             lib/dbwrap/dbwrap_watch.c
352                             lib/g_lock.c
353                             ''',
354                      deps='''
355                           dbwrap
356                           samba-cluster-support
357                           ''')
358
359 bld.SAMBA3_LIBRARY('messages_dgm',
360                    source='''
361                           lib/messages_dgm.c
362                           lib/messages_dgm_ref.c
363                           ''',
364                    deps='''
365                         talloc
366                         samba-debug
367                         PTHREADPOOL
368                         msghdr
369                         genrand
370                         ''',
371                    private_library=True)
372
373 bld.SAMBA3_LIBRARY('messages_util',
374                    source='''lib/messages_util.c''',
375                    deps='samba-util',
376                    private_library=True)
377
378 bld.SAMBA3_SUBSYSTEM('samba3core',
379                    source='''
380                           lib/messages.c
381                           lib/util_cluster.c
382                           lib/id_cache.c
383                           lib/serverid.c
384                           lib/server_id_watch.c
385                           lib/server_id_db_util.c
386                           lib/addrchange.c
387                           ../lib/util/debug_s3.c
388                           lib/dumpcore.c
389                           lib/interface.c
390                           lib/username.c
391                           lib/smbrun.c
392                           lib/wins_srv.c
393                           lib/substitute.c
394                           lib/substitute_generic.c
395                           lib/ms_fnmatch.c
396                           lib/tallocmsg.c
397                           lib/dmallocmsg.c
398                           intl/lang_tdb.c
399                           lib/gencache.c
400                           lib/util_event.c
401                           lib/global_contexts.c
402                           lib/server_prefork.c
403                           lib/server_prefork_util.c
404                           lib/ldap_escape.c
405                           libads/krb5_errs.c
406                           lib/system_smbd.c
407                           lib/audit.c
408                           lib/tevent_wait.c
409                           lib/idmap_cache.c
410                           lib/namemap_cache.c
411                           lib/util_ea.c
412                           lib/background.c
413                           ''',
414                    deps='''
415                         samba3util
416                         LIBTSOCKET
417                         NDR_MESSAGING
418                         LIBASYNC_REQ
419                         UTIL_PW
420                         SAMBA_VERSION
421                         PTHREADPOOL
422                         interfaces
423                         smbconf
424                         dbwrap
425                         samba3-util
426                         errors3
427                         server_id_db
428                         messages_util
429                         messages_dgm
430                         talloc_report
431                         access
432                         TDB_LIB
433                         ''')
434
435 bld.SAMBA3_LIBRARY('smbd_shim',
436                    source='''lib/smbd_shim.c''',
437                    deps='talloc',
438                    private_library=True)
439
440 bld.SAMBA3_SUBSYSTEM('auth_generic',
441                     source='libsmb/auth_generic.c',
442                     deps='gse gensec')
443
444 bld.SAMBA3_LIBRARY('libsmb',
445                    source='''
446                           libsmb/clientgen.c
447                           libsmb/cliconnect.c
448                           libsmb/clifile.c
449                           libsmb/clispnego.c
450                           libsmb/clirap.c
451                           libsmb/clierror.c
452                           libsmb/climessage.c
453                           libsmb/clireadwrite.c
454                           libsmb/clilist.c
455                           libsmb/cliprint.c
456                           libsmb/clitrans.c
457                           libsmb/clisecdesc.c
458                           libsmb/clidgram.c
459                           libsmb/clistr.c
460                           libsmb/cliquota.c
461                           libsmb/clifsinfo.c
462                           libsmb/clidfs.c
463                           libsmb/clioplock.c
464                           libsmb/clirap2.c
465                           libsmb/async_smb.c
466                           libsmb/reparse_symlink.c
467                           libsmb/clisymlink.c
468                           libsmb/smbsock_connect.c
469                           libsmb/cli_smb2_fnum.c
470                           ''',
471                    deps='''
472                         auth_generic
473                         CLDAP
474                         LIBNMB
475                         SPNEGO_PARSE
476                         LIBTSOCKET
477                         KRBCLIENT
478                         NDR_IOCTL
479                         NDR_QUOTA
480                         cli_smb_common
481                         util_cmdline
482                         tevent
483                         ''',
484                    private_library=True)
485
486 bld.SAMBA3_SUBSYSTEM('CLDAP',
487                     source='libads/cldap.c',
488                     deps='cli-ldap-common cli_cldap LIBTSOCKET')
489
490 # NOTE: The secrets3 library is a low level library used by several subsystems.
491 # PLEASE DO NOT make it depend on high level libraries like PDB, if you are
492 # doing that your design is wrong and needs changing. -SSS
493 bld.SAMBA3_LIBRARY('secrets3',
494                    source='''
495                           passdb/secrets.c
496                           passdb/machine_account_secrets.c
497                           passdb/machine_sid.c
498                           passdb/secrets_lsa.c
499                           ''',
500                    deps='''
501                         NDR_SECRETS
502                         smbconf
503                         samba3util
504                         dbwrap
505                         ''',
506                    private_library=True)
507
508 bld.SAMBA3_LIBRARY('smbldap',
509                     source='lib/smbldap.c',
510                     deps='ldap lber samba-util smbconf',
511                     enabled=bld.CONFIG_SET("HAVE_LDAP"),
512                     private_library=False,
513                     abi_directory='lib/ABI',
514                     abi_match='smbldap_*',
515                     pc_files=[],
516                     vnum='2',
517                     public_headers='include/smbldap.h include/smb_ldap.h')
518
519 bld.SAMBA3_LIBRARY('ads',
520                    source='''
521                           libads/ldap.c
522                           libads/sasl.c
523                           libads/sasl_wrapping.c
524                           libads/krb5_setpw.c
525                           libads/kerberos_util.c
526                           libads/ldap_user.c
527                           libads/ads_struct.c
528                           libads/kerberos_keytab.c
529                           libads/disp_sec.c
530                           libads/ldap_utils.c
531                           libads/ldap_schema.c
532                           libads/util.c
533                           libads/ndr.c
534                           libads/net_ads_setspn.c
535                           ''',
536                    deps='''
537                         cli-ldap-common
538                         krb5samba
539                         ldap
540                         lber
541                         KRBCLIENT
542                         smbconf
543                         LIBNMB
544                         libsmb
545                         DCUTIL
546                         smbldap
547                         trusts_util
548                         ''',
549                    private_library=True)
550
551 bld.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
552                      source='libads/authdata.c',
553                      deps='SERVER_MUTEX ndr-krb5pac krb5samba gssapi')
554
555 bld.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
556                     source='libads/ldap_printer.c',
557                     deps='samba-util krb5samba')
558
559 # Only smbconf should link against this subsystem, else we will create
560 # a circular dependency.
561 bld.SAMBA3_SUBSYSTEM('SMBCONF_PARAM',
562                    source='''
563                           param/loadparm.c
564                           lib/sharesec.c
565                           lib/ldap_debug_handler.c
566                           lib/util_names.c
567                           ''',
568                    deps='''
569                         samba-util
570                         PARAM_UTIL
571                         ldap
572                         lber
573                         LOADPARM_CTX
574                         samba3core
575                         param_local.h
576                         param_global.h
577                         cups
578                         ''')
579
580 bld.SAMBA3_LIBRARY('smbconf',
581                    source='''
582                           lib/smbconf/smbconf_init.c
583                           lib/smbconf/smbconf_reg.c
584                           ''',
585                    deps='''
586                         LIBSMBCONF
587                         REG_SMBCONF
588                         SAMBA_VERSION
589                         cap
590                         charset
591                         cli_smb_common
592                         errors3
593                         SMBCONF_PARAM
594                         samba-util
595                         talloc
596                         util_reg
597                         ''',
598                    public_headers='../lib/smbconf/smbconf.h',
599                    pc_files=[],
600                    vnum='0')
601
602 bld.SAMBA3_LIBRARY('smbd_conn',
603                    source='smbd/conn.c',
604                    deps='samba3-util samba-util',
605                    private_library=True)
606
607 bld.SAMBA3_SUBSYSTEM('sysquotas',
608                      source='''
609                         lib/sysquotas.c
610                         lib/sysquotas_linux.c
611                         lib/sysquotas_xfs.c
612                         lib/sysquotas_4A.c
613                         lib/sysquotas_4B.c
614                         lib/sysquotas_nfs.c
615                      ''',
616                      allow_warnings=True,
617                      deps='samba3-util samba-util tirpc')
618
619 NOTIFY_SOURCES=''
620 NOTIFY_DEPS=''
621
622 if bld.CONFIG_SET("HAVE_INOTIFY"):
623     NOTIFY_SOURCES += ' smbd/notify_inotify.c'
624
625 if bld.CONFIG_SET('SAMBA_FAM_LIBS'):
626     NOTIFY_SOURCES += ' smbd/notify_fam.c'
627     NOTIFY_DEPS += ' ' + bld.CONFIG_GET('SAMBA_FAM_LIBS')
628
629 bld.SAMBA3_LIBRARY('smbd_base',
630                    source='''
631                           smbd/server_reload.c
632                           smbd/files.c
633                           smbd/connection.c
634                           smbd/utmp.c
635                           smbd/session.c
636                           smbd/dfree.c
637                           smbd/dir.c
638                           smbd/password.c
639                           smbd/conn_msg.c
640                           smbd/conn_idle.c
641                           smbd/share_access.c
642                           smbd/fileio.c
643                           smbd/ipc.c
644                           smbd/lanman.c
645                           smbd/negprot.c
646                           smbd/message.c
647                           smbd/nttrans.c
648                           smbd/pipes.c
649                           smbd/reply.c
650                           smbd/sesssetup.c
651                           smbd/trans2.c
652                           smbd/uid.c
653                           smbd/dosmode.c
654                           smbd/filename.c
655                           smbd/open.c
656                           smbd/close.c
657                           smbd/blocking.c
658                           smbd/sec_ctx.c
659                           smbd/srvstr.c
660                           smbd/vfs.c
661                           smbd/perfcount.c
662                           smbd/statcache.c
663                           smbd/seal.c
664                           smbd/posix_acls.c
665                           lib/sysacls.c
666                           smbd/process.c
667                           smbd/service.c
668                           smbd/error.c
669                           printing/printspoolss.c
670                           lib/sessionid_tdb.c
671                           lib/conn_tdb.c
672                           lib/cleanupdb.c
673                           smbd/fake_file.c
674                           smbd/quotas.c
675                           smbd/ntquotas.c
676                           smbd/msdfs.c
677                           smbd/aio.c smbd/statvfs.c
678                           smbd/dmapi.c
679                           smbd/signing.c
680                           smbd/file_access.c
681                           smbd/dnsregister.c smbd/globals.c
682                           smbd/smb2_server.c
683                           smbd/smb2_glue.c
684                           smbd/smb2_negprot.c
685                           smbd/smb2_sesssetup.c
686                           smbd/smb2_tcon.c
687                           smbd/smb2_create.c
688                           smbd/smb2_close.c
689                           smbd/smb2_flush.c
690                           smbd/smb2_read.c
691                           smbd/smb2_write.c
692                           smbd/smb2_lock.c
693                           smbd/smb2_ioctl.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
700                           smbd/smb2_notify.c
701                           smbd/smb2_getinfo.c
702                           smbd/smb2_setinfo.c
703                           smbd/smb2_break.c
704                           smbd/smbXsrv_version.c
705                           smbd/smbXsrv_client.c
706                           smbd/smbXsrv_session.c
707                           smbd/smbXsrv_tcon.c
708                           smbd/smbXsrv_open.c
709                           smbd/server_exit.c
710                           smbd/durable.c
711                           smbd/scavenger.c
712                           smbd/mangle.c
713                           smbd/mangle_hash.c
714                           smbd/mangle_hash2.c
715                           smbd/oplock.c
716                           smbd/oplock_linux.c
717                           smbd/notify.c
718                           smbd/notify_msg.c
719                           smbd/build_options.c
720                           ''' + NOTIFY_SOURCES,
721                    deps='''
722                         talloc
723                         tevent
724                         pdb
725                         libsmb
726                         msrpc3
727                         vfs
728                         vfs_default
729                         vfs_posixacl
730                         inotify
731                         samba3core
732                         smbd_conn
733                         param_service
734                         AVAHI
735                         PRINTBASE
736                         PROFILE
737                         LOCKING
738                         LIBADS_SERVER
739                         LIBAFS
740                         RPC_SERVICE
741                         NDR_SMBXSRV
742                         LEASES_DB
743                         LEASES_UTIL
744                         sysquotas
745                         NDR_SMB_ACL
746                         netapi
747                         NDR_IOCTL
748                         notifyd
749                         vfs_acl_common
750                         NDR_QUOTA
751                    ''' +
752                    bld.env['dmapi_lib'] +
753                    bld.env['legacy_quota_libs'] +
754                    NOTIFY_DEPS,
755                    private_library=True)
756
757 bld.SAMBA3_SUBSYSTEM('LOCKING',
758                     source='''
759                            locking/locking.c
760                            locking/brlock.c
761                            locking/posix.c
762                            locking/share_mode_lock.c
763                            ''',
764                     deps='''
765                          tdb
766                          talloc
767                          LEASES_DB
768                          LEASES_UTIL
769                          NDR_OPEN_FILES
770                          FNAME_UTIL
771                          ''')
772
773 bld.SAMBA3_SUBSYSTEM('LEASES_DB',
774                     source='locking/leases_db.c',
775                     deps='NDR_LEASES_DB')
776
777 bld.SAMBA3_SUBSYSTEM('LEASES_UTIL',
778                     source='locking/leases_util.c',
779                     deps='NDR_OPEN_FILES')
780
781 if bld.CONFIG_GET("WITH_PROFILE"):
782     bld.SAMBA3_SUBSYSTEM('PROFILE',
783                          source='profile/profile.c',
784                          deps='samba-util')
785 else:
786     bld.SAMBA3_SUBSYSTEM('PROFILE',
787                          source='profile/profile_dummy.c',
788                          deps='')
789
790 bld.SAMBA3_SUBSYSTEM('PRINTBASE',
791                     source='''
792                            printing/notify.c
793                            printing/printing_db.c
794                            ''',
795                     deps='''
796                          samba-util
797                          tdb
798                          ''')
799
800 bld.SAMBA3_SUBSYSTEM('PRINTBACKEND',
801                     source='''
802                            printing/printing.c
803                            printing/nt_printing.c
804                            printing/nt_printing_tdb.c
805                            printing/nt_printing_migrate_internal.c
806                            printing/nt_printing_ads.c
807                            printing/queue_process.c
808                            ''',
809                     deps='''
810                          PRINTBASE
811                          LIBADS_PRINTER
812                          tdb
813                          printing_migrate
814                          SPOOLSSD
815                          ''')
816
817 bld.SAMBA3_LIBRARY('printing_migrate',
818                     source='''
819                            printing/nt_printing_migrate.c
820                            rpc_client/cli_winreg_spoolss.c
821                            printing/nt_printing_os2.c
822                            ''',
823                     deps='''
824                          NDR_NTPRINTING
825                          cli_spoolss
826                          RPC_NDR_WINREG
827                          LIBCLI_WINREG
828                          smbconf
829                          ''',
830                     private_library=True)
831
832 bld.SAMBA3_SUBSYSTEM('PRINTING',
833                     source='''
834                            printing/pcap.c
835                            printing/print_svid.c
836                            printing/print_aix.c
837                            printing/print_cups.c
838                            printing/print_generic.c
839                            printing/lpq_parse.c
840                            printing/load.c
841                            printing/print_standard.c
842                            printing/print_iprint.c
843                            printing/printer_list.c
844                            ''',
845                     deps='''
846                          NDR_PRINTCAP
847                          tdb
848                          cups
849                          ''')
850
851 bld.SAMBA3_SUBSYSTEM('FNAME_UTIL',
852                     source='lib/filename_util.c',
853                     deps='samba-util')
854
855 bld.SAMBA3_SUBSYSTEM('LIBNET',
856                     source='libnet/libnet_join.c',
857                     deps='NDR_LIBNET_JOIN INIT_SAMR net_keytab pdb')
858
859 bld.SAMBA3_LIBRARY('net_keytab',
860                    source='libnet/libnet_keytab.c',
861                    deps='krb5samba ads',
862                    private_library=True)
863
864
865 bld.SAMBA3_SUBSYSTEM('LIBNET_DSSYNC',
866                     source='''
867                            libnet/libnet_dssync.c
868                            libnet/libnet_dssync_passdb.c
869                            libnet/libnet_dssync_keytab.c
870                            ''',
871                     deps='''
872                          LIBNET
873                          RPC_NDR_DRSUAPI
874                          ''')
875
876 bld.SAMBA3_SUBSYSTEM('LIBEVENTLOG',
877                     source='lib/eventlog/eventlog.c',
878                     deps='NDR_EVENTLOG tdb')
879
880 bld.SAMBA3_SUBSYSTEM('LIBNMB',
881                      source='''
882                             libsmb/unexpected.c
883                             libsmb/namecache.c
884                             libsmb/nmblib.c
885                             libsmb/namequery.c
886                             libsmb/conncache.c
887                             libads/sitename_cache.c
888                             ''',
889                      deps='''
890                           LIBTSOCKET
891                           samba3util
892                           addns
893                           lmhosts
894                           resolv
895                           ''')
896
897 bld.SAMBA3_SUBSYSTEM('SERVICES',
898                     source='''
899                            services/svc_spoolss.c
900                            services/svc_rcinit.c
901                            services/svc_winreg_glue.c
902                            services/svc_netlogon.c
903                            services/svc_winreg.c
904                            services/svc_wins.c
905                            ''',
906                     deps='samba-util')
907
908 bld.SAMBA3_SUBSYSTEM('PLAINTEXT_AUTH',
909                     source='''
910                            auth/pampass.c
911                            auth/pass_check.c
912                            ''',
913                     deps='''
914                          pam
915                          PAM_ERRORS
916                          ''')
917
918 bld.SAMBA3_SUBSYSTEM('PASSCHANGE',
919                     source='libsmb/passchange.c',
920                     deps='''
921                          LIBCLI_SAMR
922                          INIT_LSA
923                          msrpc3
924                          krb5samba
925                          ''')
926
927 bld.SAMBA3_SUBSYSTEM('SAMBA_VERSION',
928                     source='lib/version.c',
929                     deps='samba-util')
930
931 bld.SAMBA3_SUBSYSTEM('SLCACHE',
932                     source='libsmb/samlogon_cache.c',
933                     deps='''
934                          samba-util
935                          tdb
936                          ''')
937
938 bld.SAMBA3_SUBSYSTEM('DCUTIL',
939                     source='''
940                            libsmb/namequery_dc.c
941                            libsmb/dsgetdcname.c
942                            ''',
943                     deps='''
944                          ads
945                          msrpc3
946                          libcli_lsa3
947                          ''')
948
949 bld.SAMBA3_LIBRARY('trusts_util',
950                    source='libsmb/trusts_util.c',
951                    deps='''
952                         libcli_netlogon3
953                         msrpc3
954                         samba-passdb
955                         ''',
956                    private_library=True)
957
958 bld.SAMBA3_SUBSYSTEM('tdb-wrap3',
959                     source='lib/util_tdb.c',
960                     deps='talloc samba3-util')
961
962 bld.SAMBA3_LIBRARY('samba3-util',
963                    source='''
964                           lib/util_sec.c
965                           lib/util_str.c
966                           lib/adt_tree.c
967                           lib/util_malloc.c
968                           lib/namearray.c
969                           lib/file_id.c
970                           lib/cbuf.c
971                           ''',
972                    deps='''
973                         samba-util
974                         charset
975                         ''',
976                    private_library=True)
977
978 bld.SAMBA_LIBRARY('xattr_tdb',
979                   source='lib/xattr_tdb.c',
980                   deps='NDR_XATTR dbwrap samba3-util',
981                   private_library=True)
982
983 bld.SAMBA3_LIBRARY('CHARSET3',
984                     source='''
985                            lib/charcnv.c
986                            lib/fstring.c
987                            ''',
988                     public_deps='''
989                                 ICONV_WRAPPER
990                                 charset
991                                 ''',
992                     deps='''
993                          samba-util
994                          samba3-util
995                          ''',
996                    private_library=True)
997
998 bld.SAMBA3_SUBSYSTEM('errors3',
999                      source='''
1000                             libsmb/errormap.c
1001                             libsmb/smberr.c
1002                             lib/errmap_unix.c
1003                             ''',
1004                      deps='samba-errors')
1005
1006 bld.SAMBA3_SUBSYSTEM('LIBCLI_SAMR',
1007                     source='rpc_client/cli_samr.c',
1008                     deps='RPC_NDR_SAMR')
1009
1010 bld.SAMBA3_LIBRARY('libcli_lsa3',
1011                    source='rpc_client/cli_lsarpc.c',
1012                    deps='RPC_NDR_LSA INIT_LSA',
1013                    private_library=True)
1014
1015 bld.SAMBA3_LIBRARY('libcli_netlogon3',
1016                    source='''
1017                           rpc_client/cli_netlogon.c
1018                           rpc_client/util_netlogon.c
1019                           ''',
1020                    deps='''
1021                         msrpc3
1022                         RPC_NDR_NETLOGON
1023                         INIT_NETLOGON
1024                         cliauth
1025                         smbconf
1026                         NETLOGON_CREDS_CLI''',
1027                    private_library=True)
1028
1029 bld.SAMBA3_LIBRARY('cli_spoolss',
1030                    source='''
1031                           rpc_client/cli_spoolss.c
1032                           rpc_client/init_spoolss.c
1033                           ''',
1034                    deps='''
1035                         RPC_NDR_SPOOLSS
1036                         smbconf
1037                         secrets3''',
1038                    private_library=True)
1039
1040 bld.SAMBA3_SUBSYSTEM('LIBCLI_WINREG',
1041                     source='rpc_client/cli_winreg.c',
1042                     deps='RPC_NDR_WINREG')
1043
1044 bld.SAMBA3_SUBSYSTEM('LIBCLI_WINREG_INTERNAL',
1045                     source='rpc_client/cli_winreg_int.c',
1046                     deps='LIBCLI_WINREG RPC_SERVER')
1047
1048 bld.SAMBA3_SUBSYSTEM('RPC_CLIENT_SCHANNEL',
1049                     source='rpc_client/cli_pipe_schannel.c',
1050                     deps='samba-util krb5samba')
1051
1052 bld.SAMBA3_SUBSYSTEM('INIT_LSA',
1053                     source='rpc_client/init_lsa.c',
1054                     deps='samba-util')
1055
1056 bld.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
1057                     source='rpc_client/init_netlogon.c',
1058                     deps='samba-util')
1059
1060 bld.SAMBA3_SUBSYSTEM('INIT_SAMR',
1061                     source='rpc_client/init_samr.c',
1062                     deps='samba-util')
1063
1064 bld.SAMBA3_SUBSYSTEM('LIBLSA',
1065                      source='lib/lsa.c')
1066
1067 bld.SAMBA3_SUBSYSTEM('SPOOLSSD',
1068                     source='printing/spoolssd.c',
1069                     deps='''
1070                          samba-util
1071                          RPC_SOCK_HELPER
1072                          ''')
1073
1074 ########################## BINARIES #################################
1075
1076 bld.SAMBA3_BINARY('smbd/smbd',
1077                  source='smbd/server.c smbd/smbd_cleanupd.c',
1078                  deps='''
1079                       popt_samba3
1080                       smbd_base
1081                       EPMD
1082                       LSASD
1083                       FSSD
1084                       MDSSD
1085                       SPOOLSSD
1086                       ''',
1087                  install_path='${SBINDIR}')
1088
1089
1090 bld.SAMBA3_SUBSYSTEM('TDB_VALIDATE',
1091                      source='lib/tdb_validate.c',
1092                      deps='samba-util')
1093
1094
1095 bld.SAMBA3_BINARY('client/smbclient',
1096                  source='''
1097                         client/client.c
1098                         client/clitar.c
1099                         client/dnsbrowse.c
1100                         ''',
1101                  deps='''
1102                       talloc
1103                       popt_samba3_cmdline
1104                       smbconf
1105                       ndr-standard
1106                       SMBREADLINE
1107                       libsmb
1108                       msrpc3
1109                       RPC_NDR_SRVSVC
1110                       cli_smb_common
1111                       archive
1112                       ''')
1113
1114 bld.SAMBA3_BINARY('smbspool',
1115                  source='client/smbspool.c',
1116                  deps='''
1117                       talloc
1118                       popt_samba3
1119                       smbconf
1120                       libsmb
1121                       samba3core
1122                       ''')
1123
1124 bld.SAMBA3_BINARY('smbspool_krb5_wrapper',
1125                  source='client/smbspool_krb5_wrapper.c',
1126                  deps='''
1127                       DYNCONFIG
1128                       cups
1129                       ''',
1130                  install_path='${LIBEXECDIR}/samba',
1131                  enabled=bld.CONFIG_SET('HAVE_CUPS'))
1132
1133 bld.SAMBA3_BINARY('locktest2',
1134                  source='torture/locktest2.c',
1135                  deps='''
1136                       talloc
1137                       smbconf
1138                       libsmb
1139                       LOCKING
1140                       ''',
1141                  install=False)
1142
1143 smbstatus_source = 'utils/status.c smbd/notify_msg.c'
1144
1145 if bld.CONFIG_GET("WITH_PROFILE"):
1146     smbstatus_source += ' utils/status_profile.c'
1147 else:
1148     smbstatus_source += ' utils/status_profile_dummy.c'
1149
1150 bld.SAMBA3_BINARY('smbstatus',
1151                  source=smbstatus_source,
1152                  deps='''
1153                       talloc
1154                       smbconf
1155                       popt_samba3
1156                       cmdline_contexts
1157                       smbd_base
1158                       LOCKING
1159                       PROFILE
1160                       ''')
1161
1162 bld.SAMBA3_BINARY('smbtorture' + bld.env.suffix3,
1163                  source='''
1164                         torture/torture.c
1165                         torture/nbio.c
1166                         torture/scanner.c
1167                         torture/utable.c
1168                         torture/denytest.c
1169                         torture/mangle_test.c
1170                         torture/nbench.c
1171                         torture/test_async_echo.c
1172                         torture/test_addrchange.c
1173                         torture/test_posix_append.c
1174                         torture/test_nttrans_create.c
1175                         torture/test_nttrans_fsctl.c
1176                         torture/test_case_insensitive.c
1177                         torture/test_notify_online.c
1178                         torture/test_chain3.c
1179                         torture/test_smb2.c
1180                         torture/test_authinfo_structs.c
1181                         torture/test_smbsock_any_connect.c
1182                         torture/test_cleanup.c
1183                         torture/test_notify.c
1184                         lib/tevent_barrier.c
1185                         torture/test_dbwrap_watch.c
1186                         torture/test_dbwrap_do_locked.c
1187                         torture/test_idmap_tdb_common.c
1188                         torture/test_dbwrap_ctdb.c
1189                         torture/test_buffersize.c
1190                         torture/test_messaging_read.c
1191                         torture/test_messaging_fd_passing.c
1192                         torture/test_messaging_send_all.c
1193                         torture/test_oplock_cancel.c
1194                         torture/test_pthreadpool_tevent.c
1195                         torture/bench_pthreadpool.c
1196                         torture/wbc_async.c
1197                         torture/test_g_lock.c
1198                         torture/test_namemap_cache.c
1199                         torture/test_hidenewfiles.c
1200                         ''',
1201                  deps='''
1202                       talloc
1203                       smbconf
1204                       libsmb
1205                       msrpc3
1206                       TLDAP
1207                       RPC_NDR_ECHO
1208                       WB_REQTRANS
1209                       LOCKING
1210                       NDR_OPEN_FILES
1211                       idmap
1212                       IDMAP_TDB_COMMON
1213                       samba-cluster-support
1214                       ''',
1215                  cflags='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
1216                  install=False)
1217
1218 bld.SAMBA3_BINARY('smbconftort',
1219                  source='lib/smbconf/testsuite.c',
1220                  deps='''
1221                       talloc
1222                       smbconf
1223                       popt_samba3
1224                       ''',
1225                  install=False)
1226
1227 bld.SAMBA3_BINARY('replacetort',
1228                  source='../lib/replace/test/main.c',
1229                  deps='replace replace-test',
1230                  install=False)
1231
1232 bld.SAMBA3_BINARY('msgtest',
1233                  source='torture/msgtest.c',
1234                  deps='''
1235                       talloc
1236                       smbconf
1237                       ''',
1238                  install=False)
1239
1240 bld.SAMBA3_BINARY('msg_sink',
1241                  source='torture/msg_sink.c',
1242                  deps='''
1243                       talloc
1244                       smbconf
1245                       ''',
1246                  install=False)
1247
1248 bld.SAMBA3_BINARY('msg_source',
1249                  source='torture/msg_source.c',
1250                  deps='''
1251                       talloc
1252                       smbconf
1253                       ''',
1254                  install=False)
1255
1256 bld.SAMBA3_BINARY('pdbtest',
1257                  source='torture/pdbtest.c',
1258                  deps='''
1259                       talloc
1260                       pdb
1261                       popt_samba3
1262                       AUTH_COMMON
1263                       auth
1264                       ''',
1265                  install=False)
1266
1267 bld.SAMBA3_BINARY('vfstest',
1268                  source='''
1269                         torture/cmd_vfs.c
1270                         torture/vfstest.c
1271                         torture/vfstest_chain.c
1272                         ''',
1273                  deps='''
1274                       vfs
1275                       popt_samba3
1276                       smbconf
1277                       SMBREADLINE
1278                       ''',
1279                  install=False)
1280
1281 bld.SAMBA3_BINARY('versiontest',
1282                  source='lib/version_test.c',
1283                  deps='''
1284                       SAMBA_VERSION
1285                       smbconf
1286                       ''',
1287                  install=False)
1288
1289 bld.SAMBA3_BINARY('timelimit',
1290                  source='script/tests/timelimit.c',
1291                  install=False)
1292
1293 bld.SAMBA3_BINARY('rpc_open_tcp',
1294                  source='torture/rpc_open_tcp.c',
1295                  deps='''
1296                       talloc
1297                       msrpc3
1298                       ''',
1299                  install=False)
1300
1301 bld.SAMBA3_BINARY('vlp',
1302                  source='printing/tests/vlp.c',
1303                  deps='''
1304                       talloc
1305                       smbconf
1306                       ''',
1307                  install=False)
1308
1309
1310 for env in bld.gen_python_environments():
1311     pyrpc_util = bld.pyembed_libname('pyrpc_util')
1312     pytalloc_util = bld.pyembed_libname('pytalloc-util')
1313     bld.SAMBA3_PYTHON('pysmbd',
1314                   source='smbd/pysmbd.c',
1315                   deps=' '.join(['smbd_base', pyrpc_util, pytalloc_util]),
1316                   realname='samba/samba3/smbd.so'
1317                   )
1318
1319 for env in bld.gen_python_environments():
1320     pycredentials = 'pycredentials'
1321     if bld.env['IS_EXTRA_PYTHON']:
1322         pycredentials = 'extra-' + pycredentials
1323     bld.SAMBA3_PYTHON('pylibsmb',
1324                   source='libsmb/pylibsmb.c',
1325                   deps='smbclient samba-credentials %s' % pycredentials,
1326                   realname='samba/samba3/libsmb_samba_internal.so'
1327                   )
1328
1329 bld.SAMBA3_BINARY('spotlight2sparql',
1330                  source='''
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,
1337                  install=False)
1338
1339 ########################## INCLUDES #################################
1340
1341 bld.RECURSE('auth')
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('../examples/winexe')
1358 bld.RECURSE('lib/netapi/tests')
1359 bld.RECURSE('lib/netapi/examples')
1360 bld.RECURSE('smbd/notifyd')
1361 bld.RECURSE('rpcclient')
1362 bld.RECURSE('utils')
1363 bld.RECURSE('nmbd')
1364
1365 bld.ENFORCE_GROUP_ORDERING()
1366 bld.CHECK_PROJECT_RULES()
1367