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