8046a8ba07ef417c7db01a057c5c8a54ae4e7a13
[bbaumbach/samba-autobuild/.git] / lib / util / wscript_build
1 #!/usr/bin/env python
2
3 common_util_sources = '''talloc_stack.c smb_threads.c xfile.c data_blob.c
4                     util_file.c time.c rbtree.c rfc1738.c select.c
5                     genrand.c fsusage.c blocking.c become_daemon.c
6                     signal.c system.c params.c util.c util_id.c util_net.c
7                     util_strlist.c util_paths.c idtree.c debug.c fault.c base64.c
8                     util_str.c util_str_common.c substitute.c ms_fnmatch.c
9                     server_id.c dprintf.c'''
10
11 common_util_headers = 'debug.h'
12 common_util_public_deps = 'talloc pthread LIBCRYPTO CHARSET'
13 s4_util_sources = '''parmlist.c'''
14 s4_util_deps = 'DYNCONFIG'
15 s4_util_public_deps = 'talloc execinfo uid_wrapper'
16 s4_util_public_headers = 'attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h util.h string_wrappers.h'
17 s4_util_header_path = [ ('dlinklist.h util.h', '.'), ('*', 'util') ]
18
19 if bld.env._SAMBA_BUILD_ == 3:
20     # as we move files into common between samba-util and samba-util3, move them here.
21     # Both samba-util and samba-util3 depend on this private library
22     bld.SAMBA_LIBRARY('samba-util-common',
23                     source=common_util_sources,
24                     public_deps=common_util_public_deps,
25                     # until we get all the dependencies in this library in common
26                     # we need to allow this library to be built with unresolved symbols
27                     allow_undefined_symbols=True,
28                     local_include=False,
29                     public_headers=common_util_headers,
30                     header_path= [('*', 'util') ],
31                     private_library=True
32                     )
33
34 else:
35     bld.SAMBA_LIBRARY('samba-util',
36                       source=s4_util_sources + " " + common_util_sources,
37                       deps=s4_util_deps,
38                       public_deps=s4_util_public_deps + ' ' + common_util_public_deps,
39                       public_headers=s4_util_public_headers + ' ' + common_util_headers,
40                       header_path= s4_util_header_path,
41                       local_include=False,
42                       vnum='0.0.1',
43                       pc_files='samba-util.pc'
44                       )
45
46     # dummy subsystem for avoid wider deps changes.
47     bld.SAMBA_SUBSYSTEM('samba-util-common',
48                         source=[],
49                         deps='samba-util',
50                         local_include=False,)
51
52 bld.SAMBA_LIBRARY('asn1util',
53                   source='asn1.c',
54                   deps='talloc samba-util-common',
55                   private_library=True,
56                   local_include=False)
57
58
59 bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
60         source='unix_privs.c',
61         autoproto='unix_privs.h',
62         deps='replace talloc',
63         local_include=False,
64         )
65
66
67 bld.SAMBA_LIBRARY('wrap_xattr',
68         source='wrap_xattr.c',
69         public_deps='attr',
70         deps='talloc',
71         local_include=False,
72         private_library=True
73         )
74
75
76 bld.SAMBA_LIBRARY('UTIL_TDB',
77         source='util_tdb.c',
78         local_include=False,
79         public_deps='tdb_compat talloc',
80                   private_library=True
81         )
82
83 bld.SAMBA_SUBSYSTEM('UTIL_TEVENT',
84         source='tevent_unix.c tevent_ntstatus.c tevent_werror.c',
85         local_include=False,
86         public_deps='tevent',
87         public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
88         header_path=[ ('*', 'util') ],
89         )
90
91
92 if bld.env._SAMBA_BUILD_ == 4:
93         bld.SAMBA_SUBSYSTEM('util_ldb',
94                 source='util_ldb.c',
95                 local_include=False,
96                 public_deps='ldb',
97                 public_headers='util_ldb.h'
98                 )
99
100
101 bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
102         source='util_runcmd.c',
103         local_include=False,
104         public_deps='tevent'
105         )
106
107 bld.SAMBA_SUBSYSTEM('UTIL_PW',
108         source='util_pw.c',
109         local_include=False,
110         public_deps='talloc'
111         )
112
113
114 bld.SAMBA_LIBRARY('tdb-wrap',
115                   source='tdb_wrap.c',
116                   deps='tdb_compat talloc samba-util',
117                   private_library=True,
118                   local_include=False
119                   )
120