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