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