lib/util: Move util_process from util to util-core
[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 samba_debug_add_deps = ''
33 samba_debug_add_inc  = ''
34
35 if bld.CONFIG_SET('HAVE_GPFS'):
36     bld.SAMBA_SUBSYSTEM('gpfswrap',
37                         source='gpfswrap.c',
38                         deps='replace',
39                         local_include=False,
40                         includes=bld.CONFIG_GET('CPPPATH_GPFS'))
41     samba_debug_add_deps += ' gpfswrap'
42     samba_debug_add_inc  += bld.CONFIG_GET('CPPPATH_GPFS')
43
44 bld.SAMBA_LIBRARY('samba-debug',
45                   source='debug.c',
46                   deps='replace time-basic close-low-fd talloc socket-blocking' + samba_debug_add_deps,
47                   public_deps='systemd systemd-journal lttng-ust',
48                   local_include=False,
49                   includes=samba_debug_add_inc,
50                   private_library=True)
51
52 bld.SAMBA_LIBRARY('socket-blocking',
53                   source='blocking.c',
54                   local_include=False,
55                   private_library=True)
56
57 bld.SAMBA_LIBRARY('talloc_report',
58                   source='talloc_report.c',
59                   local_include=False,
60                   public_deps='talloc',
61                   private_library=True
62                   )
63
64 bld.SAMBA_SUBSYSTEM('samba-util-core',
65                     source='''xfile.c data_blob.c util_file.c time.c
66                               signal.c util.c idtree.c fault.c
67                               substitute.c util_process.c''',
68                     deps='''time-basic samba-debug socket-blocking talloc
69                             tevent execinfo pthread''',
70                     local_include=False)
71
72 bld.SAMBA_LIBRARY('tevent-unix-util',
73                   source='tevent_unix.c',
74                   local_include=False,
75                   deps='tevent',
76                   public_headers='tevent_unix.h',
77                   header_path=[ ('*', 'util') ],
78                   pc_files=[],
79                   vnum='0.0.1')
80
81 if not bld.env.SAMBA_UTIL_CORE_ONLY:
82
83     bld.env.public_headers_skip.append('charset_compat.h')
84
85     bld.SAMBA_LIBRARY('genrand',
86                       source='genrand.c',
87                       deps='replace socket-blocking sys_rw',
88                       local_include=False,
89                       private_library=True)
90
91     bld.SAMBA_BINARY('genrandperf',
92                      source='tests/genrandperf.c',
93                      deps='genrand replace',
94                      local_include=False,
95                      install=False)
96
97     bld.SAMBA_LIBRARY('samba-util',
98                   source='''talloc_stack.c smb_threads.c
99                     rbtree.c rfc1738.c become_daemon.c system.c select.c getpass.c
100                     genrand_util.c fsusage.c
101                     params.c util_id.c util_net.c
102                     util_strlist.c util_paths.c idtree_random.c base64.c
103                     util_str.c util_str_common.c ms_fnmatch.c
104                     server_id.c dprintf.c bitmap.c pidfile.c
105                     tevent_debug.c memcache.c''',
106                   deps='samba-util-core DYNCONFIG close-low-fd tini tiniparser genrand',
107
108                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid systemd systemd-daemon',
109                   public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h',
110                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
111                   local_include=False,
112                   vnum='0.0.1',
113                   pc_files='samba-util.pc'
114                   )
115
116     bld.SAMBA_LIBRARY('samba-modules',
117                       source='modules.c',
118                       deps='errors samba-util',
119                       local_include=False,
120                       private_library=True)
121
122     bld.SAMBA_LIBRARY('asn1util',
123                       source='asn1.c',
124                       deps='talloc samba-util',
125                       private_library=True,
126                       local_include=False)
127
128
129     bld.SAMBA_SUBSYSTEM('UNIX_PRIVS',
130                         source='unix_privs.c',
131                         autoproto='unix_privs.h',
132                         deps='replace talloc',
133                         local_include=False,
134                         )
135
136
137     bld.SAMBA_LIBRARY('util_tdb',
138                       source='util_tdb.c',
139                       local_include=False,
140                       public_deps='tdb talloc',
141                       private_library=True
142                       )
143
144     bld.SAMBA_LIBRARY('tevent-util',
145                       source='tevent_ntstatus.c tevent_werror.c',
146                       local_include=False,
147                       public_deps='tevent errors tevent-unix-util',
148                       public_headers='tevent_ntstatus.h tevent_werror.h',
149                       header_path=[ ('*', 'util') ],
150                       pc_files=[],
151                       vnum='0.0.1'
152                       )
153
154     bld.SAMBA_LIBRARY('util_setid',
155                       source='setid.c',
156                       local_include=False,
157                       private_library=True
158                       )
159
160     bld.SAMBA_SUBSYSTEM('util_ldb',
161                         source='util_ldb.c',
162                         local_include=False,
163                         public_deps='ldb',
164                         public_headers='util_ldb.h'
165                         )
166
167
168     bld.SAMBA_SUBSYSTEM('UTIL_RUNCMD',
169                         source='util_runcmd.c',
170                         local_include=False,
171                         public_deps='tevent'
172                         )
173
174     bld.SAMBA_SUBSYSTEM('UTIL_PW',
175                         source='util_pw.c',
176                         local_include=False,
177                         public_deps='talloc'
178                         )
179
180     bld.SAMBA_LIBRARY('server_id_db',
181                       source='server_id_db.c',
182                       deps='talloc tdb strv util_tdb tdb-wrap samba-util',
183                       local_include=False,
184                       private_library=True)
185
186     bld.SAMBA_LIBRARY('iov_buf',
187                       source='iov_buf.c',
188                       local_include=False,
189                       private_library=True)
190
191     bld.SAMBA3_LIBRARY('sys_rw',
192                        source='sys_rw.c sys_rw_data.c',
193                        deps='replace iov_buf',
194                        local_include=False,
195                        private_library=True)