pyldb: avoid segfault when adding an element with no name
[kai/samba-autobuild/.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 sys_popen.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 sys_rw',
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='''
119                          base64.c
120                          dprintf.c
121                          fsusage.c
122                          genrand_util.c
123                          getpass.c
124                          idtree_random.c
125                          memcache.c
126                          ms_fnmatch.c
127                          params.c
128                          rbtree.c
129                          rfc1738.c
130                          server_id.c
131                          smb_threads.c
132                          system.c
133                          talloc_keep_secret.c
134                          talloc_stack.c
135                          tevent_debug.c
136                          tfork.c
137                          tftw.c
138                          unix_match.c
139                          util_id.c
140                          util_net.c
141                          util_paths.c
142                          util_str.c
143                          util_str_common.c
144                          util_strlist_v3.c
145                          ''',
146                   deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex',
147                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid',
148                   public_headers='''
149                                  attr.h
150                                  byteorder.h
151                                  data_blob.h
152                                  debug.h
153                                  discard.h
154                                  time.h
155                                  string_wrappers.h
156                                  idtree.h
157                                  idtree_random.h
158                                  blocking.h
159                                  signal.h
160                                  substitute.h
161                                  fault.h
162                                  genrand.h
163                                  tfork.h
164                                  ''',
165                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
166                   local_include=False,
167                   vnum='0.0.1',
168                   pc_files='samba-util.pc'
169                   )
170
171     bld.SAMBA_LIBRARY('samba-modules',
172                       source='modules.c',
173                       deps='samba-errors samba-util',
174                       local_include=False,
175                       private_library=True)
176
177     bld.SAMBA_LIBRARY('asn1util',
178                       source='asn1.c',
179                       deps='talloc samba-util',
180                       private_library=True,
181                       local_include=False)
182
183
184     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
185                         source='unix_privs.c',
186                         autoproto='unix_privs.h',
187                         deps='replace talloc',
188                         local_include=False,
189                         )
190
191
192     bld.SAMBA_LIBRARY('util_tdb',
193                       source='util_tdb.c',
194                       local_include=False,
195                       public_deps='tdb talloc',
196                       private_library=True
197                       )
198
199     bld.SAMBA_LIBRARY('tevent-util',
200                       source='''
201                           tevent_unix.c
202                           tevent_ntstatus.c
203                           tevent_werror.c
204                           tevent_req_profile.c
205                       ''',
206                       local_include=False,
207                       public_deps='tevent samba-errors',
208                       public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
209                       header_path=[ ('*', 'util') ],
210                       pc_files=[],
211                       vnum='0.0.1'
212                       )
213
214     bld.SAMBA_LIBRARY('util_setid',
215                       source='setid.c',
216                       local_include=False,
217                       private_library=True
218                       )
219
220     bld.SAMBA_SUBSYSTEM('util_ldb',
221                         source='util_ldb.c',
222                         local_include=False,
223                         public_deps='ldb',
224                         public_headers='util_ldb.h'
225                         )
226
227
228     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
229                         source='util_runcmd.c',
230                         local_include=False,
231                         public_deps='tevent'
232                         )
233
234     bld.SAMBA_SUBSYSTEM('UTIL_PW',
235                         source='util_pw.c',
236                         local_include=False,
237                         public_deps='talloc'
238                         )
239
240     bld.SAMBA_LIBRARY('server_id_db',
241                       source='server_id_db.c',
242                       deps='talloc tdb strv util_tdb tdb-wrap samba-util',
243                       local_include=False,
244                       private_library=True)
245
246     bld.SAMBA_SUBSYSTEM('access',
247                         source='access.c',
248                         deps='interfaces samba-util tirpc nsl',
249                         local_include=False)
250
251     bld.SAMBA_SUBSYSTEM('util_str_escape',
252                         source='util_str_escape.c',
253                         deps='talloc',
254                         local_include=False)
255
256     bld.SAMBA_SUBSYSTEM('util_str_hex',
257                         source='util_str_hex.c',
258                         deps='talloc',
259                         local_include=False)
260
261     bld.SAMBA_BINARY('test_rfc1738',
262                      source='tests/rfc1738.c',
263                      deps='cmocka replace samba-util',
264                      local_include=False,
265                      install=False)
266
267     bld.SAMBA_BINARY('test_ms_fnmatch',
268                      source='tests/test_ms_fnmatch.c',
269                      deps='cmocka replace samba-util',
270                      local_include=False,
271                      install=False)
272
273     bld.SAMBA_BINARY('test_talloc_keep_secret',
274                      source='tests/test_talloc_keep_secret.c',
275                      deps='cmocka replace samba-util',
276                      local_include=False,
277                      install=False)