793e24669c958a1d0cc72c7fc2abc227a4192af7
[samba.git] / lib / util / wscript_build
1 #!/usr/bin/env python
2
3 # Please add any new SAMBA_SUBSYSTEM/SAMBA_LIBRARY to the bottom of the file
4 # unless they are also required to build standalone ctdb.
5
6 bld.SAMBA_LIBRARY('time-basic',
7                   source='time_basic.c',
8                   deps='replace',
9                   private_library=True,
10                   local_include=False)
11
12 bld.SAMBA_SUBSYSTEM('tini',
13                     source='tini.c',
14                     deps='',
15                     local_include=False)
16
17 bld.SAMBA_SUBSYSTEM('tiniparser',
18                     source='tiniparser.c',
19                     deps='tini',
20                     local_include=False)
21
22 bld.SAMBA_SUBSYSTEM('strv',
23                     source='strv.c',
24                     deps='talloc',
25                     local_include=False)
26
27 bld.SAMBA_SUBSYSTEM('close-low-fd',
28                     source='close_low_fd.c',
29                     deps='replace',
30                     local_include=False)
31
32 bld.SAMBA_LIBRARY('sys_rw',
33                   source='sys_rw.c sys_rw_data.c',
34                   deps='replace iov_buf',
35                   local_include=False,
36                   private_library=True)
37
38 samba_debug_add_deps = ''
39 samba_debug_add_inc  = ''
40
41 if bld.CONFIG_SET('HAVE_GPFS'):
42     bld.SAMBA_SUBSYSTEM('gpfswrap',
43                         source='gpfswrap.c',
44                         deps='replace',
45                         local_include=False,
46                         includes=bld.CONFIG_GET('CPPPATH_GPFS'))
47     samba_debug_add_deps += ' gpfswrap'
48     samba_debug_add_inc  += bld.CONFIG_GET('CPPPATH_GPFS')
49
50 bld.SAMBA_LIBRARY('samba-debug',
51                   source='debug.c',
52                   deps='replace time-basic close-low-fd talloc socket-blocking' + samba_debug_add_deps,
53                   public_deps='systemd systemd-journal lttng-ust',
54                   local_include=False,
55                   includes=samba_debug_add_inc,
56                   private_library=True)
57
58 bld.SAMBA_LIBRARY('socket-blocking',
59                   source='blocking.c',
60                   local_include=False,
61                   private_library=True)
62
63 bld.SAMBA_LIBRARY('talloc_report',
64                   source='talloc_report.c',
65                   local_include=False,
66                   public_deps='talloc',
67                   private_library=True
68                   )
69
70 bld.SAMBA_SUBSYSTEM('samba-util-core',
71                     source='''data_blob.c util_file.c time.c
72                               signal.c util.c idtree.c fault.c
73                               substitute.c util_process.c util_strlist.c
74                               strv_util.c bitmap.c select.c pidfile.c
75                               become_daemon.c mkdir_p.c''',
76                     deps='''time-basic samba-debug socket-blocking talloc
77                             tevent execinfo pthread strv tini''',
78                     public_deps='systemd systemd-daemon',
79                     local_include=False)
80
81 bld.SAMBA_LIBRARY('iov_buf',
82                   source='iov_buf.c',
83                   deps='talloc',
84                   local_include=False,
85                   private_library=True)
86
87 bld.SAMBA_LIBRARY('msghdr',
88                   source='msghdr.c',
89                   deps='replace iov_buf',
90                   local_include=False,
91                   private_library=True)
92
93 if bld.env.SAMBA_UTIL_CORE_ONLY:
94
95     bld.SAMBA_LIBRARY('tevent-util',
96                       source='tevent_unix.c',
97                       local_include=False,
98                       deps='tevent',
99                       private_library=True)
100
101 else:
102
103     bld.env.public_headers_skip.append('charset_compat.h')
104
105     bld.SAMBA_LIBRARY('genrand',
106                       source='genrand.c',
107                       deps='replace socket-blocking sys_rw',
108                       local_include=False,
109                       private_library=True)
110
111     bld.SAMBA_BINARY('genrandperf',
112                      source='tests/genrandperf.c',
113                      deps='genrand replace',
114                      local_include=False,
115                      install=False)
116
117     bld.SAMBA_LIBRARY('samba-util',
118                   source='''talloc_stack.c smb_threads.c
119                     rbtree.c rfc1738.c system.c getpass.c
120                     genrand_util.c fsusage.c
121                     params.c util_id.c util_net.c
122                     util_strlist_v3.c util_paths.c
123                     idtree_random.c base64.c
124                     util_str.c util_str_common.c ms_fnmatch.c
125                     server_id.c dprintf.c
126                     tevent_debug.c memcache.c unix_match.c tfork.c''',
127                   deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex',
128                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid',
129                   public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h',
130                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
131                   local_include=False,
132                   vnum='0.0.1',
133                   pc_files='samba-util.pc'
134                   )
135
136     bld.SAMBA_LIBRARY('samba-modules',
137                       source='modules.c',
138                       deps='samba-errors samba-util',
139                       local_include=False,
140                       private_library=True)
141
142     bld.SAMBA_LIBRARY('asn1util',
143                       source='asn1.c',
144                       deps='talloc samba-util',
145                       private_library=True,
146                       local_include=False)
147
148
149     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
150                         source='unix_privs.c',
151                         autoproto='unix_privs.h',
152                         deps='replace talloc',
153                         local_include=False,
154                         )
155
156
157     bld.SAMBA_LIBRARY('util_tdb',
158                       source='util_tdb.c',
159                       local_include=False,
160                       public_deps='tdb talloc',
161                       private_library=True
162                       )
163
164     bld.SAMBA_LIBRARY('tevent-util',
165                       source='''
166                           tevent_unix.c
167                           tevent_ntstatus.c
168                           tevent_werror.c
169                       ''',
170                       local_include=False,
171                       public_deps='tevent samba-errors',
172                       public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
173                       header_path=[ ('*', 'util') ],
174                       pc_files=[],
175                       vnum='0.0.1'
176                       )
177
178     bld.SAMBA_LIBRARY('util_setid',
179                       source='setid.c',
180                       local_include=False,
181                       private_library=True
182                       )
183
184     bld.SAMBA_SUBSYSTEM('util_ldb',
185                         source='util_ldb.c',
186                         local_include=False,
187                         public_deps='ldb',
188                         public_headers='util_ldb.h'
189                         )
190
191
192     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
193                         source='util_runcmd.c',
194                         local_include=False,
195                         public_deps='tevent'
196                         )
197
198     bld.SAMBA_SUBSYSTEM('UTIL_PW',
199                         source='util_pw.c',
200                         local_include=False,
201                         public_deps='talloc'
202                         )
203
204     bld.SAMBA_LIBRARY('server_id_db',
205                       source='server_id_db.c',
206                       deps='talloc tdb strv util_tdb tdb-wrap samba-util',
207                       local_include=False,
208                       private_library=True)
209
210     bld.SAMBA_SUBSYSTEM('access',
211                         source='access.c',
212                         deps='interfaces samba-util tirpc nsl',
213                         local_include=False)
214
215     bld.SAMBA_SUBSYSTEM('util_str_escape',
216                         source='util_str_escape.c',
217                         deps='talloc',
218                         local_include=False)
219
220     bld.SAMBA_SUBSYSTEM('util_str_hex',
221                         source='util_str_hex.c',
222                         deps='talloc',
223                         local_include=False)
224
225     bld.SAMBA_BINARY('test_rfc1738',
226                      source='tests/rfc1738.c',
227                      deps='cmocka replace samba-util',
228                      local_include=False,
229                      install=False)
230
231     bld.SAMBA_BINARY('test_ms_fnmatch',
232                      source='tests/test_ms_fnmatch.c',
233                      deps='cmocka replace samba-util',
234                      local_include=False,
235                      install=False)