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