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