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