02ae378602f826bceaf4943df05bdb1fa1997f45
[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 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='''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                     tftw.c''',
128                   deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex',
129                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid',
130                   public_headers='debug.h attr.h byteorder.h data_blob.h discard.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',
131                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
132                   local_include=False,
133                   vnum='0.0.1',
134                   pc_files='samba-util.pc'
135                   )
136
137     bld.SAMBA_LIBRARY('samba-modules',
138                       source='modules.c',
139                       deps='samba-errors samba-util',
140                       local_include=False,
141                       private_library=True)
142
143     bld.SAMBA_LIBRARY('asn1util',
144                       source='asn1.c',
145                       deps='talloc samba-util',
146                       private_library=True,
147                       local_include=False)
148
149
150     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
151                         source='unix_privs.c',
152                         autoproto='unix_privs.h',
153                         deps='replace talloc',
154                         local_include=False,
155                         )
156
157
158     bld.SAMBA_LIBRARY('util_tdb',
159                       source='util_tdb.c',
160                       local_include=False,
161                       public_deps='tdb talloc',
162                       private_library=True
163                       )
164
165     bld.SAMBA_LIBRARY('tevent-util',
166                       source='''
167                           tevent_unix.c
168                           tevent_ntstatus.c
169                           tevent_werror.c
170                           tevent_req_profile.c
171                       ''',
172                       local_include=False,
173                       public_deps='tevent samba-errors',
174                       public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
175                       header_path=[ ('*', 'util') ],
176                       pc_files=[],
177                       vnum='0.0.1'
178                       )
179
180     bld.SAMBA_LIBRARY('util_setid',
181                       source='setid.c',
182                       local_include=False,
183                       private_library=True
184                       )
185
186     bld.SAMBA_SUBSYSTEM('util_ldb',
187                         source='util_ldb.c',
188                         local_include=False,
189                         public_deps='ldb',
190                         public_headers='util_ldb.h'
191                         )
192
193
194     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
195                         source='util_runcmd.c',
196                         local_include=False,
197                         public_deps='tevent'
198                         )
199
200     bld.SAMBA_SUBSYSTEM('UTIL_PW',
201                         source='util_pw.c',
202                         local_include=False,
203                         public_deps='talloc'
204                         )
205
206     bld.SAMBA_LIBRARY('server_id_db',
207                       source='server_id_db.c',
208                       deps='talloc tdb strv util_tdb tdb-wrap samba-util',
209                       local_include=False,
210                       private_library=True)
211
212     bld.SAMBA_SUBSYSTEM('access',
213                         source='access.c',
214                         deps='interfaces samba-util tirpc nsl',
215                         local_include=False)
216
217     bld.SAMBA_SUBSYSTEM('util_str_escape',
218                         source='util_str_escape.c',
219                         deps='talloc',
220                         local_include=False)
221
222     bld.SAMBA_SUBSYSTEM('util_str_hex',
223                         source='util_str_hex.c',
224                         deps='talloc',
225                         local_include=False)
226
227     bld.SAMBA_BINARY('test_rfc1738',
228                      source='tests/rfc1738.c',
229                      deps='cmocka replace samba-util',
230                      local_include=False,
231                      install=False)
232
233     bld.SAMBA_BINARY('test_ms_fnmatch',
234                      source='tests/test_ms_fnmatch.c',
235                      deps='cmocka replace samba-util',
236                      local_include=False,
237                      install=False)