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