1 project('util-linux', 'c',
2 version : run_command('tools/git-version-gen', check: true).stdout(),
3 meson_version: '>=0.53.0',
6 pkgconfig = import('pkgconfig')
8 libblkid_version = '1.1.0'
9 libblkid_date = '01-Jun-2021'
10 libuuid_version = '1.3.0'
11 libmount_version = '1.1.0'
12 libsmartcols_version = '1.1.0'
13 libfdisk_version = '1.1.0'
15 prefixdir = get_option('prefix')
16 if not prefixdir.startswith('/')
17 error('Prefix is not absolute: "@0@"'.format(prefixdir))
19 bindir = join_paths(prefixdir, get_option('bindir'))
20 sbindir = join_paths(prefixdir, get_option('sbindir'))
21 sysconfstaticdir = join_paths(prefixdir, 'lib')
22 docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux')
23 mandir = join_paths(prefixdir, get_option('mandir'))
25 execprefixdir = prefixdir
26 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
27 usrbin_exec_dir = join_paths(execprefixdir, bindir)
28 usrsbin_exec_dir = join_paths(execprefixdir, sbindir)
29 bash_completion = dependency('bash-completion', required : get_option('build-bash-completion'))
31 vendordir = get_option('vendordir')
33 add_project_arguments('-D_GNU_SOURCE', language : 'c')
35 cc = meson.get_compiler('c')
37 conf = configuration_data()
38 conf.set_quoted('PACKAGE', meson.project_name())
39 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
40 package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version())
41 conf.set_quoted('PACKAGE_STRING', package_string)
43 codes = [''' {print $1} ''',
44 ''' {sub("-.*","",$2); print $2} ''',
45 ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} ''']
48 res = run_command('bash', '-c',
49 '''echo '@0@' | awk -F. '@1@' '''.format(
50 meson.project_version(), code), check: true)
51 pc_version += res.stdout().strip()
53 pc_version = '.'.join(pc_version)
55 conf.set_quoted('LIBBLKID_VERSION', libblkid_version)
56 conf.set_quoted('LIBBLKID_DATE', libblkid_date)
58 conf.set('bindir', bindir)
59 conf.set('sbindir', sbindir)
60 conf.set('runstatedir', runstatedir)
61 conf.set('sysconfdir', sysconfdir)
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 :(
69 conf.set_quoted('_PATH_VENDORDIR', vendordir)
70 conf.set('USE_VENDORDIR', vendordir == '' ? false : 1)
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')
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')
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)
84 build_libmount = not get_option('build-libmount').disabled()
85 conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false)
86 conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1)
87 conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false)
88 summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components')
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')
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')
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')
102 static_programs = get_option('static-programs')
103 need_static_libs = static_programs.length() > 0 # a rough estimate...
104 summary('static programs', static_programs)
106 LINUX = host_machine.system() in ['linux']
107 BSD = host_machine.system() in ['dragonfly', 'freebsd', 'netbsd', 'openbsd']
109 ############################################################
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')
131 if get_option('ncurses').enabled() and get_option('widechar').enabled()
132 error('widechar support is incompatible with non-wide ncurses')
134 conf.set('HAVE_WIDECHAR', have ? 1 : false)
172 linux/net_namespace.h
215 lib_m = cc.find_library('m')
217 lib_tinfo = dependency(
219 required : get_option('tinfo'))
221 lib_ncursesw = dependency(
223 required : get_option('ncursesw'))
224 if lib_ncursesw.found()
225 headers += ['ncursesw/ncurses.h',
229 lib_ncurses = disabler()
231 lib_ncurses = dependency(
233 required : get_option('ncurses'))
234 headers += ['ncurses.h',
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())
242 lib_slang = dependency(
244 required : get_option('slang'))
246 headers += ['slang.h',
251 conf.set('HAVE_SLANG', lib_slang.found())
253 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
254 if curses_libs.found()
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)
265 required : get_option('zlib'))
267 lib_readline = dependency(
269 required : get_option('readline'))
270 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
272 lib_readline_static = dependency(
275 required : need_static_libs ? get_option('readline') : disabler())
277 if meson.version().version_compare('>= 0.59.0')
278 lib_intl = dependency(
280 required : get_option('nls'))
281 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
283 if get_option('nls').enabled()
284 error('nls is not supported with meson before 0.59.0')
286 lib_intl = dependency('', required : false)
289 lib_user = dependency(
292 required : get_option('libuser'))
293 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
295 lib_util = cc.find_library(
297 required : get_option('libutil'))
298 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
300 lib_utempter = cc.find_library(
302 required : get_option('libutempter'))
303 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
305 systemd = dependency(
307 required : get_option('systemd'))
309 lib_systemd = dependency(
311 required : get_option('systemd'))
312 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
314 lib_udev = dependency(
316 required : get_option('systemd'))
317 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
319 lib_crypt = cc.find_library('crypt')
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'))
325 if not lib_pam.found()
326 lib_pam = cc.find_library('pam', required : get_option('build-su'))
328 if not lib_pam.found()
329 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
332 lib_pam_misc = cc.find_library('pam_misc')
333 lib_pam = [lib_pam, lib_pam_misc]
335 lib_pam_misc = declare_dependency()
338 lib_cryptsetup = dependency(
340 required : get_option('cryptsetup'))
341 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
343 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
344 if meson.version().version_compare('>= 0.62.0')
345 lib_dl = dependency('dl')
347 lib_dl = cc.find_library('dl')
349 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
350 summary('cryptsetup support (dlopen)',
352 section : 'components')
354 summary('cryptsetup support',
355 lib_cryptsetup.found() ? 'enabled' : 'disabled',
356 section : 'components')
359 have = cc.has_function(
360 'crypt_activate_by_signed_key',
361 dependencies : lib_cryptsetup)
362 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
364 lib_cap_ng = dependency(
366 required : get_option('build-setpriv'))
368 lib_selinux = dependency(
371 required : get_option('selinux'))
372 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
374 lib_magic = dependency(
376 required : get_option('magic'))
377 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
379 lib_econf = dependency(
381 required : get_option('econf'))
382 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
384 lib_audit = dependency(
386 required : get_option('audit'))
387 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
389 conf.set('HAVE_SMACK', not get_option('smack').disabled())
391 foreach header : headers
392 have = cc.has_header(header)
393 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
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)
402 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
407 have = cc.has_header(header,
409 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
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
415 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
416 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
418 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
419 conf.set10('HAVE_ENVIRON_DECL', have)
421 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
422 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
424 have = cc.has_function('strsignal')
425 conf.set10('HAVE_STRSIGNAL_DECL', have)
427 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
428 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
430 have = cc.compiles('''
431 #define _GNU_SOURCE 1
432 #include <langinfo.h>
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);
450 name : 'langinfo.h defines ALTMON_x constants')
451 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
453 have = cc.compiles('''
454 #define _GNU_SOURCE 1
455 #include <langinfo.h>
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);
473 name : 'langinfo.h defines _NL_ABALTMON_x constants')
474 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
567 have = cc.has_function(func)
568 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
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)
574 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
575 conf.set('AGETTY_RELOAD', have ? 1 : false)
577 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
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)
585 have_ddfd = cc.has_member('DIR', 'dd_fd',
587 #include <sys/types.h>
590 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
592 have = cc.has_member('struct tm', 'tm_gmtoff',
597 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
601 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
602 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
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)
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)
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)
617 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
618 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
623 extern char *tzname[];
626 return tzname ? 0 : 1;
628 '''.format(have ? 1 : 0)
629 have = cc.compiles(code, name : 'using tzname[]')
630 conf.set('HAVE_TZNAME', have ? 1 : false)
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)
638 error('socket() function not available')
643 have = cc.has_function('clock_gettime')
645 realtime_libs += cc.find_library('rt', required : true)
646 have = cc.has_function('clock_gettime',
647 dependencies : realtime_libs)
649 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
651 thread_libs = dependency('threads')
653 have = cc.has_function('timer_create')
655 realtime_libs = [cc.find_library('rt', required : true)]
656 have = cc.has_function('timer_create',
657 dependencies : realtime_libs)
659 realtime_libs += thread_libs
660 have = cc.has_function('timer_create',
661 dependencies : realtime_libs)
664 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
666 have = cc.has_function('setitimer')
667 conf.set('HAVE_SETITIMER', have ? 1 : false)
670 rtas_libs = cc.find_library('rtas', required : false)
671 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
674 if not cc.has_header_symbol('math.h', 'isnan')
675 lib = cc.find_library('m', required : true)
676 if (cc.has_function('isnan', dependencies : lib) and
677 cc.has_function('__isnan', dependencies : lib))
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)
687 extern char *__progname;
689 return (*__progname != 0);
692 have = cc.compiles(code, name : 'using __progname')
693 conf.set('HAVE___PROGNAME', have ? 1 : false)
695 build_plymouth_support = get_option('build-plymouth-support')
696 have_tiocglcktrmios = cc.has_header_symbol(
697 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
698 required : build_plymouth_support.enabled())
699 have_sock_cloexec = cc.has_header_symbol(
700 'sys/socket.h', 'SOCK_CLOEXEC',
701 prefix : '#include <sys/types.h>',
702 required : build_plymouth_support.enabled())
703 have_sock_nonblock = cc.has_header_symbol(
704 'sys/socket.h', 'SOCK_NONBLOCK',
705 prefix : '#include <sys/types.h>',
706 required : build_plymouth_support.enabled())
707 have_so_passcred = cc.has_header_symbol(
708 'sys/socket.h', 'SO_PASSCRED',
709 prefix : '#include <sys/types.h>',
710 required : build_plymouth_support.enabled())
712 build_plymouth_support = (not build_plymouth_support.disabled() and
713 have_tiocglcktrmios and
714 have_sock_cloexec and
715 have_sock_nonblock and
717 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
718 summary('plymouth support',
719 build_plymouth_support ? 'enabled' : 'disabled',
720 section : 'components')
722 # check for valid fallocate() function
723 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
724 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
725 # and program can't be linked.
733 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
734 return ret == 0 ? 0 : 1;
737 have = cc.links(code, name : 'fallocate() function')
738 conf.set('HAVE_FALLOCATE', have ? 1 : false)
746 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
747 return ret == 0 ? 0 : 1;
750 have = cc.links(code, name : 'posix_fallocate() function')
751 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
753 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
754 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
755 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
757 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
758 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
759 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
761 ############################################################
764 fs_search_path = get_option('fs-search-path')
765 fs_search_path_extra = get_option('fs-search-path-extra')
766 if fs_search_path_extra != ''
767 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
769 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
771 systemdsystemunitdir = ''
773 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
776 sysvinit = get_option('sysvinit').enabled()
777 sysvinitrcdir = sysconfdir + '/init.d'
779 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
780 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
782 have = get_option('chsh-only-listed')
783 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
785 have = get_option('use-tty-group')
786 conf.set('USE_TTY_GROUP', have ? 1 : false)
788 build_hwclock = not get_option('build-hwclock').disabled()
789 bison = find_program('bison', required: build_hwclock)
790 bison_gen = generator(
792 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
793 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
797 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
798 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
802 configuration : conf)
804 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
809 '-Waddress-of-packed-member',
810 '-Wdiscarded-qualifiers',
811 '-Wembedded-directive',
814 '-Wimplicit-function-declaration',
815 '-Wmissing-declarations',
816 '-Wmissing-parameter-type',
817 '-Wmissing-prototypes',
819 '-Wno-missing-field-initializers',
820 '-Wold-style-definition',
824 '-Wstrict-prototypes',
827 '-Wunused-but-set-parameter',
828 '-Wunused-but-set-variable',
829 '-Wunused-parameter',
833 foreach compiler_flag : compiler_flags
834 if cc.has_argument(compiler_flag)
835 add_project_arguments(compiler_flag, language : 'c')
843 bashcompletionslinks = {}
849 subdir('libsmartcols')
852 subdir('login-utils')
860 includes = [dir_include,
870 opt = not get_option('build-chfn-chsh').disabled()
875 include_directories : includes,
876 link_with : [lib_common, logindefs_c],
877 dependencies : chfn_chsh_deps,
878 install_dir : usrbin_exec_dir,
880 build_by_default : opt)
884 'login-utils/chsh.c',
887 include_directories : includes,
888 link_with : lib_common,
889 dependencies : chfn_chsh_deps,
890 install_dir : usrbin_exec_dir,
892 build_by_default : opt)
893 if opt and not is_disabler(exe)
895 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
896 bashcompletions += ['chfn', 'chsh']
901 test_islocal_sources,
902 include_directories : includes,
903 c_args : '-DTEST_PROGRAM')
908 test_consoles_sources,
909 c_args : ['-DTEST_PROGRAM'],
910 include_directories : includes,
911 link_with : lib_common)
914 opt = not get_option('build-last').disabled()
918 include_directories : includes,
919 link_with : [lib_common],
920 install_dir : usrbin_exec_dir,
922 build_by_default : opt)
923 if opt and not is_disabler(exe)
925 meson.add_install_script(meson_make_symlink,
927 join_paths(usrbin_exec_dir, 'lastb'))
928 manadocs += ['login-utils/last.1.adoc']
929 manlinks += {'lastb.1': 'last.1'}
930 bashcompletions += ['last']
931 bashcompletionslinks += {'lastb': 'last'}
934 opt = not get_option('build-nologin').disabled()
937 'login-utils/nologin.c',
938 include_directories : includes,
939 install_dir : sbindir,
940 link_with : [lib_common],
942 build_by_default : opt)
943 if opt and not is_disabler(exe)
945 manadocs += ['login-utils/nologin.8.adoc']
948 opt = not get_option('build-utmpdump').disabled()
951 'login-utils/utmpdump.c',
952 include_directories : includes,
953 link_with : [lib_common],
954 install_dir : usrbin_exec_dir,
956 build_by_default : opt)
957 if opt and not is_disabler(exe)
959 manadocs += ['login-utils/utmpdump.1.adoc']
960 bashcompletions += ['utmpdump']
963 opt = not get_option('build-su').disabled()
967 'login-utils/su-common.c',
968 'login-utils/su-common.h',
972 include_directories : includes,
973 link_with : [lib_common, logindefs_c],
974 dependencies : [lib_pam,
979 build_by_default : opt)
980 if opt and not is_disabler(exe)
982 manadocs += ['login-utils/su.1.adoc']
983 bashcompletions += ['su']
986 opt = not get_option('build-newgrp').disabled()
989 'login-utils/newgrp.c',
990 include_directories : includes,
991 dependencies : [lib_crypt],
992 install_dir : usrbin_exec_dir,
994 build_by_default : opt)
995 if opt and not is_disabler(exe)
997 manadocs += ['login-utils/newgrp.1.adoc']
1000 opt = not get_option('build-lslogins').disabled()
1003 'login-utils/lslogins.c',
1004 include_directories : includes,
1005 link_with : [lib_common,
1008 dependencies : [lib_selinux,
1010 install_dir : usrbin_exec_dir,
1012 build_by_default : opt)
1013 if opt and not is_disabler(exe)
1015 manadocs += ['login-utils/lslogins.1.adoc']
1016 bashcompletions += ['lslogins']
1019 opt = not get_option('build-vipw').disabled()
1022 'login-utils/vipw.c',
1023 'login-utils/setpwnam.h',
1024 include_directories : includes,
1025 link_with : [lib_common],
1026 dependencies : [lib_selinux],
1027 install_dir : usrbin_exec_dir,
1029 build_by_default : opt)
1030 if opt and not is_disabler(exe)
1032 meson.add_install_script(meson_make_symlink,
1034 join_paths(usrbin_exec_dir, 'vigr'))
1035 manadocs += ['login-utils/vipw.8.adoc']
1038 opt = not get_option('build-runuser').disabled()
1041 'login-utils/runuser.c',
1042 'login-utils/su-common.c',
1043 'login-utils/su-common.h',
1047 include_directories : includes,
1048 link_with : [lib_common, logindefs_c],
1049 dependencies : [lib_pam,
1053 install_dir : sbindir,
1055 build_by_default : opt)
1056 if opt and not is_disabler(exe)
1058 manadocs += ['login-utils/runuser.1.adoc']
1059 bashcompletionslinks += {'runuser': 'su'}
1062 ############################################################
1067 include_directories : includes,
1068 link_with : lib_common,
1069 install_dir : usrbin_exec_dir,
1072 manadocs += ['text-utils/col.1.adoc']
1073 bashcompletions += ['col']
1078 include_directories : includes,
1079 install_dir : usrbin_exec_dir,
1082 manadocs += ['text-utils/colcrt.1.adoc']
1083 bashcompletions += ['colcrt']
1088 include_directories : includes,
1089 link_with : lib_common,
1090 install_dir : usrbin_exec_dir,
1093 manadocs += ['text-utils/colrm.1.adoc']
1094 bashcompletions += ['colrm']
1099 include_directories : includes,
1100 install_dir : usrbin_exec_dir,
1103 manadocs += ['text-utils/rev.1.adoc']
1104 bashcompletions += ['rev']
1109 include_directories : includes,
1110 link_with : [lib_common,
1112 install_dir : usrbin_exec_dir,
1114 if not is_disabler(exe)
1116 manadocs += ['text-utils/column.1.adoc']
1117 bashcompletions += ['column']
1120 opt = not get_option('build-line').disabled()
1124 include_directories : includes,
1125 install_dir : usrbin_exec_dir,
1127 build_by_default : opt)
1128 if opt and not is_disabler(exe)
1130 manadocs += ['text-utils/line.1.adoc']
1133 opt = not get_option('build-pg').disabled()
1137 link_with : lib_common,
1138 include_directories : includes,
1139 dependencies : [lib_tinfo,
1141 install_dir : usrbin_exec_dir,
1143 build_by_default : opt)
1144 if opt and not is_disabler(exe)
1146 manadocs += ['text-utils/pg.1.adoc']
1147 bashcompletions += ['pg']
1150 opt = not get_option('build-ul').disabled()
1154 include_directories : includes,
1155 dependencies : [lib_tinfo,
1157 install_dir : usrbin_exec_dir,
1159 build_by_default : opt)
1160 if opt and not is_disabler(exe)
1162 manadocs += ['text-utils/ul.1.adoc']
1163 bashcompletions += ['ul']
1166 opt = not get_option('build-more').disabled()
1170 link_with : [lib_common],
1171 include_directories : includes,
1172 dependencies : [lib_tinfo,
1176 build_by_default : opt)
1180 link_with : [lib_common],
1181 include_directories : includes,
1182 c_args : '-DTEST_PROGRAM',
1183 dependencies : [lib_tinfo,
1186 build_by_default : opt)
1188 if opt and not is_disabler(exe)
1190 manadocs += ['text-utils/more.1.adoc']
1191 bashcompletions += ['more']
1197 include_directories : includes,
1198 link_with : [lib_common,
1200 install_dir : usrbin_exec_dir,
1202 if not is_disabler(exe)
1204 manadocs += ['text-utils/hexdump.1.adoc']
1205 bashcompletions += ['hexdump']
1208 opt = not get_option('build-lsmem').disabled()
1212 include_directories : includes,
1213 link_with : [lib_common,
1215 install_dir : usrbin_exec_dir,
1217 build_by_default : opt)
1218 if opt and not is_disabler(exe)
1220 manadocs += ['sys-utils/lsmem.1.adoc']
1221 bashcompletions += ['lsmem']
1224 opt = not get_option('build-chmem').disabled()
1228 include_directories : includes,
1229 link_with : [lib_common],
1230 install_dir : usrbin_exec_dir,
1232 build_by_default : opt)
1233 if opt and not is_disabler(exe)
1235 manadocs += ['sys-utils/chmem.8.adoc']
1236 bashcompletions += ['chmem']
1242 include_directories : includes,
1243 link_with : [lib_common],
1244 install_dir : usrbin_exec_dir,
1247 manadocs += ['sys-utils/choom.1.adoc']
1252 include_directories : includes,
1253 link_with : [lib_common],
1254 install_dir : usrbin_exec_dir,
1257 manadocs += ['sys-utils/ipcmk.1.adoc']
1258 bashcompletions += ['ipcmk']
1263 include_directories : includes,
1264 link_with : [lib_common],
1265 install_dir : usrbin_exec_dir,
1268 manadocs += ['sys-utils/ipcrm.1.adoc']
1269 bashcompletions += ['ipcrm']
1271 opt = not get_option('build-ipcs').disabled()
1275 include_directories : includes,
1276 link_with : [lib_common],
1277 install_dir : usrbin_exec_dir,
1279 build_by_default : opt)
1280 if opt and not is_disabler(exe)
1282 manadocs += ['sys-utils/ipcs.1.adoc']
1283 bashcompletions += ['ipcs']
1286 opt = not get_option('build-rfkill').disabled()
1290 include_directories : includes,
1291 link_with : [lib_common,
1293 install_dir : usrsbin_exec_dir,
1295 build_by_default : opt)
1296 if opt and not is_disabler(exe)
1298 manadocs += ['sys-utils/rfkill.8.adoc']
1299 bashcompletions += ['rfkill']
1305 include_directories : includes,
1306 link_with : [lib_common,
1308 install_dir : usrbin_exec_dir,
1310 if not is_disabler(exe)
1312 manadocs += ['sys-utils/renice.1.adoc']
1313 bashcompletions += ['renice']
1319 include_directories : includes,
1320 link_with : [lib_common,
1322 install_dir : usrbin_exec_dir,
1324 if opt and not is_disabler(exe)
1326 manadocs += ['sys-utils/setsid.1.adoc']
1327 bashcompletions += ['setsid']
1332 readprofile_sources,
1333 include_directories : includes,
1334 link_with : [lib_common,
1336 install_dir : usrsbin_exec_dir,
1338 if not is_disabler(exe)
1340 manadocs += ['sys-utils/readprofile.8.adoc']
1341 bashcompletions += ['readprofile']
1344 opt = not get_option('build-tunelp').disabled()
1348 include_directories : includes,
1349 link_with : [lib_common],
1350 install_dir : usrsbin_exec_dir,
1352 build_by_default : opt)
1353 if opt and not is_disabler(exe)
1355 manadocs += ['sys-utils/tunelp.8.adoc']
1356 bashcompletions += ['tunelp']
1362 include_directories : includes,
1363 link_with : [lib_common,
1365 install_dir : sbindir,
1367 if not is_disabler(exe)
1369 manadocs += ['sys-utils/fstrim.8.adoc']
1370 bashcompletions += ['fstrim']
1376 include_directories : includes,
1377 link_with : [lib_common,
1380 if not is_disabler(exe)
1382 manadocs += ['sys-utils/dmesg.1.adoc']
1383 bashcompletions += ['dmesg']
1389 include_directories : dir_include,
1390 c_args : '-DTEST_DMESG',
1391 link_with : [lib_common,
1393 if not is_disabler(exe)
1400 include_directories : includes,
1401 link_with : [lib_common],
1402 install_dir : sbindir,
1405 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1406 bashcompletions += ['ctrlaltdel']
1411 include_directories : includes,
1412 install_dir : sbindir,
1415 manadocs += ['sys-utils/fsfreeze.8.adoc']
1416 bashcompletions += ['fsfreeze']
1421 include_directories : includes,
1422 link_with : [lib_common,
1424 install_dir : sbindir,
1427 manadocs += ['sys-utils/blkdiscard.8.adoc']
1428 bashcompletions += ['blkdiscard']
1433 include_directories : includes,
1434 link_with : [lib_common],
1435 install_dir : sbindir,
1438 manadocs += ['sys-utils/blkzone.8.adoc']
1439 bashcompletions += ['blkzone']
1444 include_directories : includes,
1445 link_with : [lib_common],
1446 install_dir : sbindir,
1449 manadocs += ['sys-utils/blkpr.8.adoc']
1454 include_directories : includes,
1455 link_with : [lib_common],
1456 install_dir : usrsbin_exec_dir,
1459 manadocs += ['sys-utils/ldattach.8.adoc']
1460 bashcompletions += ['ldattach']
1465 include_directories : includes,
1466 link_with : [lib_common],
1467 install_dir : usrsbin_exec_dir,
1470 manadocs += ['sys-utils/rtcwake.8.adoc']
1471 bashcompletions += ['rtcwake']
1476 include_directories : includes,
1477 link_with : [lib_common],
1478 install_dir : usrbin_exec_dir,
1481 manadocs += ['sys-utils/setarch.8.adoc']
1482 bashcompletions += ['setarch']
1484 setarch_links = ['uname26', 'linux32', 'linux64']
1485 setarch_links_arch = {
1486 's390x' : ['s390', 's390x'],
1488 'x86_64' : ['i386', 'x86_64'],
1489 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1490 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1491 'mips64' : ['mips', 'mips64', 'mips32'],
1492 'ia64' : ['i386', 'ia64'],
1493 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1495 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1497 foreach link: setarch_links
1498 meson.add_install_script(meson_make_symlink,
1500 join_paths(usrbin_exec_dir, link))
1501 manlinks += {link + '.8': 'setarch.8'}
1504 opt = not get_option('build-eject').disabled()
1508 include_directories : includes,
1509 link_with : [lib_common,
1511 install_dir : usrbin_exec_dir,
1513 build_by_default : opt)
1514 if opt and not is_disabler(exe)
1516 manadocs += ['sys-utils/eject.1.adoc']
1517 bashcompletions += ['eject']
1520 opt = not get_option('build-losetup').disabled()
1524 include_directories : includes,
1525 link_with : [lib_common,
1527 install_dir : sbindir,
1529 build_by_default : opt)
1530 if opt and not is_disabler(exe)
1531 manadocs += ['sys-utils/losetup.8.adoc']
1533 bashcompletions += ['losetup']
1536 opt = opt and 'losetup' in static_programs
1540 include_directories : includes,
1541 link_args : ['--static'],
1542 link_with : [lib_common,
1543 lib_smartcols.get_static_lib()],
1544 install_dir : sbindir,
1546 build_by_default : opt)
1547 if opt and not is_disabler(exe)
1551 opt = not get_option('build-zramctl').disabled()
1555 include_directories : includes,
1556 link_with : [lib_common,
1558 install_dir : sbindir,
1560 build_by_default : opt)
1561 if opt and not is_disabler(exe)
1563 manadocs += ['sys-utils/zramctl.8.adoc']
1564 bashcompletions += ['zramctl']
1570 include_directories : includes,
1571 link_with : [lib_common,
1573 install_dir : usrbin_exec_dir,
1575 if not is_disabler(exe)
1577 manadocs += ['sys-utils/prlimit.1.adoc']
1578 bashcompletions += ['prlimit']
1584 include_directories : includes,
1585 link_with : [lib_common,
1588 install_dir : usrbin_exec_dir,
1590 if not is_disabler(exe)
1592 manadocs += ['sys-utils/lsns.8.adoc']
1593 bashcompletions += ['lsns']
1596 opt = not get_option('build-mount').disabled()
1600 include_directories : includes,
1601 link_with : [lib_common,
1604 dependencies : lib_selinux,
1606 build_by_default : opt)
1610 include_directories : includes,
1611 link_with : [lib_common,
1614 build_by_default : opt)
1615 if opt and not is_disabler(exe)
1617 manadocs += ['sys-utils/fstab.5.adoc',
1618 'sys-utils/mount.8.adoc',
1619 'sys-utils/umount.8.adoc']
1620 bashcompletions += ['mount', 'umount']
1623 opt2 = opt and 'mount' in static_programs
1627 include_directories : includes,
1628 link_args : ['--static'],
1629 link_with : [lib_common,
1630 lib_smartcols_static,
1633 build_by_default : opt2)
1634 if opt2 and not is_disabler(exe)
1638 opt2 = opt and 'umount' in static_programs
1642 include_directories : includes,
1643 link_args : ['--static'],
1644 link_with : [lib_common,
1647 build_by_default : opt2)
1648 if opt2 and not is_disabler(exe)
1657 include_directories : includes,
1658 link_with : [lib_common,
1662 install_dir : sbindir,
1664 if not is_disabler(exe)
1666 manadocs += ['sys-utils/swapon.8.adoc']
1667 bashcompletions += ['swapon']
1673 include_directories : includes,
1674 link_with : [lib_common,
1677 install_dir : sbindir,
1679 if not is_disabler(exe)
1681 manlinks += {'swapoff.8': 'swapon.8'}
1682 bashcompletions += ['swapoff']
1688 include_directories : includes,
1689 link_with : [lib_common,
1691 dependencies : [rtas_libs],
1692 install_dir : usrbin_exec_dir,
1694 if not is_disabler(exe)
1696 manadocs += ['sys-utils/lscpu.1.adoc']
1697 bashcompletions += ['lscpu']
1703 include_directories : includes,
1704 link_with : [lib_common],
1705 install_dir : sbindir,
1708 manadocs += ['sys-utils/chcpu.8.adoc']
1709 bashcompletions += ['chcpu']
1714 include_directories : includes,
1715 link_with : [lib_common,
1718 if not is_disabler(exe)
1720 manadocs += ['sys-utils/wdctl.8.adoc']
1721 bashcompletions += ['wdctl']
1724 opt = not get_option('build-mountpoint').disabled()
1728 include_directories : includes,
1729 link_with : [lib_mount],
1731 build_by_default : opt)
1732 if opt and not is_disabler(exe)
1734 manadocs += ['sys-utils/mountpoint.1.adoc']
1735 bashcompletions += ['mountpoint']
1738 opt = not get_option('build-fallocate').disabled()
1742 include_directories : includes,
1743 link_with : [lib_common],
1744 install_dir : usrbin_exec_dir,
1746 build_by_default : opt)
1747 if opt and not is_disabler(exe)
1749 manadocs += ['sys-utils/fallocate.1.adoc']
1750 bashcompletions += ['fallocate']
1753 opt = not get_option('build-pivot_root').disabled()
1757 include_directories : includes,
1758 install_dir : sbindir,
1760 build_by_default : opt)
1761 if opt and not is_disabler(exe)
1763 manadocs += ['sys-utils/pivot_root.8.adoc']
1764 bashcompletions += ['pivot_root']
1767 opt = not get_option('build-switch_root').disabled()
1768 if opt and not have_dirfd and not have_ddfd
1769 error('neither dirfd nor ddfd are available')
1773 switch_root_sources,
1774 include_directories : includes,
1775 install_dir : sbindir,
1777 build_by_default : opt)
1778 if opt and not is_disabler(exe)
1780 manadocs += ['sys-utils/switch_root.8.adoc']
1783 opt = not get_option('build-unshare').disabled()
1787 include_directories : includes,
1788 link_with : [lib_common],
1789 install_dir : usrbin_exec_dir,
1791 build_by_default : opt)
1792 if opt and not is_disabler(exe)
1794 manadocs += ['sys-utils/unshare.1.adoc']
1795 bashcompletions += ['unshare']
1798 opt = opt and 'unshare' in static_programs
1802 include_directories : includes,
1803 link_with : [lib_common],
1804 install_dir : usrbin_exec_dir,
1806 build_by_default : opt)
1807 if opt and not is_disabler(exe)
1811 opt = not get_option('build-nsenter').disabled()
1815 include_directories : includes,
1816 link_with : [lib_common],
1817 dependencies : [lib_selinux],
1818 install_dir : usrbin_exec_dir,
1820 build_by_default : opt)
1821 if opt and not is_disabler(exe)
1823 manadocs += ['sys-utils/nsenter.1.adoc']
1824 bashcompletions += ['nsenter']
1827 opt = opt and 'nsenter' in static_programs
1831 include_directories : includes,
1832 link_with : [lib_common],
1833 dependencies : [lib_selinux],
1834 install_dir : usrbin_exec_dir,
1836 build_by_default : opt)
1837 if opt and not is_disabler(exe)
1841 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1845 include_directories : includes,
1846 link_with : [lib_common],
1847 dependencies : [lib_cap_ng],
1848 install_dir : usrbin_exec_dir,
1850 build_by_default : opt)
1851 if opt and not is_disabler(exe)
1853 manadocs += ['sys-utils/setpriv.1.adoc']
1854 bashcompletions += ['setpriv']
1860 include_directories : includes,
1861 link_with : [lib_common],
1862 dependencies : realtime_libs,
1863 install_dir : usrbin_exec_dir,
1866 manadocs += ['sys-utils/flock.1.adoc']
1867 bashcompletions += ['flock']
1869 opt = not get_option('build-lsirq').disabled()
1873 include_directories : includes,
1874 link_with : [lib_common,
1876 install_dir : usrbin_exec_dir,
1878 build_by_default : opt)
1879 if opt and not is_disabler(exe)
1881 manadocs += ['sys-utils/lsirq.1.adoc']
1882 bashcompletions += ['lsirq']
1885 opt = not get_option('build-irqtop').disabled()
1889 include_directories : includes,
1890 dependencies : [realtime_libs, curses_libs],
1891 link_with : [lib_common,
1894 install_dir : usrbin_exec_dir,
1896 build_by_default : opt)
1897 if opt and not is_disabler(exe)
1899 manadocs += ['sys-utils/irqtop.1.adoc']
1900 bashcompletions += ['irqtop']
1903 opt = not get_option('build-ipcs').disabled()
1907 include_directories : includes,
1908 link_with : [lib_common,
1910 install_dir : usrbin_exec_dir,
1912 build_by_default : opt)
1913 if opt and not is_disabler(exe)
1915 manadocs += ['sys-utils/lsipc.1.adoc']
1916 bashcompletions += ['lsipc']
1923 include_directories : includes,
1924 link_with : [lib_common],
1925 dependencies : [lib_m,
1927 install_dir : sbindir,
1929 build_by_default : opt)
1930 if opt and not is_disabler(exe)
1932 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1933 bashcompletions += ['hwclock']
1939 include_directories : includes,
1940 install_dir : sbindir,
1943 manadocs += ['disk-utils/mkfs.8.adoc']
1944 bashcompletions += ['mkfs']
1946 opt = not get_option('build-bfs').disabled()
1950 include_directories : includes,
1951 link_with : [lib_common],
1952 install_dir : sbindir,
1954 build_by_default : opt)
1955 if opt and not is_disabler(exe)
1957 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1958 bashcompletions += ['mkfs.bfs']
1964 include_directories : includes,
1965 link_with : [lib_common],
1966 install_dir : usrbin_exec_dir,
1969 manadocs += ['disk-utils/isosize.8.adoc']
1970 bashcompletions += ['isosize']
1975 include_directories : includes,
1976 link_with : [lib_common,
1979 dependencies: [lib_selinux],
1980 install_dir : sbindir,
1982 if opt and not is_disabler(exe)
1984 manadocs += ['disk-utils/mkswap.8.adoc']
1985 bashcompletions += ['mkswap']
1991 include_directories : includes,
1992 link_with : [lib_common,
1995 install_dir : sbindir,
1997 if opt and not is_disabler(exe)
1999 manadocs += ['disk-utils/swaplabel.8.adoc']
2000 bashcompletions += ['swaplabel']
2003 opt = not get_option('build-fsck').disabled()
2007 include_directories : includes,
2008 link_with : [lib_common,
2011 dependencies : realtime_libs,
2012 install_dir : sbindir,
2014 build_by_default : opt)
2015 if opt and not is_disabler(exe)
2017 manadocs += ['disk-utils/fsck.8.adoc']
2018 bashcompletions += ['fsck']
2021 opt = not get_option('build-minix').disabled()
2025 include_directories : includes,
2026 link_with : [lib_common],
2027 install_dir : sbindir,
2029 build_by_default : opt)
2033 include_directories : includes,
2034 c_args : '-DTEST_SCRIPT',
2035 link_with : [lib_common],
2036 build_by_default : opt)
2040 include_directories : includes,
2041 link_with : [lib_common],
2042 install_dir : sbindir,
2044 build_by_default : opt)
2045 if opt and not is_disabler(exe)
2046 exes += [exe, exe2, exe3]
2047 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2048 bashcompletions += ['mkfs.minix', 'fsck.minix']
2051 opt = not get_option('build-cramfs').disabled()
2054 mkfs_cramfs_sources,
2055 include_directories : includes,
2056 link_with : [lib_common],
2057 dependencies : [lib_z],
2058 install_dir : sbindir,
2060 build_by_default : opt)
2063 fsck_cramfs_sources,
2064 include_directories : includes,
2065 link_with : [lib_common],
2066 dependencies : [lib_z],
2067 install_dir : sbindir,
2069 build_by_default : opt)
2070 if not is_disabler(exe)
2072 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2073 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2076 opt = not get_option('build-raw').disabled()
2078 cc.has_header('linux/raw.h', required: opt)
2083 include_directories : includes,
2084 install_dir : sbindir,
2086 build_by_default : opt)
2087 if opt and not is_disabler(exe)
2089 manadocs += ['disk-utils/raw.8.adoc']
2090 bashcompletions += ['raw']
2093 opt = not get_option('build-fdformat').disabled()
2097 include_directories : includes,
2098 link_with : [lib_common],
2099 install_dir : usrsbin_exec_dir,
2101 build_by_default : opt)
2102 if opt and not is_disabler(exe)
2104 manadocs += ['disk-utils/fdformat.8.adoc']
2110 include_directories : includes,
2111 link_with : [lib_common],
2112 install_dir : sbindir,
2114 manadocs += ['disk-utils/blockdev.8.adoc']
2115 bashcompletions += ['blockdev']
2117 opt = not get_option('build-fdisks').disabled()
2118 if opt and not have_dirfd and not have_ddfd
2119 error('neither dirfd nor ddfd are available')
2124 include_directories : includes,
2125 link_with : [lib_common,
2129 dependencies : [lib_readline],
2130 install_dir : sbindir,
2132 build_by_default : opt)
2133 if opt and not is_disabler(exe)
2135 bashcompletions += ['fdisk']
2138 opt2 = opt and 'fdisk' in static_programs
2142 link_args : ['--static'],
2143 include_directories : includes,
2144 link_with : [lib_common,
2147 lib_smartcols.get_static_lib()],
2148 dependencies : [lib_readline_static],
2149 install_dir : sbindir,
2151 build_by_default : opt2)
2152 if opt2 and not is_disabler(exe)
2159 include_directories : includes,
2160 link_with : [lib_common,
2164 dependencies : [lib_readline],
2165 install_dir : sbindir,
2167 build_by_default : opt)
2168 if opt and not is_disabler(exe)
2170 bashcompletions += ['sfdisk']
2173 opt2 = opt and 'sfdisk' in static_programs
2177 include_directories : includes,
2178 link_with : [lib_common,
2181 lib_smartcols.get_static_lib()],
2182 dependencies : [lib_readline_static],
2183 install_dir : sbindir,
2185 build_by_default : opt2)
2186 if opt2 and not is_disabler(exe)
2193 include_directories : includes,
2194 link_with : [lib_common,
2199 dependencies : [curses_libs],
2200 install_dir : sbindir,
2202 build_by_default : opt)
2203 if opt and not is_disabler(exe)
2205 manadocs += ['disk-utils/fdisk.8.adoc',
2206 'disk-utils/sfdisk.8.adoc',
2207 'disk-utils/cfdisk.8.adoc']
2208 bashcompletions += ['cfdisk']
2211 opt = not get_option('build-partx').disabled()
2215 include_directories : includes,
2216 link_with : [lib_common],
2217 install_dir : usrsbin_exec_dir,
2219 build_by_default : opt)
2223 include_directories : includes,
2224 link_with : [lib_common],
2225 install_dir : usrsbin_exec_dir,
2227 build_by_default : opt)
2231 include_directories : includes,
2232 link_with : [lib_common],
2233 install_dir : usrsbin_exec_dir,
2235 build_by_default : opt)
2239 include_directories : includes,
2240 link_with : [lib_common,
2243 install_dir : usrsbin_exec_dir,
2245 build_by_default : opt)
2247 exes += [exe, exe2, exe3, exe4]
2248 manadocs += ['disk-utils/addpart.8.adoc',
2249 'disk-utils/delpart.8.adoc',
2250 'disk-utils/resizepart.8.adoc',
2251 'disk-utils/partx.8.adoc']
2252 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2255 ############################################################
2260 include_directories : includes,
2261 link_with : [lib_common],
2262 dependencies : [lib_util,
2266 install_dir : usrbin_exec_dir,
2269 manadocs += ['term-utils/script.1.adoc']
2270 bashcompletions += ['script']
2275 include_directories : includes,
2276 c_args : '-DTEST_SCRIPT',
2277 link_with : [lib_common],
2278 dependencies : [lib_util,
2287 include_directories : includes,
2288 link_with : [lib_common],
2289 dependencies : [lib_util,
2292 install_dir : usrbin_exec_dir,
2295 manadocs += ['term-utils/scriptlive.1.adoc']
2296 bashcompletions += ['scriptlive']
2300 scriptreplay_sources,
2301 include_directories : includes,
2302 link_with : [lib_common],
2303 dependencies : [math_libs],
2304 install_dir : usrbin_exec_dir,
2307 manadocs += ['term-utils/scriptreplay.1.adoc']
2308 bashcompletions += ['scriptreplay']
2310 opt = not get_option('build-agetty').disabled()
2314 include_directories : includes,
2315 link_with : [lib_common, logindefs_c],
2316 dependencies : BSD ? lib_util : [],
2317 install_dir : sbindir,
2319 build_by_default : opt)
2322 manadocs += ['term-utils/agetty.8.adoc']
2325 opt = not get_option('build-setterm').disabled()
2329 include_directories : includes,
2330 link_with : [lib_common],
2331 dependencies : [curses_libs],
2332 install_dir : usrbin_exec_dir,
2334 build_by_default : opt)
2337 manadocs += ['term-utils/setterm.1.adoc']
2338 bashcompletions += ['setterm']
2341 opt = not get_option('build-mesg').disabled()
2345 include_directories : includes,
2346 link_with : [lib_common],
2347 install_dir : usrbin_exec_dir,
2349 build_by_default : opt)
2352 manadocs += ['term-utils/mesg.1.adoc']
2353 bashcompletions += ['mesg']
2356 opt = not get_option('build-wall').disabled()
2360 include_directories : includes,
2361 link_with : [lib_common],
2362 install_dir : usrbin_exec_dir,
2364 build_by_default : opt)
2367 manadocs += ['term-utils/wall.1.adoc']
2368 bashcompletions += ['wall']
2371 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2372 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2374 opt = not get_option('build-write').disabled()
2378 include_directories : includes,
2379 link_with : [lib_common],
2380 install_dir : usrbin_exec_dir,
2382 build_by_default : opt)
2385 manadocs += ['term-utils/write.1.adoc']
2388 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2389 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2391 opt = not get_option('build-login').disabled()
2395 include_directories : includes,
2396 link_with : [lib_common, logindefs_c],
2397 dependencies : [lib_pam,
2401 build_by_default : opt)
2402 if not is_disabler(exe)
2404 manadocs += ['login-utils/login.1.adoc']
2407 opt = not get_option('build-sulogin').disabled()
2411 include_directories : includes,
2412 link_with : [lib_common],
2413 dependencies : [lib_crypt,
2415 install_dir : sbindir,
2417 build_by_default : opt)
2418 if not is_disabler(exe)
2420 manadocs += ['login-utils/sulogin.8.adoc']
2426 include_directories : includes,
2427 link_with : [lib_common,
2429 dependencies : [curses_libs],
2430 install_dir : usrbin_exec_dir,
2433 manadocs += ['misc-utils/cal.1.adoc']
2434 bashcompletions += ['cal']
2436 opt = not get_option('build-logger').disabled()
2440 include_directories : includes,
2441 link_with : [lib_common],
2442 dependencies : [lib_systemd],
2443 install_dir : usrbin_exec_dir,
2445 build_by_default : opt)
2446 if opt and not is_disabler(exe)
2448 manadocs += ['misc-utils/logger.1.adoc']
2449 bashcompletions += ['logger']
2455 include_directories : includes,
2456 c_args : '-DTEST_LOGGER',
2457 link_with : [lib_common],
2458 dependencies : [lib_systemd])
2459 if not is_disabler(exe)
2466 include_directories : includes,
2467 install_dir : usrbin_exec_dir,
2470 manadocs += ['misc-utils/look.1.adoc']
2471 bashcompletions += ['look']
2476 include_directories : includes,
2477 link_with : [lib_common],
2478 install_dir : usrbin_exec_dir,
2481 manadocs += ['misc-utils/mcookie.1.adoc']
2482 bashcompletions += ['mcookie']
2487 include_directories : includes,
2488 dependencies : [lib_selinux],
2489 install_dir : usrbin_exec_dir,
2492 manadocs += ['misc-utils/namei.1.adoc']
2493 bashcompletions += ['namei']
2498 include_directories : includes,
2499 link_with : [lib_common],
2500 install_dir : usrbin_exec_dir,
2503 manadocs += ['misc-utils/whereis.1.adoc']
2504 bashcompletions += ['whereis']
2509 include_directories : includes,
2510 link_with : [lib_common,
2513 install_dir : usrbin_exec_dir,
2515 if not is_disabler(exe)
2517 manadocs += ['misc-utils/lslocks.8.adoc']
2518 bashcompletions += ['lslocks']
2524 include_directories : includes,
2525 link_with : [lib_common,
2529 dependencies : lib_udev,
2531 if not is_disabler(exe)
2533 manadocs += ['misc-utils/lsblk.8.adoc']
2534 bashcompletions += ['lsblk']
2540 include_directories : includes,
2541 link_with : [lib_common,
2543 install_dir : usrbin_exec_dir,
2545 if not is_disabler(exe)
2547 manadocs += ['misc-utils/lsfd.1.adoc']
2553 include_directories : includes,
2554 link_with : [lib_uuid],
2555 install_dir : usrbin_exec_dir,
2557 if not is_disabler(exe)
2559 manadocs += ['misc-utils/uuidgen.1.adoc']
2560 bashcompletions += ['uuidgen']
2566 include_directories : includes,
2567 link_with : [lib_common,
2570 install_dir : usrbin_exec_dir,
2572 if not is_disabler(exe)
2574 manadocs += ['misc-utils/uuidparse.1.adoc']
2575 bashcompletions += ['uuidparse']
2582 include_directories : includes,
2583 link_with : [lib_common,
2585 dependencies : [realtime_libs,
2587 install_dir : usrsbin_exec_dir,
2589 build_by_default : opt)
2593 include_directories : includes,
2594 link_with : [lib_common,
2596 dependencies : thread_libs,
2597 build_by_default : opt)
2598 if not is_disabler(exe)
2600 manadocs += ['misc-utils/uuidd.8.adoc']
2601 bashcompletions += ['uuidd']
2604 opt = build_libblkid
2608 include_directories : includes,
2609 link_with : [lib_common,
2611 install_dir : sbindir,
2613 build_by_default : opt)
2614 if opt and not is_disabler(exe)
2616 manadocs += ['misc-utils/blkid.8.adoc']
2617 bashcompletions += ['blkid']
2620 opt = opt and 'blkid' in static_programs
2624 include_directories : includes,
2625 link_with : [lib_common,
2627 install_dir : sbindir,
2629 build_by_default : opt)
2630 if opt and not is_disabler(exe)
2636 'libblkid/samples/mkfs.c',
2637 include_directories : includes,
2638 link_with : lib_blkid)
2639 if not is_disabler(exe)
2644 'sample-partitions',
2645 'libblkid/samples/partitions.c',
2646 include_directories : includes,
2647 link_with : lib_blkid)
2648 if not is_disabler(exe)
2653 'sample-superblocks',
2654 'libblkid/samples/superblocks.c',
2655 include_directories : includes,
2656 link_with : lib_blkid)
2657 if not is_disabler(exe)
2663 'libblkid/samples/topology.c',
2664 include_directories : includes,
2665 link_with : lib_blkid)
2666 if not is_disabler(exe)
2671 'test_blkid_fuzz_sample',
2672 'libblkid/src/fuzz.c',
2673 include_directories: includes,
2674 link_with: lib_blkid)
2675 if not is_disabler(exe)
2679 ############################################################
2684 include_directories : includes,
2685 link_with : [lib_blkid],
2686 install_dir : sbindir,
2688 if not is_disabler(exe)
2690 manadocs += ['misc-utils/findfs.8.adoc']
2691 bashcompletions += ['findfs']
2697 include_directories : includes,
2698 link_with : [lib_common,
2701 install_dir : sbindir,
2703 if not is_disabler(exe)
2705 manadocs += ['misc-utils/wipefs.8.adoc']
2706 bashcompletions += ['wipefs']
2712 include_directories : includes,
2713 link_with : [lib_common,
2717 dependencies : [lib_udev],
2719 if not is_disabler(exe)
2721 manadocs += ['misc-utils/findmnt.8.adoc']
2722 bashcompletions += ['findmnt']
2728 include_directories : includes,
2729 link_with : [lib_common],
2731 if not is_disabler(exe)
2733 manadocs += ['misc-utils/kill.1.adoc']
2736 opt = not get_option('build-rename').disabled()
2740 include_directories : includes,
2741 install_dir : usrbin_exec_dir,
2743 build_by_default : opt)
2744 if opt and not is_disabler(exe)
2746 manadocs += ['misc-utils/rename.1.adoc']
2747 bashcompletions += ['rename']
2753 include_directories : includes,
2754 link_with : [lib_common],
2755 install_dir : usrbin_exec_dir,
2758 manadocs += ['misc-utils/getopt.1.adoc']
2759 bashcompletions += ['getopt']
2764 include_directories : includes,
2765 link_with : [lib_common,
2767 install_dir : usrbin_exec_dir,
2769 if not is_disabler(exe)
2771 manadocs += ['misc-utils/fincore.1.adoc']
2772 bashcompletions += ['fincore']
2778 include_directories : includes,
2779 link_with : [lib_common],
2780 install_dir : usrbin_exec_dir,
2782 if not is_disabler(exe)
2784 manadocs += ['misc-utils/hardlink.1.adoc']
2785 bashcompletions += ['hardlink']
2788 opt = not get_option('build-pipesz').disabled()
2792 include_directories : includes,
2793 link_with : [lib_common],
2794 install_dir : usrbin_exec_dir,
2796 if opt and not is_disabler(exe)
2798 manadocs += ['misc-utils/pipesz.1.adoc']
2799 bashcompletions += ['pipesz']
2805 include_directories : includes,
2806 c_args : '-DTEST_CAL',
2807 link_with : [lib_common,
2809 dependencies : [curses_libs])
2810 if not is_disabler(exe)
2817 include_directories : includes,
2818 link_with : [lib_common],
2819 install_dir : usrbin_exec_dir,
2821 if not is_disabler(exe)
2823 manadocs += ['misc-utils/fadvise.1.adoc']
2824 bashcompletions += ['fadvise']
2830 include_directories : includes,
2831 link_with : [lib_common],
2832 install_dir : usrbin_exec_dir,
2834 if not is_disabler(exe)
2836 manadocs += ['misc-utils/waitpid.1.adoc']
2837 bashcompletions += ['waitpid']
2840 ############################################################
2842 opt = not get_option('build-schedutils').disabled()
2845 'schedutils/chrt.c',
2846 include_directories : includes,
2847 link_with : lib_common,
2848 install_dir : usrbin_exec_dir,
2850 build_by_default : opt)
2854 'schedutils/ionice.c',
2855 include_directories : includes,
2856 link_with : lib_common,
2857 install_dir : usrbin_exec_dir,
2859 build_by_default : opt)
2863 'schedutils/taskset.c',
2864 include_directories : includes,
2865 link_with : lib_common,
2866 install_dir : usrbin_exec_dir,
2868 build_by_default : opt)
2872 'schedutils/uclampset.c',
2873 include_directories : includes,
2874 link_with : lib_common,
2875 install_dir : usrbin_exec_dir,
2877 build_by_default : opt)
2879 if opt and not is_disabler(exe)
2880 exes += [exe, exe2, exe3, exe4]
2881 manadocs += ['schedutils/chrt.1.adoc',
2882 'schedutils/ionice.1.adoc',
2883 'schedutils/taskset.1.adoc',
2884 'schedutils/uclampset.1.adoc']
2885 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2888 ############################################################
2890 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2895 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2896 include_directories : dir_include,
2897 link_with : lib_common)
2903 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2904 include_directories : dir_include,
2905 link_with : lib_common)
2911 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2912 include_directories : dir_include,
2913 link_with : lib_common)
2919 c_args : ['-DTEST_PROGRAM_MANGLE'],
2920 include_directories : dir_include)
2926 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2927 include_directories : dir_include)
2933 'lib/color-names.c',
2934 c_args : ['-DTEST_PROGRAM_COLORS'],
2935 include_directories : dir_include,
2936 link_with : [lib_common, lib_tcolors])
2942 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2943 include_directories : dir_include)
2946 # XXX: HAVE_OPENAT && HAVE_DIRFD
2950 c_args : ['-DTEST_PROGRAM_PROCFS'],
2951 include_directories : dir_include,
2952 link_with : lib_common)
2955 # XXX: HAVE_OPENAT && HAVE_DIRFD
2960 have_cpu_set_t ? 'lib/cpuset.c' : [],
2961 c_args : ['-DTEST_PROGRAM_PATH'],
2962 include_directories : dir_include,
2963 link_with : lib_common)
2971 c_args : ['-DTEST_PROGRAM_PTY'],
2972 include_directories : dir_include,
2973 link_with : [lib_common],
2974 dependencies : [lib_m,
2983 c_args : ['-DTEST_PROGRAM_CPUSET'],
2984 include_directories : dir_include)
2994 have_cpu_set_t ? 'lib/cpuset.c' : [],
2995 c_args : ['-DTEST_PROGRAM_SYSFS'],
2996 include_directories : dir_include)
3002 c_args : ['-DTEST_PROGRAM_PAGER'],
3003 include_directories : dir_include)
3007 'test_linux_version',
3008 'lib/linux_version.c',
3009 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3010 include_directories : dir_include)
3016 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3017 include_directories : dir_include)
3021 'test_canonicalize',
3022 'lib/canonicalize.c',
3023 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3024 include_directories : dir_include)
3031 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3032 include_directories : dir_include)
3038 c_args : ['-DTEST_PROGRAM'],
3039 include_directories : dir_include,
3040 link_with : lib_common)
3046 c_args : ['-DTEST_PROGRAM'],
3047 include_directories : dir_include,
3048 link_with : [lib_common, logindefs_c])
3052 ############################################################
3056 'libuuid/src/test_uuid.c',
3057 include_directories : [dir_include, dir_libuuid],
3058 link_with : lib_uuid,
3059 dependencies : socket_libs)
3060 if not is_disabler(exe)
3064 ############################################################
3066 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3068 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3072 'libfdisk/src/ask.c',
3073 c_args : libfdisk_tests_cflags,
3074 include_directories : lib_fdisk_includes,
3075 link_with : libfdisk_tests_ldadd)
3076 if not is_disabler(exe)
3082 'libfdisk/src/gpt.c',
3083 c_args : libfdisk_tests_cflags,
3084 include_directories : lib_fdisk_includes,
3085 link_with : libfdisk_tests_ldadd)
3086 if not is_disabler(exe)
3092 'libfdisk/src/utils.c',
3093 c_args : libfdisk_tests_cflags,
3094 include_directories : lib_fdisk_includes,
3095 link_with : libfdisk_tests_ldadd)
3096 if not is_disabler(exe)
3101 'test_fdisk_script',
3102 'libfdisk/src/script.c',
3103 c_args : libfdisk_tests_cflags,
3104 include_directories : lib_fdisk_includes,
3105 link_with : libfdisk_tests_ldadd)
3106 if not is_disabler(exe)
3111 'test_fdisk_version',
3112 'libfdisk/src/version.c',
3113 c_args : libfdisk_tests_cflags,
3114 include_directories : lib_fdisk_includes,
3115 link_with : libfdisk_tests_ldadd)
3116 if not is_disabler(exe)
3122 'libfdisk/src/item.c',
3123 c_args : libfdisk_tests_cflags,
3124 include_directories : lib_fdisk_includes,
3125 link_with : libfdisk_tests_ldadd)
3126 if not is_disabler(exe)
3130 sample_fdisk_cflags = ['-Wno-unused']
3131 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3134 'sample-fdisk-mkpart',
3135 'libfdisk/samples/mkpart.c',
3136 c_args : sample_fdisk_cflags,
3137 include_directories : lib_fdisk_includes,
3138 link_with : sample_fdisk_ldadd)
3139 if not is_disabler(exe)
3144 'sample-fdisk-mkpart-fullspec',
3145 'libfdisk/samples/mkpart-fullspec.c',
3146 c_args : sample_fdisk_cflags,
3147 include_directories : lib_fdisk_includes,
3148 link_with : sample_fdisk_ldadd)
3149 if not is_disabler(exe)
3153 ############################################################
3157 'tests/helpers/test_mbsencode.c',
3158 include_directories : includes,
3159 link_with : lib_common)
3164 'tests/helpers/test_byteswap.c',
3165 include_directories : includes)
3170 'tests/helpers/test_md5.c',
3172 include_directories : includes)
3177 'tests/helpers/test_sha1.c',
3179 include_directories : includes)
3184 'tests/helpers/test_pathnames.c',
3185 include_directories : includes)
3190 'tests/helpers/test_strerror.c',
3191 include_directories : includes)
3196 'tests/helpers/test_sysinfo.c',
3197 include_directories : includes)
3202 'tests/helpers/test_sigreceive.c',
3203 include_directories : includes,
3204 link_with : lib_common)
3209 'tests/helpers/test_tiocsti.c',
3210 include_directories : includes)
3214 'test_uuid_namespace',
3215 'tests/helpers/test_uuid_namespace.c',
3219 include_directories : includes)
3225 'tests/helpers/test_mkfds.c',
3226 include_directories : includes)
3229 ############################################################
3233 'sample-scols-tree',
3234 'libsmartcols/samples/tree.c',
3235 include_directories : includes,
3236 link_with : [lib_smartcols, lib_common])
3237 if not is_disabler(exe)
3242 'sample-scols-title',
3243 'libsmartcols/samples/title.c',
3244 include_directories : includes,
3245 link_with : [lib_smartcols, lib_common])
3246 if not is_disabler(exe)
3251 'sample-scols-wrap',
3252 'libsmartcols/samples/wrap.c',
3253 include_directories : includes,
3254 link_with : [lib_smartcols, lib_common])
3255 if not is_disabler(exe)
3260 'sample-scols-continuous',
3261 'libsmartcols/samples/continuous.c',
3262 include_directories : includes,
3263 link_with : [lib_smartcols, lib_common])
3264 if not is_disabler(exe)
3269 'sample-scols-maxout',
3270 'libsmartcols/samples/maxout.c',
3271 include_directories : includes,
3272 link_with : [lib_smartcols, lib_common])
3273 if not is_disabler(exe)
3278 'sample-scols-fromfile',
3279 'libsmartcols/samples/fromfile.c',
3280 include_directories : includes,
3281 link_with : [lib_smartcols, lib_common])
3282 if not is_disabler(exe)
3287 'sample-scols-grouping-simple',
3288 'libsmartcols/samples/grouping-simple.c',
3289 include_directories : includes,
3290 link_with : [lib_smartcols, lib_common])
3291 if not is_disabler(exe)
3296 'sample-scols-grouping-overlay',
3297 'libsmartcols/samples/grouping-overlay.c',
3298 include_directories : includes,
3299 link_with : [lib_smartcols, lib_common])
3300 if not is_disabler(exe)
3304 ############################################################
3306 # Let the test runner know whether we're running under asan and export
3307 # some paths. We use a file on disk so that it is possible to run the
3308 # test scripts from commandline without setting any variables.
3309 configure_file(output : 'meson.conf',
3314 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3317 run_sh = find_program('tests/run.sh')
3321 '--srcdir=' + meson.current_source_dir(),
3322 '--builddir=' + meson.current_build_dir(),
3328 manadocs += ['lib/terminal-colors.d.5.adoc']
3329 manadocs += ['libblkid/libblkid.3.adoc']
3333 'libuuid/man/uuid.3.adoc',
3334 'libuuid/man/uuid_clear.3.adoc',
3335 'libuuid/man/uuid_compare.3.adoc',
3336 'libuuid/man/uuid_copy.3.adoc',
3337 'libuuid/man/uuid_generate.3.adoc',
3338 'libuuid/man/uuid_is_null.3.adoc',
3339 'libuuid/man/uuid_parse.3.adoc',
3340 'libuuid/man/uuid_time.3.adoc',
3341 'libuuid/man/uuid_unparse.3.adoc']
3343 'uuid_generate_random.3': 'uuid_generate.3',
3344 'uuid_generate_time.3': 'uuid_generate.3',
3345 'uuid_generate_time_safe.3': 'uuid_generate.3',
3349 asciidoctor = find_program('asciidoctor', required : false)
3350 if asciidoctor.found()
3351 foreach adoc : manadocs
3352 name = adoc.split('/')[-1]
3353 page = name.split('.adoc')[0]
3354 section = page.split('.')[-1]
3355 mandirn = join_paths(mandir, 'man' + section)
3360 command : [ asciidoctor,
3362 '-a', 'VERSION=' + meson.project_version(),
3363 '-a', 'release-version=' + meson.project_version(),
3364 '-a', 'ADJTIME_PATH=/etc/adjtime',
3365 '-a', 'package-docdir=' + docdir,
3366 '--base-dir=' + meson.current_source_dir(),
3367 '--destination-dir=' + meson.current_build_dir(),
3368 '--load-path', '@SOURCE_ROOT@/tools',
3369 '--require', 'asciidoctor-includetracker',
3373 depfile : page + '.deps',
3375 install_dir : mandirn)
3378 foreach link_name, target : manlinks
3379 link_section = link_name.split('.')[-1]
3380 target_section = target.split('.')[-1]
3381 meson.add_install_script(meson_make_manpage_stub,
3382 join_paths('man' + target_section, target),
3383 join_paths(mandir, 'man' + link_section, link_name))
3387 if bash_completion.found()
3388 foreach completion : bashcompletions
3390 join_paths('bash-completion', completion),
3391 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3394 foreach link_name, target : bashcompletionslinks
3395 meson.add_install_script(meson_make_symlink,
3397 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))