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