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