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