s3: smbd: Move check_fsp_open() and check_fsp() to smb1_reply.c
[Samba.git] / lib / util / wscript_build
blob8eac1013394565ae1ba1450aebb5e29110127f1d
1 #!/usr/bin/env python
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.
6 bld.SAMBA_LIBRARY('time-basic',
7 source='time_basic.c',
8 deps='replace',
9 private_library=True,
10 local_include=False)
12 bld.SAMBA_SUBSYSTEM('tini',
13 source='tini.c',
14 provide_builtin_linking=True,
15 local_include=False)
17 bld.SAMBA_SUBSYSTEM('tiniparser',
18 source='tiniparser.c',
19 deps='tini',
20 provide_builtin_linking=True,
21 local_include=False)
23 bld.SAMBA_SUBSYSTEM('strv',
24 source='strv.c',
25 deps='talloc',
26 local_include=False)
28 bld.SAMBA_SUBSYSTEM('close-low-fd',
29 source='close_low_fd.c',
30 deps='replace',
31 local_include=False)
33 bld.SAMBA_LIBRARY('sys_rw',
34 source='sys_rw.c sys_rw_data.c',
35 deps='replace iov_buf',
36 local_include=False,
37 private_library=True)
39 samba_debug_add_deps = ''
40 samba_debug_add_inc = ''
42 if bld.CONFIG_SET('HAVE_GPFS'):
43 bld.SAMBA_SUBSYSTEM('gpfswrap',
44 source='gpfswrap.c',
45 deps='replace',
46 local_include=False,
47 includes=bld.CONFIG_GET('CPPPATH_GPFS'))
48 samba_debug_add_deps += ' gpfswrap'
49 samba_debug_add_inc += bld.CONFIG_GET('CPPPATH_GPFS')
51 bld.SAMBA_LIBRARY('samba-debug',
52 source='debug.c',
53 deps='replace time-basic close-low-fd talloc socket-blocking' + samba_debug_add_deps,
54 public_deps='systemd systemd-journal lttng-ust',
55 local_include=False,
56 includes='lib/util/debug-classes ' + samba_debug_add_inc,
57 private_library=True)
59 bld.SAMBA_LIBRARY('socket-blocking',
60 source='blocking.c',
61 local_include=False,
62 private_library=True)
64 bld.SAMBA_LIBRARY('talloc_report',
65 source='talloc_report.c',
66 local_include=False,
67 public_deps='talloc',
68 private_library=True
71 bld.SAMBA_LIBRARY('talloc_report_printf',
72 source='talloc_report_printf.c',
73 local_include=False,
74 public_deps='talloc',
75 private_library=True
78 bld.SAMBA_SUBSYSTEM('smb-panic',
79 source='''
80 fault.c
81 signal.c
82 ''',
83 deps='''
84 replace
85 samba-debug
86 LIBUNWIND
87 execinfo
88 ''',
89 local_include=False)
91 bld.SAMBA_SUBSYSTEM('samba-util-core',
92 source='''
93 data_blob.c
94 util_file.c
95 sys_popen.c
96 time.c
97 util.c
98 idtree.c
99 substitute.c
100 util_process.c
101 util_strlist.c
102 strv_util.c
103 bitmap.c
104 select.c
105 pidfile.c
106 become_daemon.c
107 mkdir_p.c
108 ''',
109 deps='''
110 time-basic
111 samba-debug
112 socket-blocking
113 talloc
114 tevent
115 execinfo
116 pthread
117 strv
118 tini
119 smb_strtox
120 smb-panic
121 gnutls
122 ''',
123 public_deps='systemd systemd-daemon sys_rw',
124 local_include=False)
126 bld.SAMBA_SUBSYSTEM('smb_strtox',
127 source='smb_strtox.c',
128 provide_builtin_linking=True,
129 local_include=False)
132 bld.SAMBA_LIBRARY('iov_buf',
133 source='iov_buf.c',
134 deps='talloc',
135 local_include=False,
136 private_library=True)
138 bld.SAMBA_LIBRARY('msghdr',
139 source='msghdr.c',
140 deps='replace iov_buf',
141 local_include=False,
142 private_library=True)
144 bld.SAMBA_LIBRARY('genrand',
145 source='genrand.c',
146 deps='replace gnutls smb-panic',
147 local_include=False,
148 private_library=True)
150 bld.SAMBA_LIBRARY('stable_sort',
151 source='stable_sort.c',
152 deps='replace',
153 public_deps='talloc',
154 local_include=False,
155 private_library=True)
157 if bld.env.SAMBA_UTIL_CORE_ONLY:
159 bld.SAMBA_LIBRARY('tevent-util',
160 source='tevent_unix.c',
161 local_include=False,
162 deps='tevent',
163 private_library=True)
165 else:
167 bld.env.public_headers_skip.append('charset_compat.h')
169 bld.SAMBA_BINARY('genrandperf',
170 source='tests/genrandperf.c',
171 deps='genrand replace',
172 local_include=False,
173 install=False)
175 # TODO: Rewrite ms_fnmatch_core() for a better API.
176 ms_fnmatch_cflags=''
177 if bld.CONFIG_SET('HAVE_WNO_ERROR_ARRAY_BOUNDS'):
178 ms_fnmatch_cflags='-Wno-error=array-bounds'
179 bld.SAMBA_SUBSYSTEM('SAMBA_UTIL_MS_FNMATCH',
180 source='ms_fnmatch.c',
181 deps='talloc',
182 cflags=ms_fnmatch_cflags,
183 local_include=False)
185 bld.SAMBA_LIBRARY('samba-util',
186 source='''
187 base64.c
188 dprintf.c
189 fsusage.c
190 genrand_util.c
191 getpass.c
192 idtree_random.c
193 memcache.c
194 params.c
195 rbtree.c
196 rfc1738.c
197 server_id.c
198 smb_threads.c
199 system.c
200 talloc_keep_secret.c
201 talloc_stack.c
202 tevent_debug.c
203 tfork.c
204 tftw.c
205 unix_match.c
206 util_id.c
207 util_net.c
208 util_paths.c
209 util_str.c
210 util_str_common.c
211 util_strlist_v3.c
212 ''',
213 deps='''
214 samba-util-core
215 DYNCONFIG
216 close-low-fd
217 tiniparser
218 genrand
219 util_str_hex
220 SAMBA_UTIL_MS_FNMATCH
221 ''',
222 public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid',
223 public_headers='''
224 attr.h
225 data_blob.h
226 debug.h
227 discard.h
228 time.h
229 idtree.h
230 idtree_random.h
231 blocking.h
232 signal.h
233 substitute.h
234 fault.h
235 genrand.h
236 tfork.h
237 ''',
238 header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
239 local_include=False,
240 vnum='0.0.1',
241 pc_files='samba-util.pc'
244 bld.SAMBA_LIBRARY('samba-modules',
245 source='modules.c',
246 deps='samba-errors samba-util',
247 local_include=False,
248 private_library=True)
250 bld.SAMBA_LIBRARY('asn1util',
251 source='asn1.c',
252 deps='talloc samba-util',
253 private_library=True,
254 local_include=False)
257 bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
258 source='unix_privs.c',
259 autoproto='unix_privs.h',
260 deps='replace talloc',
261 local_include=False,
265 bld.SAMBA_LIBRARY('util_tdb',
266 source='util_tdb.c',
267 local_include=False,
268 public_deps='tdb talloc',
269 private_library=True
272 bld.SAMBA_LIBRARY('tevent-util',
273 source='''
274 tevent_unix.c
275 tevent_ntstatus.c
276 tevent_werror.c
277 tevent_req_profile.c
278 ''',
279 local_include=False,
280 public_deps='tevent samba-errors',
281 public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
282 header_path=[ ('*', 'util') ],
283 pc_files=[],
284 vnum='0.0.1'
287 bld.SAMBA_LIBRARY('util_setid',
288 source='setid.c',
289 local_include=False,
290 private_library=True
293 bld.SAMBA_SUBSYSTEM('util_ldb',
294 source='util_ldb.c',
295 local_include=False,
296 public_deps='ldb',
297 public_headers='util_ldb.h'
301 bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
302 source='util_runcmd.c',
303 local_include=False,
304 public_deps='tevent'
307 bld.SAMBA_SUBSYSTEM('UTIL_PW',
308 source='util_pw.c',
309 local_include=False,
310 public_deps='talloc'
313 bld.SAMBA_LIBRARY('server_id_db',
314 source='server_id_db.c',
315 deps='talloc tdb strv util_tdb tdb-wrap samba-util',
316 local_include=False,
317 private_library=True)
319 bld.SAMBA_SUBSYSTEM('access',
320 source='access.c',
321 deps='interfaces samba-util',
322 local_include=False)
324 bld.SAMBA_SUBSYSTEM('util_str_escape',
325 source='util_str_escape.c',
326 deps='talloc',
327 local_include=False)
329 bld.SAMBA_SUBSYSTEM('util_str_hex',
330 source='util_str_hex.c',
331 deps='talloc',
332 local_include=False)
334 bld.SAMBA_BINARY('test_rfc1738',
335 source='tests/rfc1738.c',
336 deps='cmocka replace samba-util',
337 local_include=False,
338 for_selftest=True)
340 bld.SAMBA_BINARY('test_ms_fnmatch',
341 source='tests/test_ms_fnmatch.c',
342 deps='cmocka replace samba-util',
343 local_include=False,
344 for_selftest=True)
346 bld.SAMBA_BINARY('test_talloc_keep_secret',
347 source='tests/test_talloc_keep_secret.c',
348 deps='cmocka replace samba-util',
349 local_include=False,
350 for_selftest=True)
352 bld.SAMBA_BINARY('test_byteorder',
353 source='tests/test_byteorder.c',
354 deps='cmocka replace samba-util',
355 local_include=False,
356 for_selftest=True)
358 bld.SAMBA_BINARY('test_bytearray',
359 source='tests/test_bytearray.c',
360 deps='cmocka replace samba-util',
361 local_include=False,
362 for_selftest=True)
364 bld.SAMBA_BINARY('test_byteorder_verify',
365 source='tests/test_byteorder_verify.c',
366 deps='cmocka replace samba-util',
367 local_include=False,
368 for_selftest=True)
370 bld.SAMBA_BINARY('test_util_paths',
371 source='tests/test_util_paths.c',
372 deps='cmocka replace talloc samba-util',
373 local_include=False,
374 for_selftest=True)
376 bld.SAMBA_BINARY('test_util',
377 source='tests/test_util.c',
378 deps='cmocka replace talloc samba-util',
379 local_include=False,
380 for_selftest=True)
382 bld.SAMBA_BINARY('test_memcache',
383 source='tests/test_memcache.c',
384 deps='cmocka replace talloc samba-util',
385 local_include=False,
386 for_selftest=True)
388 bld.SAMBA_BINARY('test_sys_rw',
389 source='tests/test_sys_rw.c',
390 deps='cmocka replace samba-util',
391 local_include=False,
392 for_selftest=True)
394 bld.SAMBA_BINARY('test_s4_logging',
395 source='tests/test_logging.c',
396 deps=' '.join(['CMDLINE_S4',
397 'samba-util',
398 'popt']),
399 local_include=False,
400 for_selftest=True)
402 bld.SAMBA_BINARY('test_s3_logging',
403 source='tests/test_logging.c',
404 deps=' '.join(['CMDLINE_S3',
405 'samba-util',
406 'popt']),
407 cflags="-D USING_CMDLINE_S3",
408 local_include=False,
409 for_selftest=True)
411 bld.SAMBA_BINARY('test_stable_sort',
412 source='tests/test_stable_sort.c',
413 deps='cmocka replace talloc stable_sort',
414 local_include=False,
415 for_selftest=True)