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