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