]>
Commit | Line | Data |
---|---|---|
d4c880d5 | 1 | project('util-linux', 'c', |
e0c1a86b | 2 | version : run_command('tools/git-version-gen', check: true).stdout(), |
c12276dd | 3 | meson_version: '>=0.60.0', |
6240e445 TW |
4 | license : 'GPLv2+', |
5 | default_options : [ | |
6 | 'c_std=c99', | |
7 | 'cpp_std=c++11', | |
8 | ]) | |
d4c880d5 | 9 | |
3e0bbb12 | 10 | fs = import('fs') |
d4c880d5 ZJS |
11 | pkgconfig = import('pkgconfig') |
12 | ||
13 | libblkid_version = '1.1.0' | |
50736e49 | 14 | libblkid_date = '01-Jun-2021' |
d4c880d5 ZJS |
15 | libuuid_version = '1.3.0' |
16 | libmount_version = '1.1.0' | |
17 | libsmartcols_version = '1.1.0' | |
18 | libfdisk_version = '1.1.0' | |
19 | ||
20 | prefixdir = get_option('prefix') | |
21 | if not prefixdir.startswith('/') | |
22 | error('Prefix is not absolute: "@0@"'.format(prefixdir)) | |
23 | endif | |
24 | bindir = join_paths(prefixdir, get_option('bindir')) | |
25 | sbindir = join_paths(prefixdir, get_option('sbindir')) | |
26 | sysconfstaticdir = join_paths(prefixdir, 'lib') | |
12ebed03 | 27 | docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux') |
53b37016 | 28 | mandir = join_paths(prefixdir, get_option('mandir')) |
d4c880d5 | 29 | runstatedir = '/run' |
0eb2a476 | 30 | execprefixdir = prefixdir |
5e67b421 | 31 | sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) |
0eb2a476 KL |
32 | usrbin_exec_dir = join_paths(execprefixdir, bindir) |
33 | usrsbin_exec_dir = join_paths(execprefixdir, sbindir) | |
38bb89ee | 34 | bash_completion = dependency('bash-completion', required : get_option('build-bash-completion')) |
d4c880d5 | 35 | |
308a0979 KZ |
36 | vendordir = get_option('vendordir') |
37 | ||
d4c880d5 ZJS |
38 | add_project_arguments('-D_GNU_SOURCE', language : 'c') |
39 | ||
40 | cc = meson.get_compiler('c') | |
41 | ||
42 | conf = configuration_data() | |
3e43f629 RP |
43 | conf.set_quoted('PACKAGE', meson.project_name()) |
44 | conf.set_quoted('PACKAGE_VERSION', meson.project_version()) | |
d4c880d5 ZJS |
45 | package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version()) |
46 | conf.set_quoted('PACKAGE_STRING', package_string) | |
d4c880d5 | 47 | |
d4c880d5 | 48 | pc_version = [] |
922d025a | 49 | pc_version = meson.project_version().split('-')[0].split('.') |
50 | ||
51 | if pc_version.length() < 3 | |
52 | pc_version += '0' | |
53 | endif | |
54 | ||
d4c880d5 ZJS |
55 | pc_version = '.'.join(pc_version) |
56 | ||
57 | conf.set_quoted('LIBBLKID_VERSION', libblkid_version) | |
58 | conf.set_quoted('LIBBLKID_DATE', libblkid_date) | |
59 | ||
60 | conf.set('bindir', bindir) | |
61 | conf.set('sbindir', sbindir) | |
62 | conf.set('runstatedir', runstatedir) | |
5e67b421 | 63 | conf.set('sysconfdir', sysconfdir) |
d4c880d5 ZJS |
64 | conf.set('usrsbin_execdir', usrsbin_exec_dir) |
65 | conf.set('docdir', docdir) | |
66 | conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir) | |
67 | conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir) | |
68 | conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime') | |
69 | conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :( | |
70 | ||
308a0979 KZ |
71 | conf.set_quoted('_PATH_VENDORDIR', vendordir) |
72 | conf.set('USE_VENDORDIR', vendordir == '' ? false : 1) | |
73 | ||
d4c880d5 ZJS |
74 | build_libblkid = not get_option('build-libblkid').disabled() |
75 | conf.set('HAVE_LIBBLKID', build_libblkid ? 1 : false) | |
76 | summary('libblkid', build_libblkid ? 'enabled' : 'disabled', section : 'components') | |
77 | ||
78 | build_libuuid = not get_option('build-libuuid').disabled() | |
79 | conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false) | |
80 | summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components') | |
81 | ||
e23c3262 KZ |
82 | have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0 |
83 | conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false) | |
84 | conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false) | |
85 | ||
7d679f29 | 86 | have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0 |
8bcf89d3 TW |
87 | conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false) |
88 | ||
d4c880d5 ZJS |
89 | build_libmount = not get_option('build-libmount').disabled() |
90 | conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false) | |
375ccf08 | 91 | conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1) |
e23c3262 | 92 | conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false) |
d4c880d5 ZJS |
93 | summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components') |
94 | ||
95 | build_libsmartcols = not get_option('build-libsmartcols').disabled() | |
96 | conf.set('HAVE_LIBSMARTCOLS', build_libsmartcols ? 1 : false) | |
97 | summary('libsmartcols', build_libsmartcols ? 'enabled' : 'disabled', section : 'components') | |
98 | ||
99 | build_libfdisk = not get_option('build-libfdisk').disabled() | |
100 | conf.set('HAVE_LIBFDISK', build_libfdisk ? 1 : false) | |
101 | summary('libfdisk', build_libfdisk ? 'enabled' : 'disabled', section : 'components') | |
102 | ||
103 | build_uuidd = not get_option('build-uuidd').disabled() | |
104 | conf.set('HAVE_UUIDD', build_uuidd ? 1 : false) | |
105 | summary('uuidd', build_uuidd ? 'enabled' : 'disabled', section : 'components') | |
106 | ||
69939195 ZJS |
107 | static_programs = get_option('static-programs') |
108 | need_static_libs = static_programs.length() > 0 # a rough estimate... | |
109 | summary('static programs', static_programs) | |
110 | ||
d4c880d5 ZJS |
111 | LINUX = host_machine.system() in ['linux'] |
112 | BSD = host_machine.system() in ['dragonfly', 'freebsd', 'netbsd', 'openbsd'] | |
113 | ||
114 | ############################################################ | |
115 | ||
116 | code = ''' | |
117 | #include <wchar.h> | |
118 | #include <wctype.h> | |
119 | #include <stdio.h> | |
120 | #include <stdlib.h> | |
121 | int main(void) { | |
122 | wchar_t wc; | |
123 | wint_t w; | |
124 | w = fgetwc(stdin); | |
125 | if (w == WEOF) | |
126 | return 1; | |
127 | wc = w; | |
128 | fputwc(wc,stdout); | |
129 | return 0; | |
130 | } | |
131 | ''' | |
132 | have = cc.compiles(code, name : 'wchar_t support') | |
133 | if not have and get_option('widechar').enabled() | |
134 | error('widechar support requested but unavailable') | |
135 | endif | |
136 | if get_option('ncurses').enabled() and get_option('widechar').enabled() | |
137 | error('widechar support is incompatible with non-wide ncurses') | |
138 | endif | |
139 | conf.set('HAVE_WIDECHAR', have ? 1 : false) | |
140 | ||
141 | headers = ''' | |
142 | byteswap.h | |
143 | crypt.h | |
144 | endian.h | |
145 | err.h | |
146 | errno.h | |
147 | fcntl.h | |
148 | getopt.h | |
149 | inttypes.h | |
150 | langinfo.h | |
151 | lastlog.h | |
152 | libutil.h | |
153 | locale.h | |
154 | mntent.h | |
155 | paths.h | |
156 | pty.h | |
157 | shadow.h | |
158 | stdint.h | |
159 | stdio_ext.h | |
160 | stdlib.h | |
161 | string.h | |
162 | strings.h | |
163 | unistd.h | |
164 | utmp.h | |
165 | utmpx.h | |
908ac36f MY |
166 | asm-generic/fcntl.h |
167 | asm/fcntl.h | |
d4c880d5 ZJS |
168 | asm/io.h |
169 | linux/blkzoned.h | |
170 | linux/capability.h | |
171 | linux/cdrom.h | |
172 | linux/compiler.h | |
173 | linux/falloc.h | |
174 | linux/fd.h | |
0e186591 | 175 | linux/fs.h |
647f80e4 KZ |
176 | linux/fiemap.h |
177 | linux/gsmmux.h | |
0e186591 | 178 | linux/if_alg.h |
ae015d71 | 179 | linux/landlock.h |
0e186591 | 180 | linux/kcmp.h |
d4c880d5 | 181 | linux/net_namespace.h |
647f80e4 | 182 | linux/nsfs.h |
241e4a48 | 183 | linux/mount.h |
0e186591 | 184 | linux/pr.h |
d4c880d5 ZJS |
185 | linux/securebits.h |
186 | linux/tiocl.h | |
187 | linux/version.h | |
188 | linux/watchdog.h | |
189 | net/if.h | |
190 | net/if_dl.h | |
191 | netinet/in.h | |
192 | security/openpam.h | |
193 | security/pam_appl.h | |
194 | security/pam_misc.h | |
195 | sys/disk.h | |
196 | sys/disklabel.h | |
197 | sys/endian.h | |
198 | sys/file.h | |
199 | sys/io.h | |
200 | sys/ioccom.h | |
201 | sys/ioctl.h | |
202 | sys/mkdev.h | |
203 | sys/mount.h | |
204 | sys/param.h | |
aa5adf24 | 205 | sys/pidfd.h |
d4c880d5 ZJS |
206 | sys/prctl.h |
207 | sys/resource.h | |
6e92db54 | 208 | sys/sendfile.h |
d4c880d5 ZJS |
209 | sys/signalfd.h |
210 | sys/socket.h | |
211 | sys/sockio.h | |
212 | sys/stat.h | |
0e186591 | 213 | sys/statfs.h |
d4c880d5 ZJS |
214 | sys/swap.h |
215 | sys/syscall.h | |
216 | sys/sysmacros.h | |
217 | sys/time.h | |
218 | sys/timex.h | |
219 | sys/ttydefaults.h | |
220 | sys/types.h | |
221 | sys/ucred.h | |
222 | sys/un.h | |
0e186591 | 223 | sys/vfs.h |
647f80e4 | 224 | sys/xattr.h |
d4c880d5 ZJS |
225 | '''.split() |
226 | ||
227 | lib_m = cc.find_library('m') | |
228 | ||
229 | lib_tinfo = dependency( | |
230 | 'tinfo', | |
231 | required : get_option('tinfo')) | |
232 | ||
233 | lib_ncursesw = dependency( | |
234 | 'ncursesw', | |
235 | required : get_option('ncursesw')) | |
236 | if lib_ncursesw.found() | |
237 | headers += ['ncursesw/ncurses.h', | |
238 | 'ncursesw/term.h', | |
239 | 'ncurses.h', | |
240 | 'term.h'] | |
241 | lib_ncurses = disabler() | |
242 | else | |
243 | lib_ncurses = dependency( | |
244 | 'ncurses', | |
245 | required : get_option('ncurses')) | |
246 | headers += ['ncurses.h', | |
247 | 'term.h'] | |
248 | endif | |
249 | ||
250 | conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found()) | |
251 | conf.set('HAVE_LIBNCURSES', lib_ncurses.found()) | |
252 | conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found()) | |
253 | ||
254 | lib_slang = dependency( | |
255 | 'slang', | |
256 | required : get_option('slang')) | |
257 | if lib_slang.found() | |
258 | headers += ['slang.h', | |
259 | 'slang/slang.h', | |
260 | 'slcurses.h', | |
261 | 'slang/slcurses.h'] | |
262 | endif | |
263 | conf.set('HAVE_SLANG', lib_slang.found()) | |
264 | ||
265 | foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses] | |
266 | if curses_libs.found() | |
6e13cfed KZ |
267 | have = cc.has_function('use_default_colors', dependencies : curses_libs) |
268 | conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false) | |
269 | have = cc.has_function('resizeterm', dependencies : curses_libs) | |
270 | conf.set('HAVE_RESIZETERM', have ? 1 : false) | |
d4c880d5 ZJS |
271 | break |
272 | endif | |
273 | endforeach | |
274 | ||
275 | lib_z = dependency( | |
276 | 'zlib', | |
277 | required : get_option('zlib')) | |
278 | ||
279 | lib_readline = dependency( | |
280 | 'readline', | |
281 | required : get_option('readline')) | |
282 | conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false) | |
283 | ||
69939195 ZJS |
284 | lib_readline_static = dependency( |
285 | 'readline', | |
286 | static : true, | |
287 | required : need_static_libs ? get_option('readline') : disabler()) | |
288 | ||
fc63a3d0 RP |
289 | if meson.version().version_compare('>= 0.59.0') |
290 | lib_intl = dependency( | |
291 | 'intl', | |
292 | required : get_option('nls')) | |
293 | conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false) | |
294 | else | |
295 | if get_option('nls').enabled() | |
296 | error('nls is not supported with meson before 0.59.0') | |
297 | endif | |
298 | lib_intl = dependency('', required : false) | |
299 | endif | |
300 | ||
d4c880d5 ZJS |
301 | lib_user = dependency( |
302 | 'libuser', | |
303 | version : '>= 0.58', | |
304 | required : get_option('libuser')) | |
305 | conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false) | |
306 | ||
307 | lib_util = cc.find_library( | |
308 | 'util', | |
309 | required : get_option('libutil')) | |
310 | conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false) | |
311 | ||
312 | lib_utempter = cc.find_library( | |
313 | 'utempter', | |
314 | required : get_option('libutempter')) | |
315 | conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false) | |
316 | ||
317 | systemd = dependency( | |
318 | 'systemd', | |
319 | required : get_option('systemd')) | |
320 | ||
321 | lib_systemd = dependency( | |
322 | 'libsystemd', | |
323 | required : get_option('systemd')) | |
324 | conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false) | |
0e186591 | 325 | conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false) |
d4c880d5 | 326 | |
87fcd95a TK |
327 | have = cc.has_function( |
328 | 'sd_session_get_username', | |
329 | dependencies : lib_systemd) | |
330 | conf.set('HAVE_DECL_SD_SESSION_GET_USERNAME', have ? 1 : false) | |
331 | ||
d4c880d5 ZJS |
332 | lib_udev = dependency( |
333 | 'libudev', | |
334 | required : get_option('systemd')) | |
335 | conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false) | |
336 | ||
337 | lib_crypt = cc.find_library('crypt') | |
338 | ||
e279e9b2 RP |
339 | lib_pam = cc.find_library('pam', required : get_option('build-login')) |
340 | if not lib_pam.found() | |
341 | lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh')) | |
342 | endif | |
343 | if not lib_pam.found() | |
344 | lib_pam = cc.find_library('pam', required : get_option('build-su')) | |
345 | endif | |
346 | if not lib_pam.found() | |
347 | lib_pam = cc.find_library('pam', required : get_option('build-runuser')) | |
348 | endif | |
d4c880d5 ZJS |
349 | if lib_pam.found() |
350 | lib_pam_misc = cc.find_library('pam_misc') | |
351 | lib_pam = [lib_pam, lib_pam_misc] | |
7bce9496 RP |
352 | else |
353 | lib_pam_misc = declare_dependency() | |
d4c880d5 ZJS |
354 | endif |
355 | ||
356 | lib_cryptsetup = dependency( | |
357 | 'libcryptsetup', | |
358 | required : get_option('cryptsetup')) | |
359 | conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false) | |
360 | ||
e6a4b4a1 | 361 | if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled() |
324aa32c RP |
362 | if meson.version().version_compare('>= 0.62.0') |
363 | lib_dl = dependency('dl') | |
364 | else | |
365 | lib_dl = cc.find_library('dl') | |
366 | endif | |
e6a4b4a1 LB |
367 | conf.set('CRYPTSETUP_VIA_DLOPEN', 1) |
368 | summary('cryptsetup support (dlopen)', | |
369 | 'enabled', | |
370 | section : 'components') | |
371 | else | |
372 | summary('cryptsetup support', | |
373 | lib_cryptsetup.found() ? 'enabled' : 'disabled', | |
374 | section : 'components') | |
375 | endif | |
6e92db54 | 376 | |
d4c880d5 ZJS |
377 | have = cc.has_function( |
378 | 'crypt_activate_by_signed_key', | |
379 | dependencies : lib_cryptsetup) | |
5a6e9adf | 380 | conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false) |
d4c880d5 ZJS |
381 | |
382 | lib_cap_ng = dependency( | |
cd23a433 RP |
383 | 'libcap-ng', |
384 | required : get_option('build-setpriv')) | |
512c91a6 TW |
385 | if not lib_cap_ng.found() |
386 | lib_cap_ng = disabler() | |
387 | endif | |
d4c880d5 ZJS |
388 | |
389 | lib_selinux = dependency( | |
390 | 'libselinux', | |
6e92db54 | 391 | version : '>= 2.5', |
d4c880d5 ZJS |
392 | required : get_option('selinux')) |
393 | conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false) | |
394 | ||
6e92db54 KZ |
395 | lib_magic = dependency( |
396 | 'libmagic', | |
397 | required : get_option('magic')) | |
398 | conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false) | |
399 | ||
400 | lib_econf = dependency( | |
401 | 'libeconf', | |
402 | required : get_option('econf')) | |
403 | conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false) | |
404 | ||
d4c880d5 | 405 | lib_audit = dependency( |
b2ae39f6 | 406 | 'audit', |
d4c880d5 ZJS |
407 | required : get_option('audit')) |
408 | conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false) | |
409 | ||
410 | conf.set('HAVE_SMACK', not get_option('smack').disabled()) | |
411 | ||
412 | foreach header : headers | |
413 | have = cc.has_header(header) | |
414 | conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false) | |
415 | endforeach | |
416 | ||
417 | header = 'linux/btrfs.h' | |
418 | enable_btrfs = cc.has_header(header, | |
419 | required : get_option('btrfs')) | |
420 | conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false) | |
421 | conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false) | |
422 | ||
423 | prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : '' | |
424 | foreach header : [ | |
425 | 'linux/blkpg.h', | |
426 | 'linux/major.h', | |
427 | ] | |
428 | have = cc.has_header(header, | |
429 | prefix : prefix) | |
430 | conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false) | |
431 | endforeach | |
432 | ||
433 | have = cc.has_header('sched.h') | |
434 | conf.set10('HAVE_DECL_CPU_ALLOC', have) | |
435 | # We get -1 if the size cannot be determined | |
4194bb5b | 436 | have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0 |
d4c880d5 ZJS |
437 | conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false) |
438 | ||
5afe34ef | 439 | have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE') |
d4c880d5 ZJS |
440 | conf.set10('HAVE_ENVIRON_DECL', have) |
441 | ||
5afe34ef | 442 | have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE') |
d4c880d5 ZJS |
443 | conf.set('HAVE_SIGHANDLER_T', have ? 1 : false) |
444 | ||
f3b9a18e | 445 | have = cc.has_function('strsignal') |
d4c880d5 ZJS |
446 | conf.set10('HAVE_STRSIGNAL_DECL', have) |
447 | ||
448 | have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0 | |
449 | conf.set('HAVE_UNION_SEMUN', have ? 1 : false) | |
450 | ||
0e186591 TW |
451 | have = cc.has_type('loff_t', prefix : '#include <sys/types.h>') |
452 | conf.set('HAVE_LOFF_T', have ? 1 : false) | |
453 | ||
d4c880d5 ZJS |
454 | have = cc.compiles(''' |
455 | #define _GNU_SOURCE 1 | |
456 | #include <langinfo.h> | |
457 | int main(void) { | |
458 | char *str; | |
459 | str = nl_langinfo (ALTMON_1); | |
460 | str = nl_langinfo (ALTMON_2); | |
461 | str = nl_langinfo (ALTMON_3); | |
462 | str = nl_langinfo (ALTMON_4); | |
463 | str = nl_langinfo (ALTMON_5); | |
464 | str = nl_langinfo (ALTMON_6); | |
465 | str = nl_langinfo (ALTMON_7); | |
466 | str = nl_langinfo (ALTMON_8); | |
467 | str = nl_langinfo (ALTMON_9); | |
468 | str = nl_langinfo (ALTMON_10); | |
469 | str = nl_langinfo (ALTMON_11); | |
470 | str = nl_langinfo (ALTMON_12); | |
471 | return 0; | |
472 | } | |
473 | ''', | |
474 | name : 'langinfo.h defines ALTMON_x constants') | |
475 | conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false) | |
476 | ||
477 | have = cc.compiles(''' | |
478 | #define _GNU_SOURCE 1 | |
479 | #include <langinfo.h> | |
480 | int main(void) { | |
481 | char *str; | |
482 | str = nl_langinfo (_NL_ABALTMON_1); | |
483 | str = nl_langinfo (_NL_ABALTMON_2); | |
484 | str = nl_langinfo (_NL_ABALTMON_3); | |
485 | str = nl_langinfo (_NL_ABALTMON_4); | |
486 | str = nl_langinfo (_NL_ABALTMON_5); | |
487 | str = nl_langinfo (_NL_ABALTMON_6); | |
488 | str = nl_langinfo (_NL_ABALTMON_7); | |
489 | str = nl_langinfo (_NL_ABALTMON_8); | |
490 | str = nl_langinfo (_NL_ABALTMON_9); | |
491 | str = nl_langinfo (_NL_ABALTMON_10); | |
492 | str = nl_langinfo (_NL_ABALTMON_11); | |
493 | str = nl_langinfo (_NL_ABALTMON_12); | |
494 | return 0; | |
495 | } | |
496 | ''', | |
497 | name : 'langinfo.h defines _NL_ABALTMON_x constants') | |
498 | conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false) | |
499 | ||
17bc58e0 CH |
500 | have = cc.compiles(''' |
501 | #define _GNU_SOURCE 1 | |
502 | #include <langinfo.h> | |
503 | int main(void) { | |
504 | char *str; | |
505 | str = nl_langinfo (_NL_TIME_WEEK_1STDAY); | |
506 | return 0; | |
507 | } | |
508 | ''', | |
509 | name : 'langinfo.h defines _NL_TIME_WEEK_1STDAY constant') | |
510 | conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false) | |
511 | ||
d4c880d5 | 512 | funcs = ''' |
c214cbeb | 513 | cachestat |
d4c880d5 | 514 | clearenv |
5bd1462d | 515 | close_range |
d4c880d5 ZJS |
516 | __fpurge |
517 | fpurge | |
518 | __fpending | |
519 | secure_getenv | |
520 | __secure_getenv | |
521 | eaccess | |
522 | err | |
523 | errx | |
524 | explicit_bzero | |
d9b022bd | 525 | fnmatch |
d4c880d5 | 526 | fseeko |
0120be6f KZ |
527 | fsconfig |
528 | fsmount | |
529 | fsopen | |
530 | fspick | |
d4c880d5 | 531 | fsync |
0e186591 | 532 | getttynam |
d4c880d5 ZJS |
533 | utimensat |
534 | getdomainname | |
535 | getdtablesize | |
536 | getexecname | |
537 | getmntinfo | |
538 | getrandom | |
539 | getrlimit | |
540 | getsgnam | |
541 | inotify_init | |
542 | jrand48 | |
ae015d71 TW |
543 | landlock_create_ruleset |
544 | landlock_add_rule | |
545 | landlock_restrict_self | |
d4c880d5 | 546 | lchown |
6124a6a3 TW |
547 | lgetxattr |
548 | llistxattr | |
d4c880d5 | 549 | llseek |
5bd1462d | 550 | newlocale |
d4c880d5 ZJS |
551 | mempcpy |
552 | mkostemp | |
10efb9ea KZ |
553 | move_mount |
554 | mount_setattr | |
d4c880d5 ZJS |
555 | nanosleep |
556 | ntp_gettime | |
10efb9ea | 557 | open_tree |
d4c880d5 ZJS |
558 | personality |
559 | pidfd_open | |
560 | pidfd_send_signal | |
561 | posix_fadvise | |
562 | prctl | |
563 | qsort_r | |
0322c9cd | 564 | reallocarray |
cd094a05 | 565 | renameat2 |
d4c880d5 ZJS |
566 | rpmatch |
567 | scandirat | |
568 | setprogname | |
5bd1462d | 569 | sendfile |
d4c880d5 ZJS |
570 | setns |
571 | setresgid | |
572 | setresuid | |
573 | sched_setattr | |
574 | sched_setscheduler | |
575 | sigqueue | |
576 | srandom | |
30c59d67 | 577 | statx |
d4c880d5 ZJS |
578 | strnchr |
579 | strndup | |
580 | strnlen | |
5bd1462d | 581 | strtod_l |
d4c880d5 ZJS |
582 | sysconf |
583 | sysinfo | |
584 | swapon | |
585 | swapoff | |
586 | timegm | |
587 | unshare | |
588 | usleep | |
5bd1462d TW |
589 | uselocale |
590 | utimensat | |
d4c880d5 ZJS |
591 | vwarnx |
592 | warn | |
593 | warnx | |
594 | prlimit | |
595 | ||
596 | openat | |
597 | fstatat | |
598 | unlinkat | |
599 | ioperm | |
600 | iopl | |
601 | futimens | |
602 | inotify_init1 | |
603 | open_memstream | |
604 | reboot | |
605 | getusershell | |
606 | '''.split() | |
607 | ||
608 | foreach func: funcs | |
609 | have = cc.has_function(func) | |
993556aa | 610 | # For autotools compatibility, use either #define FOO 1 or #undef FOO. |
d4c880d5 ZJS |
611 | # This makes little sense, but is necessary to avoid warnings about |
612 | # redefined macros from Python.h, which uses this convention. | |
613 | conf.set('HAVE_' + func.to_upper(), have ? 1 : false) | |
d4c880d5 ZJS |
614 | endforeach |
615 | ||
616 | have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1] | |
617 | conf.set('AGETTY_RELOAD', have ? 1 : false) | |
618 | if not have | |
619 | warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality') | |
620 | endif | |
621 | ||
622 | have_dirfd = (cc.has_function('dirfd') or | |
623 | cc.has_header_symbol('dirent.h', 'dirfd', | |
624 | prefix : '#include <sys/types.h>')) | |
625 | conf.set('HAVE_DIRFD', have_dirfd ? 1 : false) | |
626 | ||
627 | have_ddfd = cc.has_member('DIR', 'dd_fd', | |
628 | prefix : ''' | |
629 | #include <sys/types.h> | |
630 | #include <dirent.h> | |
631 | ''') | |
632 | conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false) | |
633 | ||
634 | have = cc.has_member('struct tm', 'tm_gmtoff', | |
635 | prefix : ''' | |
636 | #include <time.h> | |
637 | #include <unistd.h> | |
638 | ''') | |
639 | conf.set('HAVE_TM_GMTOFF', have ? 1 : false) | |
640 | ||
10efb9ea | 641 | |
10efb9ea | 642 | |
0120be6f | 643 | have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0 |
e23c3262 | 644 | conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false) |
0120be6f | 645 | |
d4c880d5 ZJS |
646 | have = cc.has_member('struct termios', 'c_line', |
647 | prefix : '#include <termios.h>') | |
648 | conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false) | |
649 | ||
650 | have = cc.has_member('struct stat', 'st_mtim.tv_nsec', | |
651 | prefix : '#include <sys/stat.h>') | |
652 | conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false) | |
653 | ||
2f82c248 | 654 | have = cc.has_member('struct statx', 'stx_mnt_id', |
7d679f29 | 655 | prefix : '#include <sys/stat.h>') |
2f82c248 KZ |
656 | conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false) |
657 | ||
d4c880d5 ZJS |
658 | # replacement for AC_STRUCT_TIMEZONE |
659 | have = cc.has_member('struct tm', 'tm_zone', | |
660 | prefix : '#include <time.h>') | |
661 | conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false) | |
662 | ||
5afe34ef | 663 | have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE') |
d4c880d5 ZJS |
664 | conf.set('HAVE_DECL_TZNAME', have ? 1 : false) |
665 | ||
0e186591 TW |
666 | have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY') |
667 | conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false) | |
668 | ||
669 | have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY') | |
670 | conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false) | |
671 | ||
d4c880d5 ZJS |
672 | code = ''' |
673 | #include <time.h> | |
674 | #if !@0@ | |
675 | extern char *tzname[]; | |
676 | #endif | |
677 | int main(void) { | |
678 | return tzname ? 0 : 1; | |
679 | } | |
680 | '''.format(have ? 1 : 0) | |
e25db916 | 681 | have = cc.compiles(code, name : 'using tzname[]') |
d4c880d5 ZJS |
682 | conf.set('HAVE_TZNAME', have ? 1 : false) |
683 | ||
a31f4c4f TW |
684 | have = cc.sizeof('time_t', prefix : '#include <time.h>') |
685 | if have < 8 | |
686 | add_global_arguments('-D_TIME_BITS=64', language : 'c') | |
687 | have = cc.sizeof('time_t', args : '-D_TIME_BITS=64', prefix : '#include <time.h>') | |
688 | if have < 8 | |
689 | if get_option('allow-32bit-time') | |
690 | warning('Could not make time_t 64bits wide') | |
691 | else | |
692 | error('Could not make time_t 64bits wide') | |
693 | endif | |
694 | endif | |
695 | endif | |
696 | ||
d4c880d5 ZJS |
697 | socket_libs = [] |
698 | if not cc.has_function('socket') | |
699 | socket_libs += cc.find_library('socket', required : true) | |
700 | have = cc.has_function('socket', | |
701 | dependencies : socket_libs) | |
702 | if not have | |
703 | error('socket() function not available') | |
704 | endif | |
705 | endif | |
706 | ||
707 | realtime_libs = [] | |
708 | have = cc.has_function('clock_gettime') | |
709 | if not have | |
710 | realtime_libs += cc.find_library('rt', required : true) | |
711 | have = cc.has_function('clock_gettime', | |
712 | dependencies : realtime_libs) | |
713 | endif | |
e51565b6 | 714 | conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false) |
d4c880d5 ZJS |
715 | |
716 | thread_libs = dependency('threads') | |
717 | ||
718 | have = cc.has_function('timer_create') | |
719 | if not have | |
c41e47c1 | 720 | realtime_libs = [cc.find_library('rt', required : true)] |
d4c880d5 ZJS |
721 | have = cc.has_function('timer_create', |
722 | dependencies : realtime_libs) | |
723 | if not have | |
724 | realtime_libs += thread_libs | |
725 | have = cc.has_function('timer_create', | |
726 | dependencies : realtime_libs) | |
727 | endif | |
728 | endif | |
729 | conf.set('HAVE_TIMER_CREATE', have ? 1 : false) | |
730 | if not have | |
731 | have = cc.has_function('setitimer') | |
732 | conf.set('HAVE_SETITIMER', have ? 1 : false) | |
733 | endif | |
734 | ||
735 | rtas_libs = cc.find_library('rtas', required : false) | |
736 | conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false) | |
737 | ||
738 | math_libs = [] | |
77765258 | 739 | if not cc.has_header_symbol('math.h', 'isnan') |
d4c880d5 ZJS |
740 | lib = cc.find_library('m', required : true) |
741 | if (cc.has_function('isnan', dependencies : lib) and | |
742 | cc.has_function('__isnan', dependencies : lib)) | |
743 | math_libs += lib | |
744 | endif | |
745 | endif | |
746 | ||
747 | have = cc.has_header_symbol('errno.h', 'program_invocation_short_name', | |
748 | args : '-D_GNU_SOURCE') | |
749 | conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false) | |
750 | ||
751 | code = ''' | |
752 | extern char *__progname; | |
753 | int main(void) { | |
754 | return (*__progname != 0); | |
755 | } | |
756 | ''' | |
e25db916 | 757 | have = cc.compiles(code, name : 'using __progname') |
d4c880d5 ZJS |
758 | conf.set('HAVE___PROGNAME', have ? 1 : false) |
759 | ||
941e1d55 TW |
760 | have = conf.get('HAVE_PTY_H').to_string() == '1' \ |
761 | and conf.get('HAVE_SYS_SIGNALFD_H').to_string() == '1' | |
44475360 ZJS |
762 | conf.set('HAVE_PTY', have ? 1 : false) |
763 | ||
a0cf9105 LB |
764 | have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS') |
765 | conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false) | |
766 | ||
d4c880d5 ZJS |
767 | build_plymouth_support = get_option('build-plymouth-support') |
768 | have_tiocglcktrmios = cc.has_header_symbol( | |
769 | 'sys/ioctl.h', 'TIOCGLCKTRMIOS', | |
770 | required : build_plymouth_support.enabled()) | |
771 | have_sock_cloexec = cc.has_header_symbol( | |
772 | 'sys/socket.h', 'SOCK_CLOEXEC', | |
773 | prefix : '#include <sys/types.h>', | |
774 | required : build_plymouth_support.enabled()) | |
775 | have_sock_nonblock = cc.has_header_symbol( | |
776 | 'sys/socket.h', 'SOCK_NONBLOCK', | |
777 | prefix : '#include <sys/types.h>', | |
778 | required : build_plymouth_support.enabled()) | |
779 | have_so_passcred = cc.has_header_symbol( | |
780 | 'sys/socket.h', 'SO_PASSCRED', | |
781 | prefix : '#include <sys/types.h>', | |
782 | required : build_plymouth_support.enabled()) | |
783 | ||
784 | build_plymouth_support = (not build_plymouth_support.disabled() and | |
785 | have_tiocglcktrmios and | |
786 | have_sock_cloexec and | |
787 | have_sock_nonblock and | |
788 | have_so_passcred) | |
789 | conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false) | |
790 | summary('plymouth support', | |
791 | build_plymouth_support ? 'enabled' : 'disabled', | |
792 | section : 'components') | |
793 | ||
794 | # check for valid fallocate() function | |
795 | # with 32 bits glibc 2.10, fallocate() exists but not fallocate64() | |
796 | # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64() | |
797 | # and program can't be linked. | |
798 | code = ''' | |
799 | #define _GNU_SOURCE | |
800 | #include <unistd.h> | |
801 | #include <fcntl.h> | |
802 | ||
803 | int main(void) { | |
804 | long ret; | |
805 | ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful); | |
806 | return ret == 0 ? 0 : 1; | |
807 | } | |
808 | ''' | |
809 | have = cc.links(code, name : 'fallocate() function') | |
810 | conf.set('HAVE_FALLOCATE', have ? 1 : false) | |
811 | ||
812 | code = ''' | |
813 | #include <unistd.h> | |
814 | #include <fcntl.h> | |
815 | ||
816 | int main(void) { | |
817 | long ret; | |
818 | ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); | |
819 | return ret == 0 ? 0 : 1; | |
820 | } | |
821 | ''' | |
822 | have = cc.links(code, name : 'posix_fallocate() function') | |
823 | conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false) | |
824 | ||
825 | use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64'] | |
826 | message('Use CMOS clock: @0@'.format(use_hwclock_cmos)) | |
827 | conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false) | |
828 | ||
829 | conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false) | |
830 | conf.set('PG_BELL', get_option('pg-bell') ? 1 : false) | |
e0806c40 | 831 | conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false) |
d4c880d5 | 832 | |
8886d84e TW |
833 | is_glibc = cc.has_header_symbol('limits.h', '__GLIBC__') |
834 | ||
d4c880d5 ZJS |
835 | ############################################################ |
836 | ||
6e92db54 | 837 | |
d4c880d5 ZJS |
838 | fs_search_path = get_option('fs-search-path') |
839 | fs_search_path_extra = get_option('fs-search-path-extra') | |
840 | if fs_search_path_extra != '' | |
841 | fs_search_path = ':'.join(fs_search_path, fs_search_path_extra) | |
842 | endif | |
843 | conf.set_quoted('FS_SEARCH_PATH', fs_search_path) | |
844 | ||
38b15ca2 | 845 | systemdsystemunitdir = '' |
fcbcb0cd | 846 | if systemd.found() |
e2b4f5be | 847 | systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir') |
fcbcb0cd | 848 | endif |
6e92db54 | 849 | |
5e67b421 CH |
850 | sysvinit = get_option('sysvinit').enabled() |
851 | sysvinitrcdir = sysconfdir + '/init.d' | |
852 | ||
ba30b89c | 853 | program_tests = get_option('program-tests') |
854 | ||
d4c880d5 ZJS |
855 | chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found() |
856 | conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false) | |
857 | ||
858 | have = get_option('chsh-only-listed') | |
859 | conf.set('ONLY_LISTED_SHELLS', have ? 1 : false) | |
860 | ||
861 | have = get_option('use-tty-group') | |
862 | conf.set('USE_TTY_GROUP', have ? 1 : false) | |
863 | ||
a4eeda56 KZ |
864 | bison = find_program('bison') |
865 | flex = find_program('flex') | |
866 | ||
d4c880d5 | 867 | build_hwclock = not get_option('build-hwclock').disabled() |
d4c880d5 ZJS |
868 | bison_gen = generator( |
869 | bison, | |
870 | output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], | |
871 | arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) | |
872 | ||
873 | meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh' | |
38bb89ee | 874 | meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh' |
d4c880d5 | 875 | |
7da59534 | 876 | configure_file( |
d4c880d5 ZJS |
877 | output : 'config.h', |
878 | configuration : conf) | |
879 | ||
5f2c862a | 880 | add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c') |
d4c880d5 | 881 | |
24b8804b TW |
882 | compiler_flags = [ |
883 | '-fno-common', | |
884 | ||
885 | '-Waddress-of-packed-member', | |
886 | '-Wdiscarded-qualifiers', | |
887 | '-Wembedded-directive', | |
888 | '-Wextra-semi', | |
889 | '-Wformat-security', | |
890 | '-Wimplicit-function-declaration', | |
891 | '-Wmissing-declarations', | |
892 | '-Wmissing-parameter-type', | |
893 | '-Wmissing-prototypes', | |
894 | '-Wnested-externs', | |
895 | '-Wno-missing-field-initializers', | |
9df5ac34 | 896 | '-Wold-style-definition', |
24b8804b TW |
897 | '-Wpointer-arith', |
898 | '-Wredundant-decls', | |
899 | '-Wsign-compare', | |
900 | '-Wstrict-prototypes', | |
901 | '-Wtype-limits', | |
902 | '-Wuninitialized', | |
903 | '-Wunused-but-set-parameter', | |
904 | '-Wunused-but-set-variable', | |
905 | '-Wunused-parameter', | |
906 | '-Wunused-result', | |
907 | '-Wunused-variable', | |
a52f9bdd | 908 | '-Wvla', |
2a91b213 | 909 | '-Walloca', |
24b8804b TW |
910 | ] |
911 | foreach compiler_flag : compiler_flags | |
912 | if cc.has_argument(compiler_flag) | |
913 | add_project_arguments(compiler_flag, language : 'c') | |
914 | endif | |
915 | endforeach | |
916 | ||
53b37016 | 917 | manadocs = [] |
38bb89ee | 918 | manlinks = {} |
aa519054 | 919 | |
38bb89ee | 920 | bashcompletions = [] |
aa519054 | 921 | bashcompletionslinks = {} |
53b37016 | 922 | |
d4c880d5 ZJS |
923 | subdir('include') |
924 | subdir('lib') | |
925 | subdir('libblkid') | |
926 | subdir('libmount') | |
927 | subdir('libsmartcols') | |
928 | subdir('libuuid') | |
929 | subdir('libfdisk') | |
930 | subdir('login-utils') | |
931 | subdir('sys-utils') | |
932 | subdir('disk-utils') | |
933 | subdir('misc-utils') | |
934 | subdir('text-utils') | |
935 | subdir('term-utils') | |
936 | subdir('po') | |
937 | ||
938 | includes = [dir_include, | |
939 | dir_libblkid, | |
940 | dir_libsmartcols, | |
941 | dir_libmount, | |
942 | dir_libfdisk, | |
943 | dir_libuuid, | |
944 | dir_sys_utils] | |
945 | ||
946 | exes = [] | |
947 | ||
948 | opt = not get_option('build-chfn-chsh').disabled() | |
949 | exe = executable( | |
950 | 'chfn', | |
951 | chfn_sources, | |
952 | chfn_chsh_sources, | |
953 | include_directories : includes, | |
0333c40b | 954 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
955 | dependencies : chfn_chsh_deps, |
956 | install_dir : usrbin_exec_dir, | |
60d457f5 | 957 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
958 | install : opt, |
959 | build_by_default : opt) | |
38bb89ee | 960 | |
d4c880d5 ZJS |
961 | exe2 = executable( |
962 | 'chsh', | |
963 | 'login-utils/chsh.c', | |
4b724469 | 964 | 'lib/shells.c', |
d4c880d5 ZJS |
965 | chfn_chsh_sources, |
966 | include_directories : includes, | |
967 | link_with : lib_common, | |
968 | dependencies : chfn_chsh_deps, | |
969 | install_dir : usrbin_exec_dir, | |
a13574b1 | 970 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
971 | install : opt, |
972 | build_by_default : opt) | |
973 | if opt and not is_disabler(exe) | |
974 | exes += [exe, exe2] | |
38bb89ee TW |
975 | manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc'] |
976 | bashcompletions += ['chfn', 'chsh'] | |
d4c880d5 ZJS |
977 | endif |
978 | ||
979 | exe = executable( | |
980 | 'test_islocal', | |
981 | test_islocal_sources, | |
982 | include_directories : includes, | |
ba30b89c | 983 | c_args : '-DTEST_PROGRAM', |
984 | build_by_default : program_tests) | |
d4c880d5 ZJS |
985 | exes += exe |
986 | ||
d4c880d5 ZJS |
987 | exe = executable( |
988 | 'test-consoles', | |
989 | test_consoles_sources, | |
990 | c_args : ['-DTEST_PROGRAM'], | |
991 | include_directories : includes, | |
ba30b89c | 992 | link_with : lib_common, |
993 | build_by_default : program_tests) | |
d4c880d5 ZJS |
994 | exes += exe |
995 | ||
996 | opt = not get_option('build-last').disabled() | |
997 | exe = executable( | |
998 | 'last', | |
999 | last_sources, | |
1000 | include_directories : includes, | |
1001 | link_with : [lib_common], | |
1002 | install_dir : usrbin_exec_dir, | |
1003 | install : opt, | |
1004 | build_by_default : opt) | |
1005 | if opt and not is_disabler(exe) | |
1006 | exes += exe | |
1007 | meson.add_install_script(meson_make_symlink, | |
1008 | 'last', | |
1009 | join_paths(usrbin_exec_dir, 'lastb')) | |
38bb89ee TW |
1010 | manadocs += ['login-utils/last.1.adoc'] |
1011 | manlinks += {'lastb.1': 'last.1'} | |
1012 | bashcompletions += ['last'] | |
aa519054 | 1013 | bashcompletionslinks += {'lastb': 'last'} |
d4c880d5 ZJS |
1014 | endif |
1015 | ||
1016 | opt = not get_option('build-nologin').disabled() | |
1017 | exe = executable( | |
1018 | 'nologin', | |
1019 | 'login-utils/nologin.c', | |
1020 | include_directories : includes, | |
1021 | install_dir : sbindir, | |
308a0979 | 1022 | link_with : [lib_common], |
d4c880d5 ZJS |
1023 | install : opt, |
1024 | build_by_default : opt) | |
1025 | if opt and not is_disabler(exe) | |
1026 | exes += exe | |
38bb89ee | 1027 | manadocs += ['login-utils/nologin.8.adoc'] |
d4c880d5 ZJS |
1028 | endif |
1029 | ||
1030 | opt = not get_option('build-utmpdump').disabled() | |
1031 | exe = executable( | |
1032 | 'utmpdump', | |
1033 | 'login-utils/utmpdump.c', | |
1034 | include_directories : includes, | |
1035 | link_with : [lib_common], | |
1036 | install_dir : usrbin_exec_dir, | |
1037 | install : opt, | |
1038 | build_by_default : opt) | |
1039 | if opt and not is_disabler(exe) | |
1040 | exes += exe | |
38bb89ee TW |
1041 | manadocs += ['login-utils/utmpdump.1.adoc'] |
1042 | bashcompletions += ['utmpdump'] | |
d4c880d5 ZJS |
1043 | endif |
1044 | ||
1045 | opt = not get_option('build-su').disabled() | |
1046 | exe = executable( | |
1047 | 'su', | |
1048 | 'login-utils/su.c', | |
1049 | 'login-utils/su-common.c', | |
1050 | 'login-utils/su-common.h', | |
4b724469 | 1051 | 'lib/shells.c', |
d4c880d5 ZJS |
1052 | pty_session_c, |
1053 | monotonic_c, | |
1054 | include_directories : includes, | |
0333c40b | 1055 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
1056 | dependencies : [lib_pam, |
1057 | lib_pam_misc, | |
1058 | lib_util, | |
1059 | realtime_libs], | |
fb8c224e | 1060 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1061 | install : opt, |
1062 | build_by_default : opt) | |
1063 | if opt and not is_disabler(exe) | |
1064 | exes += exe | |
38bb89ee TW |
1065 | manadocs += ['login-utils/su.1.adoc'] |
1066 | bashcompletions += ['su'] | |
d4c880d5 ZJS |
1067 | endif |
1068 | ||
1069 | opt = not get_option('build-newgrp').disabled() | |
1070 | exe = executable( | |
1071 | 'newgrp', | |
1072 | 'login-utils/newgrp.c', | |
1073 | include_directories : includes, | |
1074 | dependencies : [lib_crypt], | |
1075 | install_dir : usrbin_exec_dir, | |
cb3dee5a | 1076 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1077 | install : opt, |
1078 | build_by_default : opt) | |
1079 | if opt and not is_disabler(exe) | |
1080 | exes += exe | |
38bb89ee | 1081 | manadocs += ['login-utils/newgrp.1.adoc'] |
f265b432 | 1082 | bashcompletions += ['newgrp'] |
d4c880d5 ZJS |
1083 | endif |
1084 | ||
1085 | opt = not get_option('build-lslogins').disabled() | |
1086 | exe = executable( | |
1087 | 'lslogins', | |
1088 | 'login-utils/lslogins.c', | |
d4c880d5 ZJS |
1089 | include_directories : includes, |
1090 | link_with : [lib_common, | |
0333c40b TW |
1091 | lib_smartcols, |
1092 | logindefs_c], | |
d4c880d5 ZJS |
1093 | dependencies : [lib_selinux, |
1094 | lib_systemd], | |
1095 | install_dir : usrbin_exec_dir, | |
1096 | install : opt, | |
1097 | build_by_default : opt) | |
1098 | if opt and not is_disabler(exe) | |
1099 | exes += exe | |
38bb89ee TW |
1100 | manadocs += ['login-utils/lslogins.1.adoc'] |
1101 | bashcompletions += ['lslogins'] | |
d4c880d5 ZJS |
1102 | endif |
1103 | ||
1104 | opt = not get_option('build-vipw').disabled() | |
1105 | exe = executable( | |
1106 | 'vipw', | |
1107 | 'login-utils/vipw.c', | |
1108 | 'login-utils/setpwnam.h', | |
1109 | include_directories : includes, | |
1110 | link_with : [lib_common], | |
1111 | dependencies : [lib_selinux], | |
1112 | install_dir : usrbin_exec_dir, | |
1113 | install : opt, | |
1114 | build_by_default : opt) | |
1115 | if opt and not is_disabler(exe) | |
1116 | exes += exe | |
1117 | meson.add_install_script(meson_make_symlink, | |
1118 | 'vipw', | |
1119 | join_paths(usrbin_exec_dir, 'vigr')) | |
38bb89ee | 1120 | manadocs += ['login-utils/vipw.8.adoc'] |
f6fb7fa7 CH |
1121 | meson.add_install_script(meson_make_symlink, |
1122 | 'vipw.8', | |
1123 | join_paths(mandir, 'man8/vigr.8')) | |
d4c880d5 ZJS |
1124 | endif |
1125 | ||
1126 | opt = not get_option('build-runuser').disabled() | |
1127 | exe = executable( | |
1128 | 'runuser', | |
1129 | 'login-utils/runuser.c', | |
1130 | 'login-utils/su-common.c', | |
1131 | 'login-utils/su-common.h', | |
4b724469 | 1132 | 'lib/shells.c', |
d4c880d5 ZJS |
1133 | pty_session_c, |
1134 | monotonic_c, | |
1135 | include_directories : includes, | |
0333c40b | 1136 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
1137 | dependencies : [lib_pam, |
1138 | lib_pam_misc, | |
1139 | lib_util, | |
1140 | realtime_libs], | |
1141 | install_dir : sbindir, | |
1142 | install : opt, | |
1143 | build_by_default : opt) | |
1144 | if opt and not is_disabler(exe) | |
1145 | exes += exe | |
38bb89ee | 1146 | manadocs += ['login-utils/runuser.1.adoc'] |
aa519054 | 1147 | bashcompletionslinks += {'runuser': 'su'} |
d4c880d5 ZJS |
1148 | endif |
1149 | ||
1150 | ############################################################ | |
1151 | ||
8886d84e TW |
1152 | if is_glibc |
1153 | exe = executable( | |
1154 | 'col', | |
1155 | col_sources, | |
1156 | include_directories : includes, | |
1157 | link_with : lib_common, | |
1158 | install_dir : usrbin_exec_dir, | |
1159 | install : true) | |
1160 | exes += exe | |
1161 | manadocs += ['text-utils/col.1.adoc'] | |
1162 | bashcompletions += ['col'] | |
1163 | endif | |
d4c880d5 ZJS |
1164 | |
1165 | exe = executable( | |
1166 | 'colcrt', | |
1167 | colcrt_sources, | |
1168 | include_directories : includes, | |
1169 | install_dir : usrbin_exec_dir, | |
1170 | install : true) | |
1171 | exes += exe | |
38bb89ee TW |
1172 | manadocs += ['text-utils/colcrt.1.adoc'] |
1173 | bashcompletions += ['colcrt'] | |
d4c880d5 ZJS |
1174 | |
1175 | exe = executable( | |
1176 | 'colrm', | |
1177 | colrm_sources, | |
1178 | include_directories : includes, | |
1179 | link_with : lib_common, | |
1180 | install_dir : usrbin_exec_dir, | |
1181 | install : true) | |
1182 | exes += exe | |
38bb89ee TW |
1183 | manadocs += ['text-utils/colrm.1.adoc'] |
1184 | bashcompletions += ['colrm'] | |
d4c880d5 ZJS |
1185 | |
1186 | exe = executable( | |
1187 | 'rev', | |
1188 | rev_sources, | |
1189 | include_directories : includes, | |
1190 | install_dir : usrbin_exec_dir, | |
1191 | install : true) | |
1192 | exes += exe | |
38bb89ee TW |
1193 | manadocs += ['text-utils/rev.1.adoc'] |
1194 | bashcompletions += ['rev'] | |
d4c880d5 ZJS |
1195 | |
1196 | exe = executable( | |
1197 | 'column', | |
1198 | column_sources, | |
1199 | include_directories : includes, | |
1200 | link_with : [lib_common, | |
1201 | lib_smartcols], | |
1202 | install_dir : usrbin_exec_dir, | |
1203 | install : true) | |
1204 | if not is_disabler(exe) | |
1205 | exes += exe | |
38bb89ee TW |
1206 | manadocs += ['text-utils/column.1.adoc'] |
1207 | bashcompletions += ['column'] | |
d4c880d5 ZJS |
1208 | endif |
1209 | ||
1210 | opt = not get_option('build-line').disabled() | |
1211 | exe = executable( | |
1212 | 'line', | |
1213 | line_sources, | |
1214 | include_directories : includes, | |
1215 | install_dir : usrbin_exec_dir, | |
1216 | install : opt, | |
1217 | build_by_default : opt) | |
1218 | if opt and not is_disabler(exe) | |
1219 | exes += exe | |
38bb89ee | 1220 | manadocs += ['text-utils/line.1.adoc'] |
d4c880d5 ZJS |
1221 | endif |
1222 | ||
1223 | opt = not get_option('build-pg').disabled() | |
1224 | exe = executable( | |
1225 | 'pg', | |
1226 | pg_sources, | |
1227 | link_with : lib_common, | |
1228 | include_directories : includes, | |
1229 | dependencies : [lib_tinfo, | |
1230 | curses_libs], | |
1231 | install_dir : usrbin_exec_dir, | |
1232 | install : opt, | |
1233 | build_by_default : opt) | |
1234 | if opt and not is_disabler(exe) | |
1235 | exes += exe | |
38bb89ee TW |
1236 | manadocs += ['text-utils/pg.1.adoc'] |
1237 | bashcompletions += ['pg'] | |
d4c880d5 ZJS |
1238 | endif |
1239 | ||
1240 | opt = not get_option('build-ul').disabled() | |
1241 | exe = executable( | |
1242 | 'ul', | |
1243 | ul_sources, | |
1244 | include_directories : includes, | |
1245 | dependencies : [lib_tinfo, | |
1246 | curses_libs], | |
1247 | install_dir : usrbin_exec_dir, | |
1248 | install : opt, | |
1249 | build_by_default : opt) | |
1250 | if opt and not is_disabler(exe) | |
1251 | exes += exe | |
38bb89ee TW |
1252 | manadocs += ['text-utils/ul.1.adoc'] |
1253 | bashcompletions += ['ul'] | |
d4c880d5 ZJS |
1254 | endif |
1255 | ||
1256 | opt = not get_option('build-more').disabled() | |
1257 | exe = executable( | |
1258 | 'more', | |
1259 | more_sources, | |
308a0979 | 1260 | link_with : [lib_common], |
d4c880d5 ZJS |
1261 | include_directories : includes, |
1262 | dependencies : [lib_tinfo, | |
6e92db54 KZ |
1263 | curses_libs, |
1264 | lib_magic], | |
d4c880d5 ZJS |
1265 | install : opt, |
1266 | build_by_default : opt) | |
1267 | exe2 = executable( | |
1268 | 'test_more', | |
1269 | more_sources, | |
308a0979 | 1270 | link_with : [lib_common], |
d4c880d5 ZJS |
1271 | include_directories : includes, |
1272 | c_args : '-DTEST_PROGRAM', | |
1273 | dependencies : [lib_tinfo, | |
6e92db54 KZ |
1274 | curses_libs, |
1275 | lib_magic], | |
ba30b89c | 1276 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
1277 | exes += exe |
1278 | if opt and not is_disabler(exe) | |
1279 | exes += [exe, exe2] | |
38bb89ee TW |
1280 | manadocs += ['text-utils/more.1.adoc'] |
1281 | bashcompletions += ['more'] | |
d4c880d5 ZJS |
1282 | endif |
1283 | ||
1284 | exe = executable( | |
1285 | 'hexdump', | |
1286 | hexdump_sources, | |
1287 | include_directories : includes, | |
1288 | link_with : [lib_common, | |
1289 | lib_tcolors], | |
1290 | install_dir : usrbin_exec_dir, | |
1291 | install : true) | |
1292 | if not is_disabler(exe) | |
1293 | exes += exe | |
53b37016 | 1294 | manadocs += ['text-utils/hexdump.1.adoc'] |
38bb89ee | 1295 | bashcompletions += ['hexdump'] |
d4c880d5 ZJS |
1296 | endif |
1297 | ||
1298 | opt = not get_option('build-lsmem').disabled() | |
1299 | exe = executable( | |
1300 | 'lsmem', | |
1301 | lsmem_sources, | |
1302 | include_directories : includes, | |
1303 | link_with : [lib_common, | |
1304 | lib_smartcols], | |
1305 | install_dir : usrbin_exec_dir, | |
1306 | install : opt, | |
1307 | build_by_default : opt) | |
1308 | if opt and not is_disabler(exe) | |
1309 | exes += exe | |
53b37016 | 1310 | manadocs += ['sys-utils/lsmem.1.adoc'] |
38bb89ee | 1311 | bashcompletions += ['lsmem'] |
d4c880d5 ZJS |
1312 | endif |
1313 | ||
1314 | opt = not get_option('build-chmem').disabled() | |
1315 | exe = executable( | |
1316 | 'chmem', | |
1317 | chmem_sources, | |
1318 | include_directories : includes, | |
1319 | link_with : [lib_common], | |
1320 | install_dir : usrbin_exec_dir, | |
1321 | install : opt, | |
1322 | build_by_default : opt) | |
1323 | if opt and not is_disabler(exe) | |
1324 | exes += exe | |
53b37016 | 1325 | manadocs += ['sys-utils/chmem.8.adoc'] |
38bb89ee | 1326 | bashcompletions += ['chmem'] |
d4c880d5 ZJS |
1327 | endif |
1328 | ||
1329 | exe = executable( | |
1330 | 'choom', | |
1331 | choom_sources, | |
1332 | include_directories : includes, | |
1333 | link_with : [lib_common], | |
1334 | install_dir : usrbin_exec_dir, | |
1335 | install : true) | |
1336 | exes += exe | |
53b37016 | 1337 | manadocs += ['sys-utils/choom.1.adoc'] |
d4c880d5 ZJS |
1338 | |
1339 | exe = executable( | |
1340 | 'ipcmk', | |
1341 | ipcmk_sources, | |
1342 | include_directories : includes, | |
1343 | link_with : [lib_common], | |
1344 | install_dir : usrbin_exec_dir, | |
1345 | install : true) | |
1346 | exes += exe | |
53b37016 | 1347 | manadocs += ['sys-utils/ipcmk.1.adoc'] |
38bb89ee | 1348 | bashcompletions += ['ipcmk'] |
d4c880d5 ZJS |
1349 | |
1350 | exe = executable( | |
1351 | 'ipcrm', | |
1352 | ipcrm_sources, | |
1353 | include_directories : includes, | |
1354 | link_with : [lib_common], | |
1355 | install_dir : usrbin_exec_dir, | |
1356 | install : true) | |
1357 | exes += exe | |
53b37016 | 1358 | manadocs += ['sys-utils/ipcrm.1.adoc'] |
38bb89ee | 1359 | bashcompletions += ['ipcrm'] |
d4c880d5 ZJS |
1360 | |
1361 | opt = not get_option('build-ipcs').disabled() | |
1362 | exe = executable( | |
1363 | 'ipcs', | |
1364 | ipcs_sources, | |
1365 | include_directories : includes, | |
1366 | link_with : [lib_common], | |
1367 | install_dir : usrbin_exec_dir, | |
1368 | install : opt, | |
1369 | build_by_default : opt) | |
1370 | if opt and not is_disabler(exe) | |
1371 | exes += exe | |
53b37016 | 1372 | manadocs += ['sys-utils/ipcs.1.adoc'] |
38bb89ee | 1373 | bashcompletions += ['ipcs'] |
d4c880d5 ZJS |
1374 | endif |
1375 | ||
1376 | opt = not get_option('build-rfkill').disabled() | |
1377 | exe = executable( | |
1378 | 'rfkill', | |
1379 | rfkill_sources, | |
1380 | include_directories : includes, | |
1381 | link_with : [lib_common, | |
1382 | lib_smartcols], | |
1383 | install_dir : usrsbin_exec_dir, | |
1384 | install : opt, | |
1385 | build_by_default : opt) | |
1386 | if opt and not is_disabler(exe) | |
1387 | exes += exe | |
53b37016 | 1388 | manadocs += ['sys-utils/rfkill.8.adoc'] |
38bb89ee | 1389 | bashcompletions += ['rfkill'] |
d4c880d5 ZJS |
1390 | endif |
1391 | ||
1392 | exe = executable( | |
1393 | 'renice', | |
1394 | renice_sources, | |
1395 | include_directories : includes, | |
1396 | link_with : [lib_common, | |
1397 | lib_smartcols], | |
1398 | install_dir : usrbin_exec_dir, | |
1399 | install : true) | |
1400 | if not is_disabler(exe) | |
1401 | exes += exe | |
53b37016 | 1402 | manadocs += ['sys-utils/renice.1.adoc'] |
38bb89ee | 1403 | bashcompletions += ['renice'] |
d4c880d5 ZJS |
1404 | endif |
1405 | ||
f092076f DDM |
1406 | exe = executable( |
1407 | 'setpgid', | |
1408 | setpgid_sources, | |
1409 | include_directories: includes, | |
1410 | link_with : [lib_common, | |
1411 | lib_smartcols], | |
1412 | install_dir : usrbin_exec_dir, | |
1413 | install : true) | |
1414 | if opt and not is_disabler(exe) | |
1415 | exes += exe | |
1416 | manadocs += ['sys-utils/setpgid.1.adoc'] | |
1417 | bashcompletions += ['setpgid'] | |
1418 | endif | |
1419 | ||
d4c880d5 ZJS |
1420 | exe = executable( |
1421 | 'setsid', | |
1422 | setsid_sources, | |
1423 | include_directories : includes, | |
1424 | link_with : [lib_common, | |
1425 | lib_smartcols], | |
1426 | install_dir : usrbin_exec_dir, | |
1427 | install : true) | |
1428 | if opt and not is_disabler(exe) | |
1429 | exes += exe | |
53b37016 | 1430 | manadocs += ['sys-utils/setsid.1.adoc'] |
38bb89ee | 1431 | bashcompletions += ['setsid'] |
d4c880d5 ZJS |
1432 | endif |
1433 | ||
1434 | exe = executable( | |
1435 | 'readprofile', | |
1436 | readprofile_sources, | |
1437 | include_directories : includes, | |
1438 | link_with : [lib_common, | |
1439 | lib_smartcols], | |
1440 | install_dir : usrsbin_exec_dir, | |
1441 | install : true) | |
1442 | if not is_disabler(exe) | |
1443 | exes += exe | |
53b37016 | 1444 | manadocs += ['sys-utils/readprofile.8.adoc'] |
38bb89ee | 1445 | bashcompletions += ['readprofile'] |
d4c880d5 ZJS |
1446 | endif |
1447 | ||
1448 | opt = not get_option('build-tunelp').disabled() | |
1449 | exe = executable( | |
1450 | 'tunelp', | |
1451 | tunelp_sources, | |
1452 | include_directories : includes, | |
1453 | link_with : [lib_common], | |
1454 | install_dir : usrsbin_exec_dir, | |
1455 | install : opt, | |
1456 | build_by_default : opt) | |
1457 | if opt and not is_disabler(exe) | |
1458 | exes += exe | |
53b37016 | 1459 | manadocs += ['sys-utils/tunelp.8.adoc'] |
38bb89ee | 1460 | bashcompletions += ['tunelp'] |
d4c880d5 ZJS |
1461 | endif |
1462 | ||
1463 | exe = executable( | |
1464 | 'fstrim', | |
1465 | fstrim_sources, | |
1466 | include_directories : includes, | |
1467 | link_with : [lib_common, | |
1468 | lib_mount], | |
1469 | install_dir : sbindir, | |
1470 | install : true) | |
1471 | if not is_disabler(exe) | |
1472 | exes += exe | |
53b37016 | 1473 | manadocs += ['sys-utils/fstrim.8.adoc'] |
38bb89ee | 1474 | bashcompletions += ['fstrim'] |
d4c880d5 ZJS |
1475 | endif |
1476 | ||
1477 | exe = executable( | |
1478 | 'dmesg', | |
1479 | dmesg_sources, | |
1480 | include_directories : includes, | |
1481 | link_with : [lib_common, | |
1482 | lib_tcolors], | |
1483 | install : true) | |
1484 | if not is_disabler(exe) | |
1485 | exes += exe | |
53b37016 | 1486 | manadocs += ['sys-utils/dmesg.1.adoc'] |
38bb89ee | 1487 | bashcompletions += ['dmesg'] |
d4c880d5 ZJS |
1488 | endif |
1489 | ||
1490 | exe = executable( | |
1491 | 'test_dmesg', | |
1492 | dmesg_sources, | |
1493 | include_directories : dir_include, | |
1494 | c_args : '-DTEST_DMESG', | |
1495 | link_with : [lib_common, | |
ba30b89c | 1496 | lib_tcolors], |
1497 | build_by_default : program_tests) | |
d4c880d5 ZJS |
1498 | if not is_disabler(exe) |
1499 | exes += exe | |
1500 | endif | |
1501 | ||
1502 | exe = executable( | |
1503 | 'ctrlaltdel', | |
1504 | ctrlaltdel_sources, | |
1505 | include_directories : includes, | |
1506 | link_with : [lib_common], | |
1507 | install_dir : sbindir, | |
1508 | install : true) | |
1509 | exes += exe | |
53b37016 | 1510 | manadocs += ['sys-utils/ctrlaltdel.8.adoc'] |
38bb89ee | 1511 | bashcompletions += ['ctrlaltdel'] |
d4c880d5 ZJS |
1512 | |
1513 | exe = executable( | |
1514 | 'fsfreeze', | |
1515 | fsfreeze_sources, | |
1516 | include_directories : includes, | |
1517 | install_dir : sbindir, | |
1518 | install : true) | |
1519 | exes += exe | |
53b37016 | 1520 | manadocs += ['sys-utils/fsfreeze.8.adoc'] |
38bb89ee | 1521 | bashcompletions += ['fsfreeze'] |
d4c880d5 ZJS |
1522 | |
1523 | exe = executable( | |
1524 | 'blkdiscard', | |
1525 | blkdiscard_sources, | |
1526 | include_directories : includes, | |
308a0979 KZ |
1527 | link_with : [lib_common, |
1528 | lib_blkid], | |
d4c880d5 ZJS |
1529 | install_dir : sbindir, |
1530 | install : true) | |
1531 | exes += exe | |
53b37016 | 1532 | manadocs += ['sys-utils/blkdiscard.8.adoc'] |
38bb89ee | 1533 | bashcompletions += ['blkdiscard'] |
d4c880d5 ZJS |
1534 | |
1535 | exe = executable( | |
1536 | 'blkzone', | |
1537 | blkzone_sources, | |
1538 | include_directories : includes, | |
1539 | link_with : [lib_common], | |
1540 | install_dir : sbindir, | |
1541 | install : true) | |
1542 | exes += exe | |
53b37016 | 1543 | manadocs += ['sys-utils/blkzone.8.adoc'] |
38bb89ee | 1544 | bashcompletions += ['blkzone'] |
d4c880d5 | 1545 | |
61c2946d TW |
1546 | exe = executable( |
1547 | 'blkpr', | |
1548 | blkpr_sources, | |
1549 | include_directories : includes, | |
1550 | link_with : [lib_common], | |
1551 | install_dir : sbindir, | |
1552 | install : true) | |
1553 | exes += exe | |
1554 | manadocs += ['sys-utils/blkpr.8.adoc'] | |
1555 | ||
d4c880d5 ZJS |
1556 | exe = executable( |
1557 | 'ldattach', | |
1558 | ldattach_sources, | |
1559 | include_directories : includes, | |
1560 | link_with : [lib_common], | |
1561 | install_dir : usrsbin_exec_dir, | |
1562 | install : true) | |
1563 | exes += exe | |
53b37016 | 1564 | manadocs += ['sys-utils/ldattach.8.adoc'] |
38bb89ee | 1565 | bashcompletions += ['ldattach'] |
d4c880d5 ZJS |
1566 | |
1567 | exe = executable( | |
1568 | 'rtcwake', | |
1569 | rtcwake_sources, | |
1570 | include_directories : includes, | |
1571 | link_with : [lib_common], | |
1572 | install_dir : usrsbin_exec_dir, | |
1573 | install : true) | |
1574 | exes += exe | |
53b37016 | 1575 | manadocs += ['sys-utils/rtcwake.8.adoc'] |
38bb89ee | 1576 | bashcompletions += ['rtcwake'] |
d4c880d5 ZJS |
1577 | |
1578 | exe = executable( | |
1579 | 'setarch', | |
1580 | setarch_sources, | |
1581 | include_directories : includes, | |
035fc2d9 | 1582 | link_with : [lib_common], |
d4c880d5 ZJS |
1583 | install_dir : usrbin_exec_dir, |
1584 | install : true) | |
1585 | exes += exe | |
53b37016 | 1586 | manadocs += ['sys-utils/setarch.8.adoc'] |
38bb89ee | 1587 | bashcompletions += ['setarch'] |
d4c880d5 ZJS |
1588 | |
1589 | setarch_links = ['uname26', 'linux32', 'linux64'] | |
1590 | setarch_links_arch = { | |
1591 | 's390x' : ['s390', 's390x'], | |
1592 | 'x86' : ['i386'], | |
1593 | 'x86_64' : ['i386', 'x86_64'], | |
1594 | 'ppc64' : ['ppc', 'ppc64', 'ppc32'], | |
1595 | 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'], | |
1596 | 'mips64' : ['mips', 'mips64', 'mips32'], | |
1597 | 'ia64' : ['i386', 'ia64'], | |
1598 | 'hppa' : ['parisc', 'parisc64', 'parisc32'], | |
1599 | } | |
1600 | setarch_links += setarch_links_arch.get(host_machine.cpu_family(), []) | |
1601 | ||
1602 | foreach link: setarch_links | |
1603 | meson.add_install_script(meson_make_symlink, | |
1604 | 'setarch', | |
1605 | join_paths(usrbin_exec_dir, link)) | |
38bb89ee | 1606 | manlinks += {link + '.8': 'setarch.8'} |
d4c880d5 ZJS |
1607 | endforeach |
1608 | ||
1609 | opt = not get_option('build-eject').disabled() | |
1610 | exe = executable( | |
1611 | 'eject', | |
1612 | eject_sources, | |
1613 | include_directories : includes, | |
1614 | link_with : [lib_common, | |
1615 | lib_mount], | |
1616 | install_dir : usrbin_exec_dir, | |
1617 | install : opt, | |
1618 | build_by_default : opt) | |
1619 | if opt and not is_disabler(exe) | |
1620 | exe = exe | |
53b37016 | 1621 | manadocs += ['sys-utils/eject.1.adoc'] |
38bb89ee | 1622 | bashcompletions += ['eject'] |
d4c880d5 ZJS |
1623 | endif |
1624 | ||
1625 | opt = not get_option('build-losetup').disabled() | |
1626 | exe = executable( | |
1627 | 'losetup', | |
1628 | losetup_sources, | |
1629 | include_directories : includes, | |
1630 | link_with : [lib_common, | |
1631 | lib_smartcols], | |
1632 | install_dir : sbindir, | |
1633 | install : opt, | |
1634 | build_by_default : opt) | |
1635 | if opt and not is_disabler(exe) | |
53b37016 | 1636 | manadocs += ['sys-utils/losetup.8.adoc'] |
d4c880d5 | 1637 | exes += exe |
38bb89ee | 1638 | bashcompletions += ['losetup'] |
d4c880d5 ZJS |
1639 | endif |
1640 | ||
69939195 ZJS |
1641 | opt = opt and 'losetup' in static_programs |
1642 | exe = executable( | |
1643 | 'losetup.static', | |
1644 | losetup_sources, | |
1645 | include_directories : includes, | |
1646 | link_args : ['--static'], | |
1647 | link_with : [lib_common, | |
1648 | lib_smartcols.get_static_lib()], | |
1649 | install_dir : sbindir, | |
1650 | install : opt, | |
1651 | build_by_default : opt) | |
1652 | if opt and not is_disabler(exe) | |
1653 | exes += exe | |
1654 | endif | |
1655 | ||
d4c880d5 ZJS |
1656 | opt = not get_option('build-zramctl').disabled() |
1657 | exe = executable( | |
1658 | 'zramctl', | |
1659 | zramctl_sources, | |
1660 | include_directories : includes, | |
1661 | link_with : [lib_common, | |
1662 | lib_smartcols], | |
1663 | install_dir : sbindir, | |
1664 | install : opt, | |
1665 | build_by_default : opt) | |
1666 | if opt and not is_disabler(exe) | |
1667 | exes += exe | |
53b37016 | 1668 | manadocs += ['sys-utils/zramctl.8.adoc'] |
38bb89ee | 1669 | bashcompletions += ['zramctl'] |
d4c880d5 ZJS |
1670 | endif |
1671 | ||
1672 | exe = executable( | |
1673 | 'prlimit', | |
1674 | prlimit_sources, | |
1675 | include_directories : includes, | |
1676 | link_with : [lib_common, | |
1677 | lib_smartcols], | |
1678 | install_dir : usrbin_exec_dir, | |
1679 | install : true) | |
1680 | if not is_disabler(exe) | |
1681 | exes += exe | |
53b37016 | 1682 | manadocs += ['sys-utils/prlimit.1.adoc'] |
38bb89ee | 1683 | bashcompletions += ['prlimit'] |
d4c880d5 ZJS |
1684 | endif |
1685 | ||
1686 | exe = executable( | |
1687 | 'lsns', | |
1688 | lsns_sources, | |
1689 | include_directories : includes, | |
1690 | link_with : [lib_common, | |
1691 | lib_smartcols, | |
1692 | lib_mount], | |
1693 | install_dir : usrbin_exec_dir, | |
1694 | install : true) | |
1695 | if not is_disabler(exe) | |
1696 | exes += exe | |
53b37016 | 1697 | manadocs += ['sys-utils/lsns.8.adoc'] |
38bb89ee | 1698 | bashcompletions += ['lsns'] |
d4c880d5 ZJS |
1699 | endif |
1700 | ||
1701 | opt = not get_option('build-mount').disabled() | |
1702 | exe = executable( | |
1703 | 'mount', | |
1704 | mount_sources, | |
1705 | include_directories : includes, | |
1706 | link_with : [lib_common, | |
1707 | lib_smartcols, | |
1708 | lib_mount], | |
1709 | dependencies : lib_selinux, | |
8f49b369 | 1710 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1711 | install : opt, |
1712 | build_by_default : opt) | |
1713 | exe2 = executable( | |
1714 | 'umount', | |
1715 | umount_sources, | |
1716 | include_directories : includes, | |
1717 | link_with : [lib_common, | |
1718 | lib_mount], | |
1cb3c90c | 1719 | install_mode : 'rwsr-xr-x', |
d4c880d5 ZJS |
1720 | install : opt, |
1721 | build_by_default : opt) | |
1722 | if opt and not is_disabler(exe) | |
1723 | exes += [exe, exe2] | |
53b37016 KZ |
1724 | manadocs += ['sys-utils/fstab.5.adoc', |
1725 | 'sys-utils/mount.8.adoc', | |
1726 | 'sys-utils/umount.8.adoc'] | |
38bb89ee | 1727 | bashcompletions += ['mount', 'umount'] |
d4c880d5 ZJS |
1728 | endif |
1729 | ||
69939195 ZJS |
1730 | opt2 = opt and 'mount' in static_programs |
1731 | exe = executable( | |
1732 | 'mount.static', | |
1733 | mount_sources, | |
1734 | include_directories : includes, | |
1735 | link_args : ['--static'], | |
1736 | link_with : [lib_common, | |
1737 | lib_smartcols_static, | |
1738 | lib_mount_static], | |
1739 | install : opt2, | |
1740 | build_by_default : opt2) | |
1741 | if opt2 and not is_disabler(exe) | |
1742 | exes += exe | |
1743 | endif | |
1744 | ||
1745 | opt2 = opt and 'umount' in static_programs | |
1746 | exe = executable( | |
1747 | 'umount.static', | |
1748 | umount_sources, | |
1749 | include_directories : includes, | |
1750 | link_args : ['--static'], | |
1751 | link_with : [lib_common, | |
1752 | lib_mount_static], | |
1753 | install : opt2, | |
1754 | build_by_default : opt2) | |
1755 | if opt2 and not is_disabler(exe) | |
1756 | exes += exe | |
1757 | endif | |
1758 | ||
d4c880d5 ZJS |
1759 | # setuid? |
1760 | ||
1761 | exe = executable( | |
1762 | 'swapon', | |
1763 | swapon_sources, | |
1764 | include_directories : includes, | |
1765 | link_with : [lib_common, | |
1766 | lib_blkid, | |
1767 | lib_mount, | |
1768 | lib_smartcols], | |
1769 | install_dir : sbindir, | |
1770 | install : true) | |
1771 | if not is_disabler(exe) | |
1772 | exes += exe | |
53b37016 | 1773 | manadocs += ['sys-utils/swapon.8.adoc'] |
38bb89ee | 1774 | bashcompletions += ['swapon'] |
d4c880d5 ZJS |
1775 | endif |
1776 | ||
1777 | exe = executable( | |
1778 | 'swapoff', | |
1779 | swapoff_sources, | |
1780 | include_directories : includes, | |
1781 | link_with : [lib_common, | |
1782 | lib_blkid, | |
1783 | lib_mount], | |
1784 | install_dir : sbindir, | |
1785 | install : true) | |
1786 | if not is_disabler(exe) | |
1787 | exes += exe | |
38bb89ee TW |
1788 | manlinks += {'swapoff.8': 'swapon.8'} |
1789 | bashcompletions += ['swapoff'] | |
d4c880d5 ZJS |
1790 | endif |
1791 | ||
1792 | exe = executable( | |
1793 | 'lscpu', | |
1794 | lscpu_sources, | |
1795 | include_directories : includes, | |
1796 | link_with : [lib_common, | |
1797 | lib_smartcols], | |
1798 | dependencies : [rtas_libs], | |
1799 | install_dir : usrbin_exec_dir, | |
1800 | install : true) | |
1801 | if not is_disabler(exe) | |
1802 | exes += exe | |
53b37016 | 1803 | manadocs += ['sys-utils/lscpu.1.adoc'] |
38bb89ee | 1804 | bashcompletions += ['lscpu'] |
d4c880d5 ZJS |
1805 | endif |
1806 | ||
1807 | exe = executable( | |
1808 | 'chcpu', | |
1809 | chcpu_sources, | |
1810 | include_directories : includes, | |
1811 | link_with : [lib_common], | |
1812 | install_dir : sbindir, | |
1813 | install : true) | |
1814 | exes += exe | |
53b37016 | 1815 | manadocs += ['sys-utils/chcpu.8.adoc'] |
38bb89ee | 1816 | bashcompletions += ['chcpu'] |
d4c880d5 ZJS |
1817 | |
1818 | exe = executable( | |
1819 | 'wdctl', | |
1820 | wdctl_sources, | |
1821 | include_directories : includes, | |
1822 | link_with : [lib_common, | |
1823 | lib_smartcols], | |
1824 | install : true) | |
1825 | if not is_disabler(exe) | |
1826 | exes += exe | |
53b37016 | 1827 | manadocs += ['sys-utils/wdctl.8.adoc'] |
38bb89ee | 1828 | bashcompletions += ['wdctl'] |
d4c880d5 ZJS |
1829 | endif |
1830 | ||
1831 | opt = not get_option('build-mountpoint').disabled() | |
1832 | exe = executable( | |
1833 | 'mountpoint', | |
1834 | mountpoint_sources, | |
1835 | include_directories : includes, | |
1836 | link_with : [lib_mount], | |
1837 | install : opt, | |
1838 | build_by_default : opt) | |
1839 | if opt and not is_disabler(exe) | |
1840 | exes += exe | |
53b37016 | 1841 | manadocs += ['sys-utils/mountpoint.1.adoc'] |
38bb89ee | 1842 | bashcompletions += ['mountpoint'] |
d4c880d5 ZJS |
1843 | endif |
1844 | ||
1845 | opt = not get_option('build-fallocate').disabled() | |
1846 | exe = executable( | |
1847 | 'fallocate', | |
1848 | fallocate_sources, | |
1849 | include_directories : includes, | |
1850 | link_with : [lib_common], | |
1851 | install_dir : usrbin_exec_dir, | |
1852 | install : opt, | |
1853 | build_by_default : opt) | |
1854 | if opt and not is_disabler(exe) | |
1855 | exes += exe | |
53b37016 | 1856 | manadocs += ['sys-utils/fallocate.1.adoc'] |
38bb89ee | 1857 | bashcompletions += ['fallocate'] |
d4c880d5 ZJS |
1858 | endif |
1859 | ||
1860 | opt = not get_option('build-pivot_root').disabled() | |
1861 | exe = executable( | |
1862 | 'pivot_root', | |
1863 | pivot_root_sources, | |
1864 | include_directories : includes, | |
1865 | install_dir : sbindir, | |
1866 | install : opt, | |
1867 | build_by_default : opt) | |
1868 | if opt and not is_disabler(exe) | |
1869 | exes += exe | |
53b37016 | 1870 | manadocs += ['sys-utils/pivot_root.8.adoc'] |
38bb89ee | 1871 | bashcompletions += ['pivot_root'] |
d4c880d5 ZJS |
1872 | endif |
1873 | ||
1874 | opt = not get_option('build-switch_root').disabled() | |
1875 | if opt and not have_dirfd and not have_ddfd | |
1876 | error('neither dirfd nor ddfd are available') | |
1877 | endif | |
1878 | exe = executable( | |
1879 | 'switch_root', | |
1880 | switch_root_sources, | |
1881 | include_directories : includes, | |
1882 | install_dir : sbindir, | |
1883 | install : opt, | |
1884 | build_by_default : opt) | |
1885 | if opt and not is_disabler(exe) | |
1886 | exes += exe | |
53b37016 | 1887 | manadocs += ['sys-utils/switch_root.8.adoc'] |
d4c880d5 ZJS |
1888 | endif |
1889 | ||
1890 | opt = not get_option('build-unshare').disabled() | |
1891 | exe = executable( | |
1892 | 'unshare', | |
1893 | unshare_sources, | |
1894 | include_directories : includes, | |
1895 | link_with : [lib_common], | |
1896 | install_dir : usrbin_exec_dir, | |
1897 | install : opt, | |
1898 | build_by_default : opt) | |
1899 | if opt and not is_disabler(exe) | |
1900 | exes += exe | |
53b37016 | 1901 | manadocs += ['sys-utils/unshare.1.adoc'] |
38bb89ee | 1902 | bashcompletions += ['unshare'] |
d4c880d5 ZJS |
1903 | endif |
1904 | ||
69939195 ZJS |
1905 | opt = opt and 'unshare' in static_programs |
1906 | exe = executable( | |
1907 | 'unshare.static', | |
1908 | unshare_sources, | |
1909 | include_directories : includes, | |
1910 | link_with : [lib_common], | |
1911 | install_dir : usrbin_exec_dir, | |
1912 | install : opt, | |
1913 | build_by_default : opt) | |
1914 | if opt and not is_disabler(exe) | |
1915 | exes += exe | |
1916 | endif | |
1917 | ||
d4c880d5 ZJS |
1918 | opt = not get_option('build-nsenter').disabled() |
1919 | exe = executable( | |
1920 | 'nsenter', | |
1921 | nsenter_sources, | |
1922 | include_directories : includes, | |
1923 | link_with : [lib_common], | |
1924 | dependencies : [lib_selinux], | |
1925 | install_dir : usrbin_exec_dir, | |
1926 | install : opt, | |
1927 | build_by_default : opt) | |
1928 | if opt and not is_disabler(exe) | |
1929 | exes += exe | |
53b37016 | 1930 | manadocs += ['sys-utils/nsenter.1.adoc'] |
38bb89ee | 1931 | bashcompletions += ['nsenter'] |
d4c880d5 ZJS |
1932 | endif |
1933 | ||
69939195 ZJS |
1934 | opt = opt and 'nsenter' in static_programs |
1935 | exe = executable( | |
1936 | 'nsenter.static', | |
1937 | nsenter_sources, | |
1938 | include_directories : includes, | |
1939 | link_with : [lib_common], | |
1940 | dependencies : [lib_selinux], | |
1941 | install_dir : usrbin_exec_dir, | |
1942 | install : opt, | |
1943 | build_by_default : opt) | |
1944 | if opt and not is_disabler(exe) | |
1945 | exes += exe | |
1946 | endif | |
1947 | ||
cd23a433 | 1948 | opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found() |
d4c880d5 ZJS |
1949 | exe = executable( |
1950 | 'setpriv', | |
1951 | setpriv_sources, | |
1952 | include_directories : includes, | |
1953 | link_with : [lib_common], | |
1954 | dependencies : [lib_cap_ng], | |
1955 | install_dir : usrbin_exec_dir, | |
1956 | install : opt, | |
1957 | build_by_default : opt) | |
1958 | if opt and not is_disabler(exe) | |
1959 | exes += exe | |
53b37016 | 1960 | manadocs += ['sys-utils/setpriv.1.adoc'] |
38bb89ee | 1961 | bashcompletions += ['setpriv'] |
d4c880d5 ZJS |
1962 | endif |
1963 | ||
1964 | exe = executable( | |
1965 | 'flock', | |
1966 | flock_sources, | |
1967 | include_directories : includes, | |
1968 | link_with : [lib_common], | |
1969 | dependencies : realtime_libs, | |
1970 | install_dir : usrbin_exec_dir, | |
1971 | install : true) | |
1972 | exes += exe | |
53b37016 | 1973 | manadocs += ['sys-utils/flock.1.adoc'] |
38bb89ee | 1974 | bashcompletions += ['flock'] |
d4c880d5 | 1975 | |
645577c7 KZ |
1976 | opt = not get_option('build-lsirq').disabled() |
1977 | exe = executable( | |
1978 | 'lsirq', | |
1979 | lsirq_sources, | |
1980 | include_directories : includes, | |
1981 | link_with : [lib_common, | |
1982 | lib_smartcols], | |
1983 | install_dir : usrbin_exec_dir, | |
1984 | install : opt, | |
1985 | build_by_default : opt) | |
1986 | if opt and not is_disabler(exe) | |
1987 | exes += exe | |
53b37016 | 1988 | manadocs += ['sys-utils/lsirq.1.adoc'] |
38bb89ee | 1989 | bashcompletions += ['lsirq'] |
645577c7 KZ |
1990 | endif |
1991 | ||
1992 | opt = not get_option('build-irqtop').disabled() | |
1993 | exe = executable( | |
1994 | 'irqtop', | |
1995 | irqtop_sources, | |
1996 | include_directories : includes, | |
1997 | dependencies : [realtime_libs, curses_libs], | |
1998 | link_with : [lib_common, | |
1999 | lib_smartcols, | |
2000 | lib_tcolors], | |
2001 | install_dir : usrbin_exec_dir, | |
2002 | install : opt, | |
2003 | build_by_default : opt) | |
2004 | if opt and not is_disabler(exe) | |
2005 | exes += exe | |
53b37016 | 2006 | manadocs += ['sys-utils/irqtop.1.adoc'] |
38bb89ee | 2007 | bashcompletions += ['irqtop'] |
645577c7 KZ |
2008 | endif |
2009 | ||
d4c880d5 ZJS |
2010 | opt = not get_option('build-ipcs').disabled() |
2011 | exe = executable( | |
2012 | 'lsipc', | |
2013 | lsipc_sources, | |
2014 | include_directories : includes, | |
2015 | link_with : [lib_common, | |
2016 | lib_smartcols], | |
2017 | install_dir : usrbin_exec_dir, | |
2018 | install : opt, | |
2019 | build_by_default : opt) | |
2020 | if opt and not is_disabler(exe) | |
2021 | exes += exe | |
53b37016 | 2022 | manadocs += ['sys-utils/lsipc.1.adoc'] |
38bb89ee | 2023 | bashcompletions += ['lsipc'] |
d4c880d5 ZJS |
2024 | endif |
2025 | ||
2026 | opt = build_hwclock | |
2027 | exe = executable( | |
2028 | 'hwclock', | |
2029 | hwclock_sources, | |
2030 | include_directories : includes, | |
2031 | link_with : [lib_common], | |
2032 | dependencies : [lib_m, | |
2033 | lib_audit], | |
2034 | install_dir : sbindir, | |
2035 | install : opt, | |
2036 | build_by_default : opt) | |
2037 | if opt and not is_disabler(exe) | |
2038 | exes += exe | |
38bb89ee TW |
2039 | manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc'] |
2040 | bashcompletions += ['hwclock'] | |
d4c880d5 ZJS |
2041 | endif |
2042 | ||
2043 | exe = executable( | |
2044 | 'mkfs', | |
2045 | mkfs_sources, | |
2046 | include_directories : includes, | |
2047 | install_dir : sbindir, | |
2048 | install : true) | |
2049 | exes += exe | |
53b37016 | 2050 | manadocs += ['disk-utils/mkfs.8.adoc'] |
38bb89ee | 2051 | bashcompletions += ['mkfs'] |
d4c880d5 ZJS |
2052 | |
2053 | opt = not get_option('build-bfs').disabled() | |
2054 | exe = executable( | |
2055 | 'mkfs.bfs', | |
2056 | mkfs_bfs_sources, | |
2057 | include_directories : includes, | |
2058 | link_with : [lib_common], | |
2059 | install_dir : sbindir, | |
2060 | install : opt, | |
2061 | build_by_default : opt) | |
2062 | if opt and not is_disabler(exe) | |
2063 | exes += exe | |
53b37016 | 2064 | manadocs += ['disk-utils/mkfs.bfs.8.adoc'] |
38bb89ee | 2065 | bashcompletions += ['mkfs.bfs'] |
d4c880d5 ZJS |
2066 | endif |
2067 | ||
2068 | exe = executable( | |
2069 | 'isosize', | |
2070 | isosize_sources, | |
2071 | include_directories : includes, | |
2072 | link_with : [lib_common], | |
2073 | install_dir : usrbin_exec_dir, | |
2074 | install : true) | |
2075 | exes += exe | |
53b37016 | 2076 | manadocs += ['disk-utils/isosize.8.adoc'] |
38bb89ee | 2077 | bashcompletions += ['isosize'] |
d4c880d5 ZJS |
2078 | |
2079 | exe = executable( | |
2080 | 'mkswap', | |
2081 | mkswap_sources, | |
2082 | include_directories : includes, | |
2083 | link_with : [lib_common, | |
2084 | lib_blkid, | |
2085 | lib_uuid], | |
2086 | dependencies: [lib_selinux], | |
2087 | install_dir : sbindir, | |
2088 | install : true) | |
2089 | if opt and not is_disabler(exe) | |
2090 | exes += exe | |
53b37016 | 2091 | manadocs += ['disk-utils/mkswap.8.adoc'] |
38bb89ee | 2092 | bashcompletions += ['mkswap'] |
d4c880d5 ZJS |
2093 | endif |
2094 | ||
2095 | exe = executable( | |
2096 | 'swaplabel', | |
2097 | swaplabel_sources, | |
2098 | include_directories : includes, | |
2099 | link_with : [lib_common, | |
2100 | lib_blkid, | |
2101 | lib_uuid], | |
2102 | install_dir : sbindir, | |
2103 | install : true) | |
2104 | if opt and not is_disabler(exe) | |
2105 | exes += exe | |
53b37016 | 2106 | manadocs += ['disk-utils/swaplabel.8.adoc'] |
38bb89ee | 2107 | bashcompletions += ['swaplabel'] |
d4c880d5 ZJS |
2108 | endif |
2109 | ||
2110 | opt = not get_option('build-fsck').disabled() | |
2111 | exe = executable( | |
2112 | 'fsck', | |
2113 | fsck_sources, | |
2114 | include_directories : includes, | |
2115 | link_with : [lib_common, | |
2116 | lib_blkid, | |
2117 | lib_mount], | |
2118 | dependencies : realtime_libs, | |
2119 | install_dir : sbindir, | |
2120 | install : opt, | |
2121 | build_by_default : opt) | |
2122 | if opt and not is_disabler(exe) | |
2123 | exes += exe | |
53b37016 | 2124 | manadocs += ['disk-utils/fsck.8.adoc'] |
38bb89ee | 2125 | bashcompletions += ['fsck'] |
d4c880d5 ZJS |
2126 | endif |
2127 | ||
2128 | opt = not get_option('build-minix').disabled() | |
2129 | exe = executable( | |
2130 | 'mkfs.minix', | |
2131 | mkfs_minix_sources, | |
2132 | include_directories : includes, | |
2133 | link_with : [lib_common], | |
2134 | install_dir : sbindir, | |
2135 | install : opt, | |
2136 | build_by_default : opt) | |
2137 | exe2 = executable( | |
2138 | 'test_mkfs_minix', | |
2139 | mkfs_minix_sources, | |
2140 | include_directories : includes, | |
2141 | c_args : '-DTEST_SCRIPT', | |
2142 | link_with : [lib_common], | |
ba30b89c | 2143 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
2144 | exe3 = executable( |
2145 | 'fsck.minix', | |
2146 | fsck_minix_sources, | |
2147 | include_directories : includes, | |
2148 | link_with : [lib_common], | |
2149 | install_dir : sbindir, | |
2150 | install : opt, | |
2151 | build_by_default : opt) | |
2152 | if opt and not is_disabler(exe) | |
2153 | exes += [exe, exe2, exe3] | |
53b37016 | 2154 | manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc'] |
38bb89ee | 2155 | bashcompletions += ['mkfs.minix', 'fsck.minix'] |
d4c880d5 ZJS |
2156 | endif |
2157 | ||
2158 | opt = not get_option('build-cramfs').disabled() | |
2159 | exe = executable( | |
2160 | 'mkfs.cramfs', | |
2161 | mkfs_cramfs_sources, | |
2162 | include_directories : includes, | |
2163 | link_with : [lib_common], | |
2164 | dependencies : [lib_z], | |
2165 | install_dir : sbindir, | |
2166 | install : opt, | |
2167 | build_by_default : opt) | |
2168 | exe2 = executable( | |
2169 | 'fsck.cramfs', | |
2170 | fsck_cramfs_sources, | |
2171 | include_directories : includes, | |
2172 | link_with : [lib_common], | |
2173 | dependencies : [lib_z], | |
2174 | install_dir : sbindir, | |
2175 | install : opt, | |
2176 | build_by_default : opt) | |
2177 | if not is_disabler(exe) | |
2178 | exes += [exe, exe2] | |
53b37016 | 2179 | manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc'] |
38bb89ee | 2180 | bashcompletions += ['mkfs.cramfs', 'fsck.cramfs'] |
d4c880d5 ZJS |
2181 | endif |
2182 | ||
2183 | opt = not get_option('build-raw').disabled() | |
dff176e2 | 2184 | if opt |
433e4b77 | 2185 | cc.has_header('linux/raw.h', required: opt) |
dff176e2 | 2186 | endif |
d4c880d5 ZJS |
2187 | exe = executable( |
2188 | 'raw', | |
2189 | raw_sources, | |
2190 | include_directories : includes, | |
2191 | install_dir : sbindir, | |
2192 | install : opt, | |
2193 | build_by_default : opt) | |
2194 | if opt and not is_disabler(exe) | |
2195 | exes += exe | |
53b37016 | 2196 | manadocs += ['disk-utils/raw.8.adoc'] |
38bb89ee | 2197 | bashcompletions += ['raw'] |
d4c880d5 ZJS |
2198 | endif |
2199 | ||
2200 | opt = not get_option('build-fdformat').disabled() | |
2201 | exe = executable( | |
2202 | 'fdformat', | |
2203 | fdformat_sources, | |
2204 | include_directories : includes, | |
2205 | link_with : [lib_common], | |
2206 | install_dir : usrsbin_exec_dir, | |
2207 | install : opt, | |
2208 | build_by_default : opt) | |
2209 | if opt and not is_disabler(exe) | |
2210 | exes += exe | |
53b37016 | 2211 | manadocs += ['disk-utils/fdformat.8.adoc'] |
d4c880d5 ZJS |
2212 | endif |
2213 | ||
2214 | exe = executable( | |
2215 | 'blockdev', | |
2216 | blockdev_sources, | |
2217 | include_directories : includes, | |
2218 | link_with : [lib_common], | |
2219 | install_dir : sbindir, | |
2220 | install : true) | |
53b37016 | 2221 | manadocs += ['disk-utils/blockdev.8.adoc'] |
38bb89ee | 2222 | bashcompletions += ['blockdev'] |
d4c880d5 ZJS |
2223 | |
2224 | opt = not get_option('build-fdisks').disabled() | |
2225 | if opt and not have_dirfd and not have_ddfd | |
2226 | error('neither dirfd nor ddfd are available') | |
2227 | endif | |
2228 | exe = executable( | |
2229 | 'fdisk', | |
2230 | fdisk_sources, | |
2231 | include_directories : includes, | |
2232 | link_with : [lib_common, | |
2233 | lib_fdisk, | |
2234 | lib_smartcols, | |
2235 | lib_tcolors], | |
2236 | dependencies : [lib_readline], | |
2237 | install_dir : sbindir, | |
2238 | install : opt, | |
2239 | build_by_default : opt) | |
2240 | if opt and not is_disabler(exe) | |
2241 | exes += exe | |
38bb89ee | 2242 | bashcompletions += ['fdisk'] |
d4c880d5 ZJS |
2243 | endif |
2244 | ||
69939195 ZJS |
2245 | opt2 = opt and 'fdisk' in static_programs |
2246 | exe = executable( | |
2247 | 'fdisk.static', | |
2248 | fdisk_sources, | |
2249 | link_args : ['--static'], | |
2250 | include_directories : includes, | |
2251 | link_with : [lib_common, | |
2252 | lib_tcolors, | |
2253 | lib_fdisk_static, | |
2254 | lib_smartcols.get_static_lib()], | |
2255 | dependencies : [lib_readline_static], | |
2256 | install_dir : sbindir, | |
2257 | install : opt2, | |
2258 | build_by_default : opt2) | |
2259 | if opt2 and not is_disabler(exe) | |
2260 | exes += exe | |
2261 | endif | |
d4c880d5 ZJS |
2262 | |
2263 | exe = executable( | |
2264 | 'sfdisk', | |
2265 | sfdisk_sources, | |
2266 | include_directories : includes, | |
2267 | link_with : [lib_common, | |
2268 | lib_fdisk, | |
2269 | lib_smartcols, | |
2270 | lib_tcolors], | |
2271 | dependencies : [lib_readline], | |
2272 | install_dir : sbindir, | |
2273 | install : opt, | |
2274 | build_by_default : opt) | |
2275 | if opt and not is_disabler(exe) | |
2276 | exes += exe | |
38bb89ee | 2277 | bashcompletions += ['sfdisk'] |
d4c880d5 ZJS |
2278 | endif |
2279 | ||
69939195 ZJS |
2280 | opt2 = opt and 'sfdisk' in static_programs |
2281 | exe = executable( | |
2282 | 'sfdisk.static', | |
2283 | sfdisk_sources, | |
2284 | include_directories : includes, | |
2285 | link_with : [lib_common, | |
2286 | lib_tcolors, | |
2287 | lib_fdisk_static, | |
2288 | lib_smartcols.get_static_lib()], | |
2289 | dependencies : [lib_readline_static], | |
2290 | install_dir : sbindir, | |
2291 | install : opt2, | |
2292 | build_by_default : opt2) | |
2293 | if opt2 and not is_disabler(exe) | |
2294 | exes += exe | |
2295 | endif | |
d4c880d5 ZJS |
2296 | |
2297 | exe = executable( | |
2298 | 'cfdisk', | |
2299 | cfdisk_sources, | |
2300 | include_directories : includes, | |
2301 | link_with : [lib_common, | |
2302 | lib_fdisk, | |
2303 | lib_smartcols, | |
2304 | lib_tcolors, | |
2305 | lib_mount], | |
2306 | dependencies : [curses_libs], | |
2307 | install_dir : sbindir, | |
2308 | install : opt, | |
2309 | build_by_default : opt) | |
2310 | if opt and not is_disabler(exe) | |
2311 | exes += exe | |
53b37016 KZ |
2312 | manadocs += ['disk-utils/fdisk.8.adoc', |
2313 | 'disk-utils/sfdisk.8.adoc', | |
2314 | 'disk-utils/cfdisk.8.adoc'] | |
38bb89ee | 2315 | bashcompletions += ['cfdisk'] |
d4c880d5 ZJS |
2316 | endif |
2317 | ||
2318 | opt = not get_option('build-partx').disabled() | |
2319 | exe = executable( | |
2320 | 'addpart', | |
2321 | addpart_sources, | |
2322 | include_directories : includes, | |
2323 | link_with : [lib_common], | |
2324 | install_dir : usrsbin_exec_dir, | |
2325 | install : opt, | |
2326 | build_by_default : opt) | |
2327 | exe2 = executable( | |
2328 | 'delpart', | |
2329 | delpart_sources, | |
2330 | include_directories : includes, | |
2331 | link_with : [lib_common], | |
2332 | install_dir : usrsbin_exec_dir, | |
2333 | install : opt, | |
2334 | build_by_default : opt) | |
2335 | exe3 = executable( | |
2336 | 'resizepart', | |
2337 | resizepart_sources, | |
2338 | include_directories : includes, | |
2339 | link_with : [lib_common], | |
2340 | install_dir : usrsbin_exec_dir, | |
2341 | install : opt, | |
2342 | build_by_default : opt) | |
2343 | exe4 = executable( | |
2344 | 'partx', | |
2345 | partx_sources, | |
2346 | include_directories : includes, | |
2347 | link_with : [lib_common, | |
2348 | lib_blkid, | |
2349 | lib_smartcols], | |
2350 | install_dir : usrsbin_exec_dir, | |
2351 | install : opt, | |
2352 | build_by_default : opt) | |
2353 | if opt | |
2354 | exes += [exe, exe2, exe3, exe4] | |
53b37016 KZ |
2355 | manadocs += ['disk-utils/addpart.8.adoc', |
2356 | 'disk-utils/delpart.8.adoc', | |
2357 | 'disk-utils/resizepart.8.adoc', | |
2358 | 'disk-utils/partx.8.adoc'] | |
38bb89ee | 2359 | bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx'] |
d4c880d5 ZJS |
2360 | endif |
2361 | ||
2362 | ############################################################ | |
2363 | ||
2364 | exe = executable( | |
2365 | 'script', | |
2366 | script_sources, | |
2367 | include_directories : includes, | |
2368 | link_with : [lib_common], | |
2369 | dependencies : [lib_util, | |
2370 | lib_utempter, | |
2371 | realtime_libs, | |
2372 | math_libs], | |
2373 | install_dir : usrbin_exec_dir, | |
2374 | install : true) | |
2375 | exes += exe | |
53b37016 | 2376 | manadocs += ['term-utils/script.1.adoc'] |
38bb89ee | 2377 | bashcompletions += ['script'] |
d4c880d5 ZJS |
2378 | |
2379 | exe = executable( | |
2380 | 'test_script', | |
2381 | script_sources, | |
2382 | include_directories : includes, | |
2383 | c_args : '-DTEST_SCRIPT', | |
2384 | link_with : [lib_common], | |
2385 | dependencies : [lib_util, | |
2386 | lib_utempter, | |
2387 | realtime_libs, | |
ba30b89c | 2388 | math_libs], |
2389 | build_by_default : program_tests) | |
d4c880d5 ZJS |
2390 | exes += exe |
2391 | ||
2392 | exe = executable( | |
2393 | 'scriptlive', | |
2394 | scriptlive_sources, | |
2395 | include_directories : includes, | |
2396 | link_with : [lib_common], | |
2397 | dependencies : [lib_util, | |
2398 | realtime_libs, | |
2399 | math_libs], | |
2400 | install_dir : usrbin_exec_dir, | |
2401 | install : true) | |
2402 | exes += exe | |
53b37016 | 2403 | manadocs += ['term-utils/scriptlive.1.adoc'] |
38bb89ee | 2404 | bashcompletions += ['scriptlive'] |
d4c880d5 ZJS |
2405 | |
2406 | exe = executable( | |
2407 | 'scriptreplay', | |
2408 | scriptreplay_sources, | |
2409 | include_directories : includes, | |
2410 | link_with : [lib_common], | |
2411 | dependencies : [math_libs], | |
2412 | install_dir : usrbin_exec_dir, | |
2413 | install : true) | |
2414 | exes += exe | |
53b37016 | 2415 | manadocs += ['term-utils/scriptreplay.1.adoc'] |
38bb89ee | 2416 | bashcompletions += ['scriptreplay'] |
d4c880d5 ZJS |
2417 | |
2418 | opt = not get_option('build-agetty').disabled() | |
2419 | exe = executable( | |
2420 | 'agetty', | |
2421 | agetty_sources, | |
2422 | include_directories : includes, | |
0333c40b | 2423 | link_with : [lib_common, logindefs_c], |
87fcd95a | 2424 | dependencies : [BSD ? lib_util : [], lib_systemd], |
d4c880d5 ZJS |
2425 | install_dir : sbindir, |
2426 | install : opt, | |
2427 | build_by_default : opt) | |
2428 | if opt | |
2429 | exes += exe | |
53b37016 | 2430 | manadocs += ['term-utils/agetty.8.adoc'] |
d4c880d5 ZJS |
2431 | endif |
2432 | ||
2433 | opt = not get_option('build-setterm').disabled() | |
2434 | exe = executable( | |
2435 | 'setterm', | |
2436 | setterm_sources, | |
2437 | include_directories : includes, | |
2438 | link_with : [lib_common], | |
2439 | dependencies : [curses_libs], | |
2440 | install_dir : usrbin_exec_dir, | |
2441 | install : opt, | |
2442 | build_by_default : opt) | |
2443 | if opt | |
2444 | exes += exe | |
53b37016 | 2445 | manadocs += ['term-utils/setterm.1.adoc'] |
38bb89ee | 2446 | bashcompletions += ['setterm'] |
d4c880d5 ZJS |
2447 | endif |
2448 | ||
2449 | opt = not get_option('build-mesg').disabled() | |
2450 | exe = executable( | |
2451 | 'mesg', | |
2452 | mesg_sources, | |
2453 | include_directories : includes, | |
2454 | link_with : [lib_common], | |
2455 | install_dir : usrbin_exec_dir, | |
2456 | install : opt, | |
2457 | build_by_default : opt) | |
2458 | if opt | |
2459 | exes += exe | |
53b37016 | 2460 | manadocs += ['term-utils/mesg.1.adoc'] |
38bb89ee | 2461 | bashcompletions += ['mesg'] |
d4c880d5 ZJS |
2462 | endif |
2463 | ||
2464 | opt = not get_option('build-wall').disabled() | |
2465 | exe = executable( | |
2466 | 'wall', | |
2467 | wall_sources, | |
2468 | include_directories : includes, | |
2469 | link_with : [lib_common], | |
87fcd95a | 2470 | dependencies : [lib_systemd], |
d4c880d5 | 2471 | install_dir : usrbin_exec_dir, |
5f3359c5 | 2472 | install_mode : [ 'rwxr-sr-x', 'root', 'tty' ], |
d4c880d5 ZJS |
2473 | install : opt, |
2474 | build_by_default : opt) | |
2475 | if opt | |
2476 | exes += exe | |
53b37016 | 2477 | manadocs += ['term-utils/wall.1.adoc'] |
38bb89ee | 2478 | bashcompletions += ['wall'] |
d4c880d5 ZJS |
2479 | endif |
2480 | ||
2481 | # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall | |
2482 | # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall | |
2483 | ||
2484 | opt = not get_option('build-write').disabled() | |
2485 | exe = executable( | |
2486 | 'write', | |
2487 | write_sources, | |
2488 | include_directories : includes, | |
2489 | link_with : [lib_common], | |
87fcd95a | 2490 | dependencies : [lib_systemd], |
d4c880d5 | 2491 | install_dir : usrbin_exec_dir, |
00f115d8 | 2492 | install_mode : [ 'rwxr-sr-x', 'root', 'tty' ], |
d4c880d5 ZJS |
2493 | install : opt, |
2494 | build_by_default : opt) | |
2495 | if opt | |
2496 | exes += exe | |
53b37016 | 2497 | manadocs += ['term-utils/write.1.adoc'] |
e1cd4002 | 2498 | bashcompletions += ['write'] |
d4c880d5 ZJS |
2499 | endif |
2500 | ||
2501 | # chgrp tty $(DESTDIR)$(usrbin_execdir)/write | |
2502 | # chmod g+s $(DESTDIR)$(usrbin_execdir)/write | |
2503 | ||
2504 | opt = not get_option('build-login').disabled() | |
2505 | exe = executable( | |
2506 | 'login', | |
2507 | login_sources, | |
2508 | include_directories : includes, | |
0333c40b | 2509 | link_with : [lib_common, logindefs_c], |
d4c880d5 ZJS |
2510 | dependencies : [lib_pam, |
2511 | lib_audit, | |
2512 | lib_selinux], | |
2513 | install : opt, | |
2514 | build_by_default : opt) | |
2515 | if not is_disabler(exe) | |
2516 | exes += exe | |
53b37016 | 2517 | manadocs += ['login-utils/login.1.adoc'] |
d4c880d5 ZJS |
2518 | endif |
2519 | ||
2520 | opt = not get_option('build-sulogin').disabled() | |
2521 | exe = executable( | |
2522 | 'sulogin', | |
2523 | sulogin_sources, | |
2524 | include_directories : includes, | |
2525 | link_with : [lib_common], | |
2526 | dependencies : [lib_crypt, | |
2527 | lib_selinux], | |
2528 | install_dir : sbindir, | |
2529 | install : opt, | |
2530 | build_by_default : opt) | |
2531 | if not is_disabler(exe) | |
2532 | exes += exe | |
53b37016 | 2533 | manadocs += ['login-utils/sulogin.8.adoc'] |
d4c880d5 ZJS |
2534 | endif |
2535 | ||
2536 | exe = executable( | |
2537 | 'cal', | |
2538 | cal_sources, | |
2539 | include_directories : includes, | |
2540 | link_with : [lib_common, | |
2541 | lib_tcolors], | |
2542 | dependencies : [curses_libs], | |
2543 | install_dir : usrbin_exec_dir, | |
2544 | install : true) | |
2545 | exes += exe | |
53b37016 | 2546 | manadocs += ['misc-utils/cal.1.adoc'] |
38bb89ee | 2547 | bashcompletions += ['cal'] |
d4c880d5 ZJS |
2548 | |
2549 | opt = not get_option('build-logger').disabled() | |
2550 | exe = executable( | |
2551 | 'logger', | |
2552 | logger_sources, | |
2553 | include_directories : includes, | |
dbb9999f | 2554 | link_with : [lib_common], |
d4c880d5 ZJS |
2555 | dependencies : [lib_systemd], |
2556 | install_dir : usrbin_exec_dir, | |
2557 | install : opt, | |
2558 | build_by_default : opt) | |
2559 | if opt and not is_disabler(exe) | |
2560 | exes += exe | |
53b37016 | 2561 | manadocs += ['misc-utils/logger.1.adoc'] |
38bb89ee | 2562 | bashcompletions += ['logger'] |
d4c880d5 ZJS |
2563 | endif |
2564 | ||
2565 | exe = executable( | |
2566 | 'test_logger', | |
2567 | logger_sources, | |
2568 | include_directories : includes, | |
2569 | c_args : '-DTEST_LOGGER', | |
dbb9999f | 2570 | link_with : [lib_common], |
ba30b89c | 2571 | dependencies : [lib_systemd], |
2572 | build_by_default: program_tests) | |
d4c880d5 ZJS |
2573 | if not is_disabler(exe) |
2574 | exes += exe | |
2575 | endif | |
2576 | ||
2577 | exe = executable( | |
2578 | 'look', | |
2579 | look_sources, | |
2580 | include_directories : includes, | |
2581 | install_dir : usrbin_exec_dir, | |
2582 | install : true) | |
2583 | exes += exe | |
53b37016 | 2584 | manadocs += ['misc-utils/look.1.adoc'] |
38bb89ee | 2585 | bashcompletions += ['look'] |
d4c880d5 ZJS |
2586 | |
2587 | exe = executable( | |
2588 | 'mcookie', | |
2589 | mcookie_sources, | |
2590 | include_directories : includes, | |
2591 | link_with : [lib_common], | |
2592 | install_dir : usrbin_exec_dir, | |
2593 | install : true) | |
2594 | exes += exe | |
53b37016 | 2595 | manadocs += ['misc-utils/mcookie.1.adoc'] |
38bb89ee | 2596 | bashcompletions += ['mcookie'] |
d4c880d5 ZJS |
2597 | |
2598 | exe = executable( | |
2599 | 'namei', | |
2600 | namei_sources, | |
2601 | include_directories : includes, | |
c07f7b4e | 2602 | dependencies : [lib_selinux], |
d4c880d5 ZJS |
2603 | install_dir : usrbin_exec_dir, |
2604 | install : true) | |
2605 | exes += exe | |
53b37016 | 2606 | manadocs += ['misc-utils/namei.1.adoc'] |
38bb89ee | 2607 | bashcompletions += ['namei'] |
d4c880d5 ZJS |
2608 | |
2609 | exe = executable( | |
2610 | 'whereis', | |
2611 | whereis_sources, | |
2612 | include_directories : includes, | |
2613 | link_with : [lib_common], | |
2614 | install_dir : usrbin_exec_dir, | |
2615 | install : true) | |
2616 | exes += exe | |
53b37016 | 2617 | manadocs += ['misc-utils/whereis.1.adoc'] |
38bb89ee | 2618 | bashcompletions += ['whereis'] |
d4c880d5 ZJS |
2619 | |
2620 | exe = executable( | |
2621 | 'lslocks', | |
2622 | lslocks_sources, | |
2623 | include_directories : includes, | |
2624 | link_with : [lib_common, | |
2625 | lib_mount, | |
2626 | lib_smartcols], | |
2627 | install_dir : usrbin_exec_dir, | |
2628 | install : true) | |
2629 | if not is_disabler(exe) | |
2630 | exes += exe | |
53b37016 | 2631 | manadocs += ['misc-utils/lslocks.8.adoc'] |
38bb89ee | 2632 | bashcompletions += ['lslocks'] |
d4c880d5 ZJS |
2633 | endif |
2634 | ||
2635 | exe = executable( | |
2636 | 'lsblk', | |
2637 | lsblk_sources, | |
2638 | include_directories : includes, | |
2639 | link_with : [lib_common, | |
2640 | lib_blkid, | |
2641 | lib_mount, | |
c3317cdc | 2642 | lib_tcolors, |
d4c880d5 ZJS |
2643 | lib_smartcols], |
2644 | dependencies : lib_udev, | |
2645 | install : true) | |
2646 | if not is_disabler(exe) | |
2647 | exes += exe | |
53b37016 | 2648 | manadocs += ['misc-utils/lsblk.8.adoc'] |
38bb89ee | 2649 | bashcompletions += ['lsblk'] |
d4c880d5 ZJS |
2650 | endif |
2651 | ||
e3dedb01 MY |
2652 | mq_libs = [] |
2653 | mq_libs += cc.find_library('rt', required : true) | |
2654 | ||
ee194909 KZ |
2655 | exe = executable( |
2656 | 'lsfd', | |
2657 | lsfd_sources, | |
2658 | include_directories : includes, | |
2659 | link_with : [lib_common, | |
2660 | lib_smartcols], | |
e3dedb01 | 2661 | dependencies : mq_libs, |
ee194909 KZ |
2662 | install_dir : usrbin_exec_dir, |
2663 | install : true) | |
2664 | if not is_disabler(exe) | |
2665 | exes += exe | |
2666 | manadocs += ['misc-utils/lsfd.1.adoc'] | |
2667 | endif | |
2668 | ||
d4c880d5 ZJS |
2669 | exe = executable( |
2670 | 'uuidgen', | |
2671 | uuidgen_sources, | |
2672 | include_directories : includes, | |
06d3a851 KZ |
2673 | link_with : [lib_common, |
2674 | lib_uuid], | |
d4c880d5 ZJS |
2675 | install_dir : usrbin_exec_dir, |
2676 | install : true) | |
2677 | if not is_disabler(exe) | |
2678 | exes += exe | |
53b37016 | 2679 | manadocs += ['misc-utils/uuidgen.1.adoc'] |
38bb89ee | 2680 | bashcompletions += ['uuidgen'] |
d4c880d5 ZJS |
2681 | endif |
2682 | ||
2683 | exe = executable( | |
2684 | 'uuidparse', | |
2685 | uuidparse_sources, | |
2686 | include_directories : includes, | |
2687 | link_with : [lib_common, | |
2688 | lib_uuid, | |
2689 | lib_smartcols], | |
2690 | install_dir : usrbin_exec_dir, | |
2691 | install : true) | |
2692 | if not is_disabler(exe) | |
2693 | exes += exe | |
53b37016 | 2694 | manadocs += ['misc-utils/uuidparse.1.adoc'] |
38bb89ee | 2695 | bashcompletions += ['uuidparse'] |
d4c880d5 ZJS |
2696 | endif |
2697 | ||
2698 | opt = build_uuidd | |
2699 | exe = executable( | |
2700 | 'uuidd', | |
2701 | uuidd_sources, | |
2702 | include_directories : includes, | |
2703 | link_with : [lib_common, | |
2704 | lib_uuid], | |
2705 | dependencies : [realtime_libs, | |
2706 | lib_systemd], | |
2707 | install_dir : usrsbin_exec_dir, | |
2708 | install : opt, | |
2709 | build_by_default : opt) | |
2710 | exe2 = executable( | |
2711 | 'test_uuidd', | |
2712 | test_uuidd_sources, | |
2713 | include_directories : includes, | |
2714 | link_with : [lib_common, | |
2715 | lib_uuid], | |
2716 | dependencies : thread_libs, | |
ba30b89c | 2717 | build_by_default : opt and program_tests) |
d4c880d5 ZJS |
2718 | if not is_disabler(exe) |
2719 | exes += [exe, exe2] | |
53b37016 | 2720 | manadocs += ['misc-utils/uuidd.8.adoc'] |
38bb89ee | 2721 | bashcompletions += ['uuidd'] |
d4c880d5 ZJS |
2722 | endif |
2723 | ||
2724 | opt = build_libblkid | |
2725 | exe = executable( | |
2726 | 'blkid', | |
2727 | blkid_sources, | |
2728 | include_directories : includes, | |
2729 | link_with : [lib_common, | |
2730 | lib_blkid], | |
2731 | install_dir : sbindir, | |
2732 | install : opt, | |
2733 | build_by_default : opt) | |
2734 | if opt and not is_disabler(exe) | |
2735 | exes += exe | |
53b37016 | 2736 | manadocs += ['misc-utils/blkid.8.adoc'] |
38bb89ee | 2737 | bashcompletions += ['blkid'] |
d4c880d5 ZJS |
2738 | endif |
2739 | ||
69939195 ZJS |
2740 | opt = opt and 'blkid' in static_programs |
2741 | exe = executable( | |
2742 | 'blkid.static', | |
2743 | blkid_sources, | |
2744 | include_directories : includes, | |
2745 | link_with : [lib_common, | |
2746 | lib_blkid_static], | |
2747 | install_dir : sbindir, | |
2748 | install : opt, | |
2749 | build_by_default : opt) | |
2750 | if opt and not is_disabler(exe) | |
2751 | exes += exe | |
2752 | endif | |
d4c880d5 ZJS |
2753 | |
2754 | exe = executable( | |
2755 | 'sample-mkfs', | |
2756 | 'libblkid/samples/mkfs.c', | |
2757 | include_directories : includes, | |
2758 | link_with : lib_blkid) | |
2759 | if not is_disabler(exe) | |
2760 | exes += exe | |
2761 | endif | |
2762 | ||
2763 | exe = executable( | |
2764 | 'sample-partitions', | |
2765 | 'libblkid/samples/partitions.c', | |
2766 | include_directories : includes, | |
2767 | link_with : lib_blkid) | |
2768 | if not is_disabler(exe) | |
2769 | exes += exe | |
2770 | endif | |
2771 | ||
2772 | exe = executable( | |
2773 | 'sample-superblocks', | |
2774 | 'libblkid/samples/superblocks.c', | |
2775 | include_directories : includes, | |
2776 | link_with : lib_blkid) | |
2777 | if not is_disabler(exe) | |
2778 | exes += exe | |
2779 | endif | |
2780 | ||
2781 | exe = executable( | |
2782 | 'sample-topology', | |
2783 | 'libblkid/samples/topology.c', | |
2784 | include_directories : includes, | |
2785 | link_with : lib_blkid) | |
2786 | if not is_disabler(exe) | |
2787 | exes += exe | |
2788 | endif | |
2789 | ||
97e673a0 TW |
2790 | exe = executable( |
2791 | 'test_blkid_fuzz_sample', | |
2792 | 'libblkid/src/fuzz.c', | |
2793 | include_directories: includes, | |
ba30b89c | 2794 | link_with: lib_blkid, |
2795 | build_by_default: program_tests) | |
97e673a0 TW |
2796 | if not is_disabler(exe) |
2797 | exes += exe | |
2798 | endif | |
2799 | ||
d4c880d5 ZJS |
2800 | ############################################################ |
2801 | ||
2802 | exe = executable( | |
2803 | 'findfs', | |
2804 | findfs_sources, | |
2805 | include_directories : includes, | |
2806 | link_with : [lib_blkid], | |
2807 | install_dir : sbindir, | |
2808 | install : true) | |
2809 | if not is_disabler(exe) | |
2810 | exes += exe | |
53b37016 | 2811 | manadocs += ['misc-utils/findfs.8.adoc'] |
38bb89ee | 2812 | bashcompletions += ['findfs'] |
d4c880d5 ZJS |
2813 | endif |
2814 | ||
2815 | exe = executable( | |
2816 | 'wipefs', | |
2817 | wipefs_sources, | |
2818 | include_directories : includes, | |
2819 | link_with : [lib_common, | |
2820 | lib_blkid, | |
2821 | lib_smartcols], | |
2822 | install_dir : sbindir, | |
2823 | install : true) | |
2824 | if not is_disabler(exe) | |
2825 | exes += exe | |
53b37016 | 2826 | manadocs += ['misc-utils/wipefs.8.adoc'] |
38bb89ee | 2827 | bashcompletions += ['wipefs'] |
d4c880d5 ZJS |
2828 | endif |
2829 | ||
2830 | exe = executable( | |
2831 | 'findmnt', | |
2832 | findmnt_sources, | |
2833 | include_directories : includes, | |
2834 | link_with : [lib_common, | |
2835 | lib_blkid, | |
2836 | lib_mount, | |
2837 | lib_smartcols], | |
2838 | dependencies : [lib_udev], | |
2839 | install : true) | |
2840 | if not is_disabler(exe) | |
2841 | exes += exe | |
53b37016 | 2842 | manadocs += ['misc-utils/findmnt.8.adoc'] |
38bb89ee | 2843 | bashcompletions += ['findmnt'] |
d4c880d5 ZJS |
2844 | endif |
2845 | ||
2846 | exe = executable( | |
2847 | 'kill', | |
2848 | kill_sources, | |
2849 | include_directories : includes, | |
2850 | link_with : [lib_common], | |
2851 | install : true) | |
2852 | if not is_disabler(exe) | |
2853 | exes += exe | |
53b37016 | 2854 | manadocs += ['misc-utils/kill.1.adoc'] |
d4c880d5 ZJS |
2855 | endif |
2856 | ||
2857 | opt = not get_option('build-rename').disabled() | |
2858 | exe = executable( | |
2859 | 'rename', | |
2860 | rename_sources, | |
2861 | include_directories : includes, | |
2862 | install_dir : usrbin_exec_dir, | |
2863 | install : opt, | |
2864 | build_by_default : opt) | |
2865 | if opt and not is_disabler(exe) | |
2866 | exes += exe | |
53b37016 | 2867 | manadocs += ['misc-utils/rename.1.adoc'] |
38bb89ee | 2868 | bashcompletions += ['rename'] |
d4c880d5 ZJS |
2869 | endif |
2870 | ||
2871 | exe = executable( | |
2872 | 'getopt', | |
2873 | getopt_sources, | |
2874 | include_directories : includes, | |
308a0979 | 2875 | link_with : [lib_common], |
d4c880d5 ZJS |
2876 | install_dir : usrbin_exec_dir, |
2877 | install : true) | |
2878 | exes += exe | |
53b37016 | 2879 | manadocs += ['misc-utils/getopt.1.adoc'] |
38bb89ee | 2880 | bashcompletions += ['getopt'] |
d4c880d5 ZJS |
2881 | |
2882 | exe = executable( | |
2883 | 'fincore', | |
2884 | fincore_sources, | |
2885 | include_directories : includes, | |
2886 | link_with : [lib_common, | |
2887 | lib_smartcols], | |
2888 | install_dir : usrbin_exec_dir, | |
2889 | install : true) | |
2890 | if not is_disabler(exe) | |
2891 | exes += exe | |
53b37016 | 2892 | manadocs += ['misc-utils/fincore.1.adoc'] |
38bb89ee | 2893 | bashcompletions += ['fincore'] |
d4c880d5 ZJS |
2894 | endif |
2895 | ||
2896 | exe = executable( | |
2897 | 'hardlink', | |
2898 | hardlink_sources, | |
2899 | include_directories : includes, | |
2900 | link_with : [lib_common], | |
d4c880d5 ZJS |
2901 | install_dir : usrbin_exec_dir, |
2902 | install : true) | |
2903 | if not is_disabler(exe) | |
2904 | exes += exe | |
53b37016 | 2905 | manadocs += ['misc-utils/hardlink.1.adoc'] |
38bb89ee | 2906 | bashcompletions += ['hardlink'] |
d4c880d5 ZJS |
2907 | endif |
2908 | ||
c221578e NS |
2909 | opt = not get_option('build-pipesz').disabled() |
2910 | exe = executable( | |
2911 | 'pipesz', | |
2912 | pipesz_sources, | |
2913 | include_directories : includes, | |
2914 | link_with : [lib_common], | |
2915 | install_dir : usrbin_exec_dir, | |
2916 | install : true) | |
2917 | if opt and not is_disabler(exe) | |
2918 | exes += exe | |
62c27bd0 | 2919 | manadocs += ['misc-utils/pipesz.1.adoc'] |
80af57ed | 2920 | bashcompletions += ['pipesz'] |
c221578e NS |
2921 | endif |
2922 | ||
d4c880d5 ZJS |
2923 | exe = executable( |
2924 | 'test_cal', | |
2925 | cal_sources, | |
2926 | include_directories : includes, | |
2927 | c_args : '-DTEST_CAL', | |
2928 | link_with : [lib_common, | |
2929 | lib_tcolors], | |
ba30b89c | 2930 | dependencies : [curses_libs], |
2931 | build_by_default: program_tests) | |
d4c880d5 ZJS |
2932 | if not is_disabler(exe) |
2933 | exes += exe | |
2934 | endif | |
2935 | ||
64bc8ab5 MY |
2936 | exe = executable( |
2937 | 'fadvise', | |
2938 | fadvise_sources, | |
2939 | include_directories : includes, | |
2940 | link_with : [lib_common], | |
2941 | install_dir : usrbin_exec_dir, | |
2942 | install : true) | |
2943 | if not is_disabler(exe) | |
2944 | exes += exe | |
2945 | manadocs += ['misc-utils/fadvise.1.adoc'] | |
2946 | bashcompletions += ['fadvise'] | |
2947 | endif | |
2948 | ||
941e1d55 | 2949 | if LINUX and conf.get('HAVE_PIDFD_OPEN').to_string() == '1' |
334939a1 ZJS |
2950 | exe = executable( |
2951 | 'waitpid', | |
2952 | waitpid_sources, | |
2953 | include_directories : includes, | |
2954 | link_with : [lib_common], | |
2955 | install_dir : usrbin_exec_dir, | |
2956 | install : true) | |
2957 | if not is_disabler(exe) | |
2958 | exes += exe | |
2959 | manadocs += ['misc-utils/waitpid.1.adoc'] | |
2960 | bashcompletions += ['waitpid'] | |
2961 | endif | |
550d32c4 TW |
2962 | endif |
2963 | ||
69e542bd TW |
2964 | syscalls_h = custom_target('syscalls.h', |
2965 | input : 'tools/all_syscalls', | |
2966 | output : 'syscalls.h', | |
922d025a | 2967 | command : ['tools/all_syscalls', cc.cmd_array()] |
69e542bd TW |
2968 | ) |
2969 | ||
3e0bbb12 TW |
2970 | if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE') |
2971 | exe = executable( | |
2972 | 'enosys', | |
2973 | 'misc-utils/enosys.c', syscalls_h, | |
2974 | include_directories : includes, | |
2975 | link_with : [lib_common], | |
2976 | install_dir : usrbin_exec_dir, | |
2977 | install : true) | |
2978 | if not is_disabler(exe) | |
2979 | exes += exe | |
2980 | manadocs += ['misc-utils/enosys.1.adoc'] | |
2981 | bashcompletions += ['enosys'] | |
2982 | endif | |
cba52cc1 TW |
2983 | endif |
2984 | ||
e9ddea79 TW |
2985 | exe = executable( |
2986 | 'lsclocks', | |
2987 | lsclocks_sources, | |
2988 | include_directories : includes, | |
2989 | link_with : [lib_common, lib_smartcols], | |
2990 | install_dir : usrbin_exec_dir, | |
2991 | install : true) | |
2992 | if not is_disabler(exe) | |
2993 | exes += exe | |
2994 | manadocs += ['misc-utils/lsclocks.1.adoc'] | |
2995 | bashcompletions += ['lsclocks'] | |
2996 | endif | |
2997 | ||
cd094a05 MY |
2998 | if conf.get('HAVE_RENAMEAT2').to_string() == '1' |
2999 | exe = executable( | |
3000 | 'exch', | |
3001 | exch_sources, | |
3002 | include_directories : includes, | |
3003 | link_with : [lib_common], | |
3004 | install_dir : usrbin_exec_dir, | |
3005 | install : true) | |
3006 | if not is_disabler(exe) | |
3007 | exes += exe | |
3008 | manadocs += ['misc-utils/exch.1.adoc'] | |
3009 | bashcompletions += ['exch'] | |
3010 | endif | |
3011 | endif | |
3012 | ||
d4c880d5 ZJS |
3013 | ############################################################ |
3014 | ||
3015 | opt = not get_option('build-schedutils').disabled() | |
3016 | exe = executable( | |
3017 | 'chrt', | |
3018 | 'schedutils/chrt.c', | |
3019 | include_directories : includes, | |
3020 | link_with : lib_common, | |
3021 | install_dir : usrbin_exec_dir, | |
3022 | install : opt, | |
3023 | build_by_default : opt) | |
3024 | ||
3025 | exe2 = executable( | |
3026 | 'ionice', | |
3027 | 'schedutils/ionice.c', | |
3028 | include_directories : includes, | |
3029 | link_with : lib_common, | |
3030 | install_dir : usrbin_exec_dir, | |
3031 | install : opt, | |
3032 | build_by_default : opt) | |
3033 | ||
3034 | exe3 = executable( | |
3035 | 'taskset', | |
3036 | 'schedutils/taskset.c', | |
3037 | include_directories : includes, | |
3038 | link_with : lib_common, | |
3039 | install_dir : usrbin_exec_dir, | |
3040 | install : opt, | |
3041 | build_by_default : opt) | |
3042 | ||
6e92db54 KZ |
3043 | exe4 = executable( |
3044 | 'uclampset', | |
3045 | 'schedutils/uclampset.c', | |
3046 | include_directories : includes, | |
3047 | link_with : lib_common, | |
3048 | install_dir : usrbin_exec_dir, | |
3049 | install : opt, | |
3050 | build_by_default : opt) | |
3051 | ||
d4c880d5 | 3052 | if opt and not is_disabler(exe) |
6e92db54 | 3053 | exes += [exe, exe2, exe3, exe4] |
53b37016 KZ |
3054 | manadocs += ['schedutils/chrt.1.adoc', |
3055 | 'schedutils/ionice.1.adoc', | |
3056 | 'schedutils/taskset.1.adoc', | |
3057 | 'schedutils/uclampset.1.adoc'] | |
38bb89ee | 3058 | bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset'] |
d4c880d5 ZJS |
3059 | endif |
3060 | ||
3061 | ############################################################ | |
3062 | ||
3063 | # TODO: when autotools compat is not needed, s/_/-/g in file names? | |
3064 | ||
3065 | exe = executable( | |
3066 | 'test_ttyutils', | |
3067 | 'lib/ttyutils.c', | |
3068 | c_args : ['-DTEST_PROGRAM_TTYUTILS'], | |
3069 | include_directories : dir_include, | |
ba30b89c | 3070 | link_with : lib_common, |
3071 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3072 | exes += exe |
3073 | ||
3074 | exe = executable( | |
3075 | 'test_blkdev', | |
3076 | 'lib/blkdev.c', | |
3077 | c_args : ['-DTEST_PROGRAM_BLKDEV'], | |
3078 | include_directories : dir_include, | |
ba30b89c | 3079 | link_with : lib_common, |
3080 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3081 | exes += exe |
3082 | ||
3083 | exe = executable( | |
3084 | 'test_ismounted', | |
3085 | 'lib/ismounted.c', | |
3086 | c_args : ['-DTEST_PROGRAM_ISMOUNTED'], | |
3087 | include_directories : dir_include, | |
ba30b89c | 3088 | link_with : lib_common, |
3089 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3090 | exes += exe |
3091 | ||
3092 | exe = executable( | |
3093 | 'test_mangle', | |
3094 | 'lib/mangle.c', | |
3095 | c_args : ['-DTEST_PROGRAM_MANGLE'], | |
ba30b89c | 3096 | include_directories : dir_include, |
3097 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3098 | exes += exe |
3099 | ||
3100 | exe = executable( | |
3101 | 'test_strutils', | |
3102 | 'lib/strutils.c', | |
3103 | c_args : ['-DTEST_PROGRAM_STRUTILS'], | |
ba30b89c | 3104 | include_directories : dir_include, |
3105 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3106 | exes += exe |
3107 | ||
3108 | exe = executable( | |
3109 | 'test_colors', | |
3110 | 'lib/colors.c', | |
3111 | 'lib/color-names.c', | |
3112 | c_args : ['-DTEST_PROGRAM_COLORS'], | |
3113 | include_directories : dir_include, | |
ba30b89c | 3114 | link_with : [lib_common, lib_tcolors], |
3115 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3116 | exes += exe |
3117 | ||
3118 | exe = executable( | |
3119 | 'test_randutils', | |
3120 | 'lib/randutils.c', | |
3121 | c_args : ['-DTEST_PROGRAM_RANDUTILS'], | |
ba30b89c | 3122 | include_directories : dir_include, |
3123 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3124 | exes += exe |
3125 | ||
941e1d55 TW |
3126 | if conf.get('HAVE_OPENAT').to_string() == '1' \ |
3127 | and conf.get('HAVE_DIRFD').to_string() == '1' | |
d6418774 ZJS |
3128 | exe = executable( |
3129 | 'test_procfs', | |
3130 | 'lib/procfs.c', | |
3131 | c_args : ['-DTEST_PROGRAM_PROCFS'], | |
3132 | include_directories : dir_include, | |
ba30b89c | 3133 | link_with : lib_common, |
3134 | build_by_default: program_tests) | |
d6418774 | 3135 | exes += exe |
d4c880d5 | 3136 | |
d6418774 ZJS |
3137 | exe = executable( |
3138 | 'test_path', | |
3139 | 'lib/path.c', | |
3140 | 'lib/fileutils.c', | |
3141 | have_cpu_set_t ? 'lib/cpuset.c' : [], | |
3142 | c_args : ['-DTEST_PROGRAM_PATH'], | |
3143 | include_directories : dir_include, | |
ba30b89c | 3144 | link_with : lib_common, |
3145 | build_by_default: program_tests) | |
d6418774 ZJS |
3146 | exes += exe |
3147 | endif | |
d4c880d5 | 3148 | |
941e1d55 | 3149 | if conf.get('HAVE_PTY').to_string() == '1' |
44475360 ZJS |
3150 | exe = executable( |
3151 | 'test_pty', | |
3152 | pty_session_c, | |
3153 | monotonic_c, | |
3154 | c_args : ['-DTEST_PROGRAM_PTY'], | |
3155 | include_directories : dir_include, | |
3156 | link_with : [lib_common], | |
3157 | dependencies : [lib_m, | |
3158 | realtime_libs, | |
ba30b89c | 3159 | lib_util], |
3160 | build_by_default: program_tests) | |
44475360 ZJS |
3161 | exes += exe |
3162 | endif | |
d4c880d5 | 3163 | |
d6418774 ZJS |
3164 | if LINUX |
3165 | exe = executable( | |
3166 | 'test_cpuset', | |
3167 | 'lib/cpuset.c', | |
3168 | c_args : ['-DTEST_PROGRAM_CPUSET'], | |
ba30b89c | 3169 | include_directories : dir_include, |
3170 | build_by_default: program_tests) | |
d6418774 ZJS |
3171 | exes += exe |
3172 | endif | |
d4c880d5 ZJS |
3173 | |
3174 | exe = executable( | |
3175 | 'test_sysfs', | |
3176 | 'lib/sysfs.c', | |
3177 | 'lib/path.c', | |
35d26ae8 | 3178 | 'lib/buffer.c', |
fb8493fd | 3179 | 'lib/mbsalign.c', |
d4c880d5 ZJS |
3180 | 'lib/fileutils.c', |
3181 | have_cpu_set_t ? 'lib/cpuset.c' : [], | |
3182 | c_args : ['-DTEST_PROGRAM_SYSFS'], | |
ba30b89c | 3183 | include_directories : dir_include, |
3184 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3185 | exes += exe |
3186 | ||
3187 | exe = executable( | |
3188 | 'test_pager', | |
3189 | 'lib/pager.c', | |
3190 | c_args : ['-DTEST_PROGRAM_PAGER'], | |
ba30b89c | 3191 | include_directories : dir_include, |
3192 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3193 | exes += exe |
3194 | ||
3195 | exe = executable( | |
3196 | 'test_linux_version', | |
3197 | 'lib/linux_version.c', | |
3198 | c_args : ['-DTEST_PROGRAM_LINUXVERSION'], | |
ba30b89c | 3199 | include_directories : dir_include, |
3200 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3201 | exes += exe |
3202 | ||
3203 | exe = executable( | |
3204 | 'test_fileutils', | |
3205 | 'lib/fileutils.c', | |
3206 | c_args : ['-DTEST_PROGRAM_FILEUTILS'], | |
ba30b89c | 3207 | include_directories : dir_include, |
3208 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3209 | exes += exe |
3210 | ||
3211 | exe = executable( | |
3212 | 'test_canonicalize', | |
3213 | 'lib/canonicalize.c', | |
3214 | c_args : ['-DTEST_PROGRAM_CANONICALIZE'], | |
ba30b89c | 3215 | include_directories : dir_include, |
3216 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3217 | exes += exe |
3218 | ||
3219 | exe = executable( | |
3220 | 'test_timeutils', | |
3221 | 'lib/timeutils.c', | |
3222 | 'lib/strutils.c', | |
3223 | c_args : ['-DTEST_PROGRAM_TIMEUTILS'], | |
ba30b89c | 3224 | include_directories : dir_include, |
3225 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3226 | exes += exe |
3227 | ||
3228 | exe = executable( | |
3229 | 'test_pwdutils', | |
3230 | 'lib/pwdutils.c', | |
3231 | c_args : ['-DTEST_PROGRAM'], | |
3232 | include_directories : dir_include, | |
ba30b89c | 3233 | link_with : lib_common, |
3234 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3235 | exes += exe |
3236 | ||
866d922b KZ |
3237 | exe = executable( |
3238 | 'test_logindefs', | |
3239 | 'lib/logindefs.c', | |
3240 | c_args : ['-DTEST_PROGRAM'], | |
3241 | include_directories : dir_include, | |
ba30b89c | 3242 | link_with : [lib_common, logindefs_c], |
3243 | build_by_default: program_tests) | |
866d922b KZ |
3244 | exes += exe |
3245 | ||
3246 | ||
d4c880d5 ZJS |
3247 | ############################################################ |
3248 | ||
3249 | exe = executable( | |
3250 | 'test_uuid_parser', | |
3251 | 'libuuid/src/test_uuid.c', | |
3252 | include_directories : [dir_include, dir_libuuid], | |
3253 | link_with : lib_uuid, | |
ba30b89c | 3254 | dependencies : socket_libs, |
3255 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3256 | if not is_disabler(exe) |
3257 | exes += exe | |
3258 | endif | |
3259 | ||
3260 | ############################################################ | |
3261 | ||
2a472ae8 | 3262 | libfdisk_tests_cflags = ['-DTEST_PROGRAM'] |
69939195 | 3263 | libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid] |
d4c880d5 ZJS |
3264 | |
3265 | exe = executable( | |
3266 | 'test_fdisk_ask', | |
3267 | 'libfdisk/src/ask.c', | |
3268 | c_args : libfdisk_tests_cflags, | |
3269 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3270 | link_with : libfdisk_tests_ldadd, |
3271 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3272 | if not is_disabler(exe) |
3273 | exes += exe | |
3274 | endif | |
3275 | ||
3276 | exe = executable( | |
3277 | 'test_fdisk_gpt', | |
3278 | 'libfdisk/src/gpt.c', | |
3279 | c_args : libfdisk_tests_cflags, | |
3280 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3281 | link_with : libfdisk_tests_ldadd, |
3282 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3283 | if not is_disabler(exe) |
3284 | exes += exe | |
3285 | endif | |
3286 | ||
3287 | exe = executable( | |
3288 | 'test_fdisk_utils', | |
3289 | 'libfdisk/src/utils.c', | |
3290 | c_args : libfdisk_tests_cflags, | |
3291 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3292 | link_with : libfdisk_tests_ldadd, |
3293 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3294 | if not is_disabler(exe) |
3295 | exes += exe | |
3296 | endif | |
3297 | ||
3298 | exe = executable( | |
3299 | 'test_fdisk_script', | |
3300 | 'libfdisk/src/script.c', | |
3301 | c_args : libfdisk_tests_cflags, | |
3302 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3303 | link_with : libfdisk_tests_ldadd, |
3304 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3305 | if not is_disabler(exe) |
3306 | exes += exe | |
3307 | endif | |
3308 | ||
3309 | exe = executable( | |
3310 | 'test_fdisk_version', | |
3311 | 'libfdisk/src/version.c', | |
3312 | c_args : libfdisk_tests_cflags, | |
3313 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3314 | link_with : libfdisk_tests_ldadd, |
3315 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3316 | if not is_disabler(exe) |
3317 | exes += exe | |
3318 | endif | |
3319 | ||
3320 | exe = executable( | |
3321 | 'test_fdisk_item', | |
3322 | 'libfdisk/src/item.c', | |
3323 | c_args : libfdisk_tests_cflags, | |
3324 | include_directories : lib_fdisk_includes, | |
ba30b89c | 3325 | link_with : libfdisk_tests_ldadd, |
3326 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3327 | if not is_disabler(exe) |
3328 | exes += exe | |
3329 | endif | |
3330 | ||
d4c880d5 ZJS |
3331 | sample_fdisk_ldadd = [lib_common, lib_fdisk] |
3332 | ||
3333 | exe = executable( | |
3334 | 'sample-fdisk-mkpart', | |
3335 | 'libfdisk/samples/mkpart.c', | |
d4c880d5 ZJS |
3336 | include_directories : lib_fdisk_includes, |
3337 | link_with : sample_fdisk_ldadd) | |
3338 | if not is_disabler(exe) | |
3339 | exes += exe | |
3340 | endif | |
3341 | ||
3342 | exe = executable( | |
3343 | 'sample-fdisk-mkpart-fullspec', | |
3344 | 'libfdisk/samples/mkpart-fullspec.c', | |
d4c880d5 ZJS |
3345 | include_directories : lib_fdisk_includes, |
3346 | link_with : sample_fdisk_ldadd) | |
3347 | if not is_disabler(exe) | |
3348 | exes += exe | |
3349 | endif | |
3350 | ||
3351 | ############################################################ | |
3352 | ||
a76299c1 TW |
3353 | exe = executable( |
3354 | 'test_cap', | |
3355 | 'tests/helpers/test_cap.c', | |
3356 | include_directories : includes, | |
3357 | dependencies : [lib_cap_ng], | |
3358 | build_by_default: program_tests) | |
512c91a6 TW |
3359 | if not is_disabler(exe) |
3360 | exes += exe | |
3361 | endif | |
a76299c1 | 3362 | |
d4c880d5 ZJS |
3363 | exe = executable( |
3364 | 'test_mbsencode', | |
3365 | 'tests/helpers/test_mbsencode.c', | |
3366 | include_directories : includes, | |
ba30b89c | 3367 | link_with : lib_common, |
3368 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3369 | exes += exe |
3370 | ||
3371 | exe = executable( | |
3372 | 'test_byteswap', | |
3373 | 'tests/helpers/test_byteswap.c', | |
ba30b89c | 3374 | include_directories : includes, |
3375 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3376 | exes += exe |
3377 | ||
3378 | exe = executable( | |
3379 | 'test_md5', | |
3380 | 'tests/helpers/test_md5.c', | |
3381 | md5_c, | |
ba30b89c | 3382 | include_directories : includes, |
3383 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3384 | exes += exe |
3385 | ||
3386 | exe = executable( | |
3387 | 'test_sha1', | |
3388 | 'tests/helpers/test_sha1.c', | |
3389 | sha1_c, | |
ba30b89c | 3390 | include_directories : includes, |
3391 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3392 | exes += exe |
3393 | ||
3394 | exe = executable( | |
3395 | 'test_pathnames', | |
3396 | 'tests/helpers/test_pathnames.c', | |
ba30b89c | 3397 | include_directories : includes, |
3398 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3399 | exes += exe |
3400 | ||
3401 | exe = executable( | |
3402 | 'test_strerror', | |
3403 | 'tests/helpers/test_strerror.c', | |
ba30b89c | 3404 | include_directories : includes, |
3405 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3406 | exes += exe |
3407 | ||
3408 | exe = executable( | |
3409 | 'test_sysinfo', | |
3410 | 'tests/helpers/test_sysinfo.c', | |
ba30b89c | 3411 | include_directories : includes, |
3412 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3413 | exes += exe |
3414 | ||
3415 | exe = executable( | |
3416 | 'test_sigreceive', | |
3417 | 'tests/helpers/test_sigreceive.c', | |
3418 | include_directories : includes, | |
ba30b89c | 3419 | link_with : lib_common, |
3420 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3421 | exes += exe |
3422 | ||
3423 | exe = executable( | |
3424 | 'test_tiocsti', | |
3425 | 'tests/helpers/test_tiocsti.c', | |
ba30b89c | 3426 | include_directories : includes, |
3427 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3428 | exes += exe |
3429 | ||
3430 | exe = executable( | |
3431 | 'test_uuid_namespace', | |
3432 | 'tests/helpers/test_uuid_namespace.c', | |
3433 | predefined_c, | |
3434 | unpack_c, | |
3435 | unparse_c, | |
ba30b89c | 3436 | include_directories : includes, |
3437 | build_by_default: program_tests) | |
d4c880d5 ZJS |
3438 | exes += exe |
3439 | ||
d6418774 ZJS |
3440 | if LINUX |
3441 | exe = executable( | |
3442 | 'test_mkfds', | |
3443 | 'tests/helpers/test_mkfds.c', | |
b2033a32 | 3444 | 'tests/helpers/test_mkfds.h', |
38ffd1e3 | 3445 | 'tests/helpers/test_mkfds_ppoll.c', |
d6418774 | 3446 | include_directories : includes, |
ba30b89c | 3447 | dependencies : mq_libs, |
3448 | build_by_default: program_tests) | |
d6418774 ZJS |
3449 | exes += exe |
3450 | endif | |
f7b41ef8 | 3451 | |
42900563 TW |
3452 | exe = executable( |
3453 | 'test_enosys', | |
3454 | 'tests/helpers/test_enosys.c', | |
ba30b89c | 3455 | include_directories : includes, |
3456 | build_by_default: program_tests) | |
42900563 TW |
3457 | exes += exe |
3458 | ||
d4c880d5 ZJS |
3459 | ############################################################ |
3460 | ||
941e1d55 | 3461 | if conf.get('HAVE_OPENAT').to_string() == '1' |
d6418774 ZJS |
3462 | exe = executable( |
3463 | 'sample-scols-tree', | |
3464 | 'libsmartcols/samples/tree.c', | |
3465 | include_directories : includes, | |
ba30b89c | 3466 | link_with : [lib_smartcols, lib_common], |
3467 | build_by_default: program_tests) | |
d6418774 ZJS |
3468 | if not is_disabler(exe) |
3469 | exes += exe | |
3470 | endif | |
d4c880d5 ZJS |
3471 | endif |
3472 | ||
3473 | exe = executable( | |
3474 | 'sample-scols-title', | |
3475 | 'libsmartcols/samples/title.c', | |
3476 | include_directories : includes, | |
3477 | link_with : [lib_smartcols, lib_common]) | |
3478 | if not is_disabler(exe) | |
3479 | exes += exe | |
3480 | endif | |
3481 | ||
3482 | exe = executable( | |
3483 | 'sample-scols-wrap', | |
3484 | 'libsmartcols/samples/wrap.c', | |
3485 | include_directories : includes, | |
3486 | link_with : [lib_smartcols, lib_common]) | |
3487 | if not is_disabler(exe) | |
3488 | exes += exe | |
3489 | endif | |
3490 | ||
3491 | exe = executable( | |
3492 | 'sample-scols-continuous', | |
3493 | 'libsmartcols/samples/continuous.c', | |
3494 | include_directories : includes, | |
3495 | link_with : [lib_smartcols, lib_common]) | |
3496 | if not is_disabler(exe) | |
3497 | exes += exe | |
3498 | endif | |
3499 | ||
be597292 TW |
3500 | exe = executable( |
3501 | 'sample-scols-continuous-json', | |
3502 | 'libsmartcols/samples/continuous-json.c', | |
3503 | include_directories : includes, | |
3504 | link_with : [lib_smartcols, lib_common]) | |
3505 | if not is_disabler(exe) | |
3506 | exes += exe | |
3507 | endif | |
3508 | ||
d4c880d5 ZJS |
3509 | exe = executable( |
3510 | 'sample-scols-maxout', | |
3511 | 'libsmartcols/samples/maxout.c', | |
3512 | include_directories : includes, | |
3513 | link_with : [lib_smartcols, lib_common]) | |
3514 | if not is_disabler(exe) | |
3515 | exes += exe | |
3516 | endif | |
3517 | ||
3518 | exe = executable( | |
3519 | 'sample-scols-fromfile', | |
3520 | 'libsmartcols/samples/fromfile.c', | |
3521 | include_directories : includes, | |
3522 | link_with : [lib_smartcols, lib_common]) | |
3523 | if not is_disabler(exe) | |
3524 | exes += exe | |
3525 | endif | |
3526 | ||
3527 | exe = executable( | |
3528 | 'sample-scols-grouping-simple', | |
3529 | 'libsmartcols/samples/grouping-simple.c', | |
3530 | include_directories : includes, | |
3531 | link_with : [lib_smartcols, lib_common]) | |
3532 | if not is_disabler(exe) | |
3533 | exes += exe | |
3534 | endif | |
3535 | ||
3536 | exe = executable( | |
3537 | 'sample-scols-grouping-overlay', | |
3538 | 'libsmartcols/samples/grouping-overlay.c', | |
3539 | include_directories : includes, | |
3540 | link_with : [lib_smartcols, lib_common]) | |
3541 | if not is_disabler(exe) | |
3542 | exes += exe | |
3543 | endif | |
3544 | ||
3545 | ############################################################ | |
3546 | ||
3547 | # Let the test runner know whether we're running under asan and export | |
3548 | # some paths. We use a file on disk so that it is possible to run the | |
3549 | # test scripts from commandline without setting any variables. | |
3550 | configure_file(output : 'meson.conf', | |
3551 | capture : true, | |
3552 | command : ['echo', | |
3553 | '''asan=@0@ | |
3554 | PYTHON=@1@ | |
3555 | '''.format(get_option('b_sanitize')=='address' ? 'yes' : '', | |
e2cd7446 | 3556 | python.full_path())]) |
d4c880d5 ZJS |
3557 | |
3558 | run_sh = find_program('tests/run.sh') | |
3559 | run_target( | |
3560 | 'check', | |
3561 | command : [run_sh, | |
3562 | '--srcdir=' + meson.current_source_dir(), | |
3563 | '--builddir=' + meson.current_build_dir(), | |
3564 | '--parallel', | |
3565 | '--nonroot'], | |
3566 | depends : exes) | |
53b37016 KZ |
3567 | |
3568 | ||
3569 | manadocs += ['lib/terminal-colors.d.5.adoc'] | |
3570 | manadocs += ['libblkid/libblkid.3.adoc'] | |
3571 | ||
3572 | if build_libuuid | |
3573 | manadocs += [ | |
3574 | 'libuuid/man/uuid.3.adoc', | |
3575 | 'libuuid/man/uuid_clear.3.adoc', | |
3576 | 'libuuid/man/uuid_compare.3.adoc', | |
3577 | 'libuuid/man/uuid_copy.3.adoc', | |
3578 | 'libuuid/man/uuid_generate.3.adoc', | |
3579 | 'libuuid/man/uuid_is_null.3.adoc', | |
3580 | 'libuuid/man/uuid_parse.3.adoc', | |
3581 | 'libuuid/man/uuid_time.3.adoc', | |
3582 | 'libuuid/man/uuid_unparse.3.adoc'] | |
38bb89ee TW |
3583 | manlinks += { |
3584 | 'uuid_generate_random.3': 'uuid_generate.3', | |
3585 | 'uuid_generate_time.3': 'uuid_generate.3', | |
3586 | 'uuid_generate_time_safe.3': 'uuid_generate.3', | |
3587 | } | |
53b37016 KZ |
3588 | endif |
3589 | ||
00b8a51f | 3590 | asciidoctor = find_program('asciidoctor', required : false) |
53b37016 KZ |
3591 | if asciidoctor.found() |
3592 | foreach adoc : manadocs | |
3593 | name = adoc.split('/')[-1] | |
3594 | page = name.split('.adoc')[0] | |
3595 | section = page.split('.')[-1] | |
3596 | mandirn = join_paths(mandir, 'man' + section) | |
3597 | input = adoc | |
3598 | ||
3599 | custom_target( | |
3600 | page, | |
3601 | command : [ asciidoctor, | |
3602 | '-b', 'manpage', | |
3603 | '-a', 'VERSION=' + meson.project_version(), | |
38bb89ee | 3604 | '-a', 'release-version=' + meson.project_version(), |
53b37016 | 3605 | '-a', 'ADJTIME_PATH=/etc/adjtime', |
38bb89ee | 3606 | '-a', 'package-docdir=' + docdir, |
53b37016 KZ |
3607 | '--base-dir=' + meson.current_source_dir(), |
3608 | '--destination-dir=' + meson.current_build_dir(), | |
adcab835 TW |
3609 | '--load-path', '@SOURCE_ROOT@/tools', |
3610 | '--require', 'asciidoctor-includetracker', | |
53b37016 KZ |
3611 | '@INPUT@'], |
3612 | input : input, | |
3613 | output : [page], | |
adcab835 | 3614 | depfile : page + '.deps', |
53b37016 KZ |
3615 | install: true, |
3616 | install_dir : mandirn) | |
3617 | endforeach | |
38bb89ee TW |
3618 | |
3619 | foreach link_name, target : manlinks | |
3620 | link_section = link_name.split('.')[-1] | |
3621 | target_section = target.split('.')[-1] | |
3622 | meson.add_install_script(meson_make_manpage_stub, | |
3623 | join_paths('man' + target_section, target), | |
3624 | join_paths(mandir, 'man' + link_section, link_name)) | |
3625 | endforeach | |
3626 | endif | |
3627 | ||
3628 | if bash_completion.found() | |
3629 | foreach completion : bashcompletions | |
3630 | install_data( | |
3631 | join_paths('bash-completion', completion), | |
caa85688 | 3632 | install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir') |
38bb89ee TW |
3633 | ) |
3634 | endforeach | |
aa519054 KZ |
3635 | foreach link_name, target : bashcompletionslinks |
3636 | meson.add_install_script(meson_make_symlink, | |
3637 | target, | |
caa85688 | 3638 | join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name)) |
aa519054 | 3639 | endforeach |
53b37016 | 3640 | endif |