util: Move become_daemon.c to samba-util-core
[metze/samba/wip.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 ''',
76                     deps='''time-basic samba-debug socket-blocking talloc
77                             tevent execinfo pthread strv''',
78                     local_include=False)
79
80 bld.SAMBA_LIBRARY('iov_buf',
81                   source='iov_buf.c',
82                   deps='talloc',
83                   local_include=False,
84                   private_library=True)
85
86 bld.SAMBA_LIBRARY('msghdr',
87                   source='msghdr.c',
88                   deps='replace iov_buf',
89                   local_include=False,
90                   private_library=True)
91
92 if bld.env.SAMBA_UTIL_CORE_ONLY:
93
94     bld.SAMBA_LIBRARY('tevent-util',
95                       source='tevent_unix.c',
96                       local_include=False,
97                       deps='tevent',
98                       private_library=True)
99
100 else:
101
102     bld.env.public_headers_skip.append('charset_compat.h')
103
104     bld.SAMBA_LIBRARY('genrand',
105                       source='genrand.c',
106                       deps='replace socket-blocking sys_rw',
107                       local_include=False,
108                       private_library=True)
109
110     bld.SAMBA_BINARY('genrandperf',
111                      source='tests/genrandperf.c',
112                      deps='genrand replace',
113                      local_include=False,
114                      install=False)
115
116     bld.SAMBA_LIBRARY('samba-util',
117                   source='''talloc_stack.c smb_threads.c
118                     rbtree.c rfc1738.c system.c getpass.c
119                     genrand_util.c fsusage.c
120                     params.c util_id.c util_net.c
121                     util_strlist_v3.c util_paths.c
122                     idtree_random.c base64.c
123                     util_str.c util_str_common.c ms_fnmatch.c
124                     server_id.c dprintf.c
125                     tevent_debug.c memcache.c unix_match.c tfork.c''',
126                   deps='samba-util-core DYNCONFIG close-low-fd tini tiniparser genrand',
127                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid systemd systemd-daemon',
128                   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',
129                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
130                   local_include=False,
131                   vnum='0.0.1',
132                   pc_files='samba-util.pc'
133                   )
134
135     bld.SAMBA_LIBRARY('samba-modules',
136                       source='modules.c',
137                       deps='samba-errors samba-util',
138                       local_include=False,
139                       private_library=True)
140
141     bld.SAMBA_LIBRARY('asn1util',
142                       source='asn1.c',
143                       deps='talloc samba-util',
144                       private_library=True,
145                       local_include=False)
146
147
148     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
149                         source='unix_privs.c',
150                         autoproto='unix_privs.h',
151                         deps='replace talloc',
152                         local_include=False,
153                         )
154
155
156     bld.SAMBA_LIBRARY('util_tdb',
157                       source='util_tdb.c',
158                       local_include=False,
159                       public_deps='tdb talloc',
160                       private_library=True
161                       )
162
163     bld.SAMBA_LIBRARY('tevent-util',
164                       source='tevent_unix.c tevent_ntstatus.c tevent_werror.c',
165                       local_include=False,
166                       public_deps='tevent samba-errors',
167                       public_headers='tevent_ntstatus.h tevent_unix.h tevent_werror.h',
168                       header_path=[ ('*', 'util') ],
169                       pc_files=[],
170                       vnum='0.0.1'
171                       )
172
173     bld.SAMBA_LIBRARY('util_setid',
174                       source='setid.c',
175                       local_include=False,
176                       private_library=True
177                       )
178
179     bld.SAMBA_SUBSYSTEM('util_ldb',
180                         source='util_ldb.c',
181                         local_include=False,
182                         public_deps='ldb',
183                         public_headers='util_ldb.h'
184                         )
185
186
187     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
188                         source='util_runcmd.c',
189                         local_include=False,
190                         public_deps='tevent'
191                         )
192
193     bld.SAMBA_SUBSYSTEM('UTIL_PW',
194                         source='util_pw.c',
195                         local_include=False,
196                         public_deps='talloc'
197                         )
198
199     bld.SAMBA_LIBRARY('server_id_db',
200                       source='server_id_db.c',
201                       deps='talloc tdb strv util_tdb tdb-wrap samba-util',
202                       local_include=False,
203                       private_library=True)
204
205     bld.SAMBA_SUBSYSTEM('access',
206                         source='access.c',
207                         deps='interfaces samba-util',
208                         local_include=False)
209
210     bld.SAMBA_SUBSYSTEM('util_str_escape',
211                         source='util_str_escape.c',
212                         deps='talloc',
213                         local_include=False)