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
214 lib_m = cc.find_library('m')
216 lib_tinfo = dependency(
218 required : get_option('tinfo'))
220 lib_ncursesw = dependency(
222 required : get_option('ncursesw'))
223 if lib_ncursesw.found()
224 headers += ['ncursesw/ncurses.h',
228 lib_ncurses = disabler()
230 lib_ncurses = dependency(
232 required : get_option('ncurses'))
233 headers += ['ncurses.h',
237 conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
238 conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
239 conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
241 lib_slang = dependency(
243 required : get_option('slang'))
245 headers += ['slang.h',
250 conf.set('HAVE_SLANG', lib_slang.found())
252 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
253 if curses_libs.found()
254 have = cc.has_function('use_default_colors', dependencies : curses_libs)
255 conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false)
256 have = cc.has_function('resizeterm', dependencies : curses_libs)
257 conf.set('HAVE_RESIZETERM', have ? 1 : false)
264 required : get_option('zlib'))
266 lib_readline = dependency(
268 required : get_option('readline'))
269 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
271 lib_readline_static = dependency(
274 required : need_static_libs ? get_option('readline') : disabler())
276 if meson.version().version_compare('>= 0.59.0')
277 lib_intl = dependency(
279 required : get_option('nls'))
280 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
282 if get_option('nls').enabled()
283 error('nls is not supported with meson before 0.59.0')
285 lib_intl = dependency('', required : false)
288 lib_user = dependency(
291 required : get_option('libuser'))
292 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
294 lib_util = cc.find_library(
296 required : get_option('libutil'))
297 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
299 lib_utempter = cc.find_library(
301 required : get_option('libutempter'))
302 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
304 systemd = dependency(
306 required : get_option('systemd'))
308 lib_systemd = dependency(
310 required : get_option('systemd'))
311 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
313 lib_udev = dependency(
315 required : get_option('systemd'))
316 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
318 lib_crypt = cc.find_library('crypt')
320 lib_pam = cc.find_library('pam', required : get_option('build-login'))
321 if not lib_pam.found()
322 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
324 if not lib_pam.found()
325 lib_pam = cc.find_library('pam', required : get_option('build-su'))
327 if not lib_pam.found()
328 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
331 lib_pam_misc = cc.find_library('pam_misc')
332 lib_pam = [lib_pam, lib_pam_misc]
334 lib_pam_misc = declare_dependency()
337 lib_cryptsetup = dependency(
339 required : get_option('cryptsetup'))
340 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
342 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
343 if meson.version().version_compare('>= 0.62.0')
344 lib_dl = dependency('dl')
346 lib_dl = cc.find_library('dl')
348 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
349 summary('cryptsetup support (dlopen)',
351 section : 'components')
353 summary('cryptsetup support',
354 lib_cryptsetup.found() ? 'enabled' : 'disabled',
355 section : 'components')
358 have = cc.has_function(
359 'crypt_activate_by_signed_key',
360 dependencies : lib_cryptsetup)
361 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
363 lib_cap_ng = dependency(
365 required : get_option('build-setpriv'))
367 lib_selinux = dependency(
370 required : get_option('selinux'))
371 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
373 lib_magic = dependency(
375 required : get_option('magic'))
376 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
378 lib_econf = dependency(
380 required : get_option('econf'))
381 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
383 lib_audit = dependency(
385 required : get_option('audit'))
386 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
388 conf.set('HAVE_SMACK', not get_option('smack').disabled())
390 foreach header : headers
391 have = cc.has_header(header)
392 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
395 header = 'linux/btrfs.h'
396 enable_btrfs = cc.has_header(header,
397 required : get_option('btrfs'))
398 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
399 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
401 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
406 have = cc.has_header(header,
408 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
411 have = cc.has_header('sched.h')
412 conf.set10('HAVE_DECL_CPU_ALLOC', have)
413 # We get -1 if the size cannot be determined
414 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
415 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
417 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
418 conf.set10('HAVE_ENVIRON_DECL', have)
420 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
421 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
423 have = cc.has_function('strsignal')
424 conf.set10('HAVE_STRSIGNAL_DECL', have)
426 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
427 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
429 have = cc.compiles('''
430 #define _GNU_SOURCE 1
431 #include <langinfo.h>
434 str = nl_langinfo (ALTMON_1);
435 str = nl_langinfo (ALTMON_2);
436 str = nl_langinfo (ALTMON_3);
437 str = nl_langinfo (ALTMON_4);
438 str = nl_langinfo (ALTMON_5);
439 str = nl_langinfo (ALTMON_6);
440 str = nl_langinfo (ALTMON_7);
441 str = nl_langinfo (ALTMON_8);
442 str = nl_langinfo (ALTMON_9);
443 str = nl_langinfo (ALTMON_10);
444 str = nl_langinfo (ALTMON_11);
445 str = nl_langinfo (ALTMON_12);
449 name : 'langinfo.h defines ALTMON_x constants')
450 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
452 have = cc.compiles('''
453 #define _GNU_SOURCE 1
454 #include <langinfo.h>
457 str = nl_langinfo (_NL_ABALTMON_1);
458 str = nl_langinfo (_NL_ABALTMON_2);
459 str = nl_langinfo (_NL_ABALTMON_3);
460 str = nl_langinfo (_NL_ABALTMON_4);
461 str = nl_langinfo (_NL_ABALTMON_5);
462 str = nl_langinfo (_NL_ABALTMON_6);
463 str = nl_langinfo (_NL_ABALTMON_7);
464 str = nl_langinfo (_NL_ABALTMON_8);
465 str = nl_langinfo (_NL_ABALTMON_9);
466 str = nl_langinfo (_NL_ABALTMON_10);
467 str = nl_langinfo (_NL_ABALTMON_11);
468 str = nl_langinfo (_NL_ABALTMON_12);
472 name : 'langinfo.h defines _NL_ABALTMON_x constants')
473 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
564 have = cc.has_function(func)
565 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
566 # This makes little sense, but is necessary to avoid warnings about
567 # redefined macros from Python.h, which uses this convention.
568 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
571 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
572 conf.set('AGETTY_RELOAD', have ? 1 : false)
574 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
577 have_dirfd = (cc.has_function('dirfd') or
578 cc.has_header_symbol('dirent.h', 'dirfd',
579 prefix : '#include <sys/types.h>'))
580 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
582 have_ddfd = cc.has_member('DIR', 'dd_fd',
584 #include <sys/types.h>
587 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
589 have = cc.has_member('struct tm', 'tm_gmtoff',
594 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
598 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
599 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
601 have = cc.has_member('struct termios', 'c_line',
602 prefix : '#include <termios.h>')
603 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
605 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
606 prefix : '#include <sys/stat.h>')
607 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
609 # replacement for AC_STRUCT_TIMEZONE
610 have = cc.has_member('struct tm', 'tm_zone',
611 prefix : '#include <time.h>')
612 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
614 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
615 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
620 extern char *tzname[];
623 return tzname ? 0 : 1;
625 '''.format(have ? 1 : 0)
626 have = cc.compiles(code, name : 'using tzname[]')
627 conf.set('HAVE_TZNAME', have ? 1 : false)
630 if not cc.has_function('socket')
631 socket_libs += cc.find_library('socket', required : true)
632 have = cc.has_function('socket',
633 dependencies : socket_libs)
635 error('socket() function not available')
640 have = cc.has_function('clock_gettime')
642 realtime_libs += cc.find_library('rt', required : true)
643 have = cc.has_function('clock_gettime',
644 dependencies : realtime_libs)
646 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
648 thread_libs = dependency('threads')
650 have = cc.has_function('timer_create')
652 realtime_libs = [cc.find_library('rt', required : true)]
653 have = cc.has_function('timer_create',
654 dependencies : realtime_libs)
656 realtime_libs += thread_libs
657 have = cc.has_function('timer_create',
658 dependencies : realtime_libs)
661 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
663 have = cc.has_function('setitimer')
664 conf.set('HAVE_SETITIMER', have ? 1 : false)
667 rtas_libs = cc.find_library('rtas', required : false)
668 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
671 if not cc.has_header_symbol('math.h', 'isnan')
672 lib = cc.find_library('m', required : true)
673 if (cc.has_function('isnan', dependencies : lib) and
674 cc.has_function('__isnan', dependencies : lib))
679 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
680 args : '-D_GNU_SOURCE')
681 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
684 extern char *__progname;
686 return (*__progname != 0);
689 have = cc.compiles(code, name : 'using __progname')
690 conf.set('HAVE___PROGNAME', have ? 1 : false)
692 build_plymouth_support = get_option('build-plymouth-support')
693 have_tiocglcktrmios = cc.has_header_symbol(
694 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
695 required : build_plymouth_support.enabled())
696 have_sock_cloexec = cc.has_header_symbol(
697 'sys/socket.h', 'SOCK_CLOEXEC',
698 prefix : '#include <sys/types.h>',
699 required : build_plymouth_support.enabled())
700 have_sock_nonblock = cc.has_header_symbol(
701 'sys/socket.h', 'SOCK_NONBLOCK',
702 prefix : '#include <sys/types.h>',
703 required : build_plymouth_support.enabled())
704 have_so_passcred = cc.has_header_symbol(
705 'sys/socket.h', 'SO_PASSCRED',
706 prefix : '#include <sys/types.h>',
707 required : build_plymouth_support.enabled())
709 build_plymouth_support = (not build_plymouth_support.disabled() and
710 have_tiocglcktrmios and
711 have_sock_cloexec and
712 have_sock_nonblock and
714 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
715 summary('plymouth support',
716 build_plymouth_support ? 'enabled' : 'disabled',
717 section : 'components')
719 # check for valid fallocate() function
720 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
721 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
722 # and program can't be linked.
730 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
731 return ret == 0 ? 0 : 1;
734 have = cc.links(code, name : 'fallocate() function')
735 conf.set('HAVE_FALLOCATE', have ? 1 : false)
743 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
744 return ret == 0 ? 0 : 1;
747 have = cc.links(code, name : 'posix_fallocate() function')
748 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
750 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
751 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
752 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
754 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
755 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
756 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
758 ############################################################
761 fs_search_path = get_option('fs-search-path')
762 fs_search_path_extra = get_option('fs-search-path-extra')
763 if fs_search_path_extra != ''
764 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
766 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
768 systemdsystemunitdir = ''
770 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
773 sysvinit = get_option('sysvinit').enabled()
774 sysvinitrcdir = sysconfdir + '/init.d'
776 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
777 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
779 have = get_option('chsh-only-listed')
780 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
782 have = get_option('use-tty-group')
783 conf.set('USE_TTY_GROUP', have ? 1 : false)
785 build_hwclock = not get_option('build-hwclock').disabled()
786 bison = find_program('bison', required: build_hwclock)
787 bison_gen = generator(
789 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
790 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
794 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
795 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
799 configuration : conf)
801 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
806 '-Waddress-of-packed-member',
807 '-Wdiscarded-qualifiers',
808 '-Wembedded-directive',
811 '-Wimplicit-function-declaration',
812 '-Wmissing-declarations',
813 '-Wmissing-parameter-type',
814 '-Wmissing-prototypes',
816 '-Wno-missing-field-initializers',
817 '-Wold-style-definition',
821 '-Wstrict-prototypes',
824 '-Wunused-but-set-parameter',
825 '-Wunused-but-set-variable',
826 '-Wunused-parameter',
830 foreach compiler_flag : compiler_flags
831 if cc.has_argument(compiler_flag)
832 add_project_arguments(compiler_flag, language : 'c')
840 bashcompletionslinks = {}
846 subdir('libsmartcols')
849 subdir('login-utils')
857 includes = [dir_include,
867 opt = not get_option('build-chfn-chsh').disabled()
872 include_directories : includes,
873 link_with : [lib_common, logindefs_c],
874 dependencies : chfn_chsh_deps,
875 install_dir : usrbin_exec_dir,
877 build_by_default : opt)
881 'login-utils/chsh.c',
884 include_directories : includes,
885 link_with : lib_common,
886 dependencies : chfn_chsh_deps,
887 install_dir : usrbin_exec_dir,
889 build_by_default : opt)
890 if opt and not is_disabler(exe)
892 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
893 bashcompletions += ['chfn', 'chsh']
898 test_islocal_sources,
899 include_directories : includes,
900 c_args : '-DTEST_PROGRAM')
905 test_consoles_sources,
906 c_args : ['-DTEST_PROGRAM'],
907 include_directories : includes,
908 link_with : lib_common)
911 opt = not get_option('build-last').disabled()
915 include_directories : includes,
916 link_with : [lib_common],
917 install_dir : usrbin_exec_dir,
919 build_by_default : opt)
920 if opt and not is_disabler(exe)
922 meson.add_install_script(meson_make_symlink,
924 join_paths(usrbin_exec_dir, 'lastb'))
925 manadocs += ['login-utils/last.1.adoc']
926 manlinks += {'lastb.1': 'last.1'}
927 bashcompletions += ['last']
928 bashcompletionslinks += {'lastb': 'last'}
931 opt = not get_option('build-nologin').disabled()
934 'login-utils/nologin.c',
935 include_directories : includes,
936 install_dir : sbindir,
937 link_with : [lib_common],
939 build_by_default : opt)
940 if opt and not is_disabler(exe)
942 manadocs += ['login-utils/nologin.8.adoc']
945 opt = not get_option('build-utmpdump').disabled()
948 'login-utils/utmpdump.c',
949 include_directories : includes,
950 link_with : [lib_common],
951 install_dir : usrbin_exec_dir,
953 build_by_default : opt)
954 if opt and not is_disabler(exe)
956 manadocs += ['login-utils/utmpdump.1.adoc']
957 bashcompletions += ['utmpdump']
960 opt = not get_option('build-su').disabled()
964 'login-utils/su-common.c',
965 'login-utils/su-common.h',
969 include_directories : includes,
970 link_with : [lib_common, logindefs_c],
971 dependencies : [lib_pam,
976 build_by_default : opt)
977 if opt and not is_disabler(exe)
979 manadocs += ['login-utils/su.1.adoc']
980 bashcompletions += ['su']
983 opt = not get_option('build-newgrp').disabled()
986 'login-utils/newgrp.c',
987 include_directories : includes,
988 dependencies : [lib_crypt],
989 install_dir : usrbin_exec_dir,
991 build_by_default : opt)
992 if opt and not is_disabler(exe)
994 manadocs += ['login-utils/newgrp.1.adoc']
997 opt = not get_option('build-lslogins').disabled()
1000 'login-utils/lslogins.c',
1001 include_directories : includes,
1002 link_with : [lib_common,
1005 dependencies : [lib_selinux,
1007 install_dir : usrbin_exec_dir,
1009 build_by_default : opt)
1010 if opt and not is_disabler(exe)
1012 manadocs += ['login-utils/lslogins.1.adoc']
1013 bashcompletions += ['lslogins']
1016 opt = not get_option('build-vipw').disabled()
1019 'login-utils/vipw.c',
1020 'login-utils/setpwnam.h',
1021 include_directories : includes,
1022 link_with : [lib_common],
1023 dependencies : [lib_selinux],
1024 install_dir : usrbin_exec_dir,
1026 build_by_default : opt)
1027 if opt and not is_disabler(exe)
1029 meson.add_install_script(meson_make_symlink,
1031 join_paths(usrbin_exec_dir, 'vigr'))
1032 manadocs += ['login-utils/vipw.8.adoc']
1035 opt = not get_option('build-runuser').disabled()
1038 'login-utils/runuser.c',
1039 'login-utils/su-common.c',
1040 'login-utils/su-common.h',
1044 include_directories : includes,
1045 link_with : [lib_common, logindefs_c],
1046 dependencies : [lib_pam,
1050 install_dir : sbindir,
1052 build_by_default : opt)
1053 if opt and not is_disabler(exe)
1055 manadocs += ['login-utils/runuser.1.adoc']
1056 bashcompletionslinks += {'runuser': 'su'}
1059 ############################################################
1064 include_directories : includes,
1065 link_with : lib_common,
1066 install_dir : usrbin_exec_dir,
1069 manadocs += ['text-utils/col.1.adoc']
1070 bashcompletions += ['col']
1075 include_directories : includes,
1076 install_dir : usrbin_exec_dir,
1079 manadocs += ['text-utils/colcrt.1.adoc']
1080 bashcompletions += ['colcrt']
1085 include_directories : includes,
1086 link_with : lib_common,
1087 install_dir : usrbin_exec_dir,
1090 manadocs += ['text-utils/colrm.1.adoc']
1091 bashcompletions += ['colrm']
1096 include_directories : includes,
1097 install_dir : usrbin_exec_dir,
1100 manadocs += ['text-utils/rev.1.adoc']
1101 bashcompletions += ['rev']
1106 include_directories : includes,
1107 link_with : [lib_common,
1109 install_dir : usrbin_exec_dir,
1111 if not is_disabler(exe)
1113 manadocs += ['text-utils/column.1.adoc']
1114 bashcompletions += ['column']
1117 opt = not get_option('build-line').disabled()
1121 include_directories : includes,
1122 install_dir : usrbin_exec_dir,
1124 build_by_default : opt)
1125 if opt and not is_disabler(exe)
1127 manadocs += ['text-utils/line.1.adoc']
1130 opt = not get_option('build-pg').disabled()
1134 link_with : lib_common,
1135 include_directories : includes,
1136 dependencies : [lib_tinfo,
1138 install_dir : usrbin_exec_dir,
1140 build_by_default : opt)
1141 if opt and not is_disabler(exe)
1143 manadocs += ['text-utils/pg.1.adoc']
1144 bashcompletions += ['pg']
1147 opt = not get_option('build-ul').disabled()
1151 include_directories : includes,
1152 dependencies : [lib_tinfo,
1154 install_dir : usrbin_exec_dir,
1156 build_by_default : opt)
1157 if opt and not is_disabler(exe)
1159 manadocs += ['text-utils/ul.1.adoc']
1160 bashcompletions += ['ul']
1163 opt = not get_option('build-more').disabled()
1167 link_with : [lib_common],
1168 include_directories : includes,
1169 dependencies : [lib_tinfo,
1173 build_by_default : opt)
1177 link_with : [lib_common],
1178 include_directories : includes,
1179 c_args : '-DTEST_PROGRAM',
1180 dependencies : [lib_tinfo,
1183 build_by_default : opt)
1185 if opt and not is_disabler(exe)
1187 manadocs += ['text-utils/more.1.adoc']
1188 bashcompletions += ['more']
1194 include_directories : includes,
1195 link_with : [lib_common,
1197 install_dir : usrbin_exec_dir,
1199 if not is_disabler(exe)
1201 manadocs += ['text-utils/hexdump.1.adoc']
1202 bashcompletions += ['hexdump']
1205 opt = not get_option('build-lsmem').disabled()
1209 include_directories : includes,
1210 link_with : [lib_common,
1212 install_dir : usrbin_exec_dir,
1214 build_by_default : opt)
1215 if opt and not is_disabler(exe)
1217 manadocs += ['sys-utils/lsmem.1.adoc']
1218 bashcompletions += ['lsmem']
1221 opt = not get_option('build-chmem').disabled()
1225 include_directories : includes,
1226 link_with : [lib_common],
1227 install_dir : usrbin_exec_dir,
1229 build_by_default : opt)
1230 if opt and not is_disabler(exe)
1232 manadocs += ['sys-utils/chmem.8.adoc']
1233 bashcompletions += ['chmem']
1239 include_directories : includes,
1240 link_with : [lib_common],
1241 install_dir : usrbin_exec_dir,
1244 manadocs += ['sys-utils/choom.1.adoc']
1249 include_directories : includes,
1250 link_with : [lib_common],
1251 install_dir : usrbin_exec_dir,
1254 manadocs += ['sys-utils/ipcmk.1.adoc']
1255 bashcompletions += ['ipcmk']
1260 include_directories : includes,
1261 link_with : [lib_common],
1262 install_dir : usrbin_exec_dir,
1265 manadocs += ['sys-utils/ipcrm.1.adoc']
1266 bashcompletions += ['ipcrm']
1268 opt = not get_option('build-ipcs').disabled()
1272 include_directories : includes,
1273 link_with : [lib_common],
1274 install_dir : usrbin_exec_dir,
1276 build_by_default : opt)
1277 if opt and not is_disabler(exe)
1279 manadocs += ['sys-utils/ipcs.1.adoc']
1280 bashcompletions += ['ipcs']
1283 opt = not get_option('build-rfkill').disabled()
1287 include_directories : includes,
1288 link_with : [lib_common,
1290 install_dir : usrsbin_exec_dir,
1292 build_by_default : opt)
1293 if opt and not is_disabler(exe)
1295 manadocs += ['sys-utils/rfkill.8.adoc']
1296 bashcompletions += ['rfkill']
1302 include_directories : includes,
1303 link_with : [lib_common,
1305 install_dir : usrbin_exec_dir,
1307 if not is_disabler(exe)
1309 manadocs += ['sys-utils/renice.1.adoc']
1310 bashcompletions += ['renice']
1316 include_directories : includes,
1317 link_with : [lib_common,
1319 install_dir : usrbin_exec_dir,
1321 if opt and not is_disabler(exe)
1323 manadocs += ['sys-utils/setsid.1.adoc']
1324 bashcompletions += ['setsid']
1329 readprofile_sources,
1330 include_directories : includes,
1331 link_with : [lib_common,
1333 install_dir : usrsbin_exec_dir,
1335 if not is_disabler(exe)
1337 manadocs += ['sys-utils/readprofile.8.adoc']
1338 bashcompletions += ['readprofile']
1341 opt = not get_option('build-tunelp').disabled()
1345 include_directories : includes,
1346 link_with : [lib_common],
1347 install_dir : usrsbin_exec_dir,
1349 build_by_default : opt)
1350 if opt and not is_disabler(exe)
1352 manadocs += ['sys-utils/tunelp.8.adoc']
1353 bashcompletions += ['tunelp']
1359 include_directories : includes,
1360 link_with : [lib_common,
1362 install_dir : sbindir,
1364 if not is_disabler(exe)
1366 manadocs += ['sys-utils/fstrim.8.adoc']
1367 bashcompletions += ['fstrim']
1373 include_directories : includes,
1374 link_with : [lib_common,
1377 if not is_disabler(exe)
1379 manadocs += ['sys-utils/dmesg.1.adoc']
1380 bashcompletions += ['dmesg']
1386 include_directories : dir_include,
1387 c_args : '-DTEST_DMESG',
1388 link_with : [lib_common,
1390 if not is_disabler(exe)
1397 include_directories : includes,
1398 link_with : [lib_common],
1399 install_dir : sbindir,
1402 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1403 bashcompletions += ['ctrlaltdel']
1408 include_directories : includes,
1409 install_dir : sbindir,
1412 manadocs += ['sys-utils/fsfreeze.8.adoc']
1413 bashcompletions += ['fsfreeze']
1418 include_directories : includes,
1419 link_with : [lib_common,
1421 install_dir : sbindir,
1424 manadocs += ['sys-utils/blkdiscard.8.adoc']
1425 bashcompletions += ['blkdiscard']
1430 include_directories : includes,
1431 link_with : [lib_common],
1432 install_dir : sbindir,
1435 manadocs += ['sys-utils/blkzone.8.adoc']
1436 bashcompletions += ['blkzone']
1441 include_directories : includes,
1442 link_with : [lib_common],
1443 install_dir : sbindir,
1446 manadocs += ['sys-utils/blkpr.8.adoc']
1451 include_directories : includes,
1452 link_with : [lib_common],
1453 install_dir : usrsbin_exec_dir,
1456 manadocs += ['sys-utils/ldattach.8.adoc']
1457 bashcompletions += ['ldattach']
1462 include_directories : includes,
1463 link_with : [lib_common],
1464 install_dir : usrsbin_exec_dir,
1467 manadocs += ['sys-utils/rtcwake.8.adoc']
1468 bashcompletions += ['rtcwake']
1473 include_directories : includes,
1474 link_with : [lib_common],
1475 install_dir : usrbin_exec_dir,
1478 manadocs += ['sys-utils/setarch.8.adoc']
1479 bashcompletions += ['setarch']
1481 setarch_links = ['uname26', 'linux32', 'linux64']
1482 setarch_links_arch = {
1483 's390x' : ['s390', 's390x'],
1485 'x86_64' : ['i386', 'x86_64'],
1486 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1487 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1488 'mips64' : ['mips', 'mips64', 'mips32'],
1489 'ia64' : ['i386', 'ia64'],
1490 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1492 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1494 foreach link: setarch_links
1495 meson.add_install_script(meson_make_symlink,
1497 join_paths(usrbin_exec_dir, link))
1498 manlinks += {link + '.8': 'setarch.8'}
1501 opt = not get_option('build-eject').disabled()
1505 include_directories : includes,
1506 link_with : [lib_common,
1508 install_dir : usrbin_exec_dir,
1510 build_by_default : opt)
1511 if opt and not is_disabler(exe)
1513 manadocs += ['sys-utils/eject.1.adoc']
1514 bashcompletions += ['eject']
1517 opt = not get_option('build-losetup').disabled()
1521 include_directories : includes,
1522 link_with : [lib_common,
1524 install_dir : sbindir,
1526 build_by_default : opt)
1527 if opt and not is_disabler(exe)
1528 manadocs += ['sys-utils/losetup.8.adoc']
1530 bashcompletions += ['losetup']
1533 opt = opt and 'losetup' in static_programs
1537 include_directories : includes,
1538 link_args : ['--static'],
1539 link_with : [lib_common,
1540 lib_smartcols.get_static_lib()],
1541 install_dir : sbindir,
1543 build_by_default : opt)
1544 if opt and not is_disabler(exe)
1548 opt = not get_option('build-zramctl').disabled()
1552 include_directories : includes,
1553 link_with : [lib_common,
1555 install_dir : sbindir,
1557 build_by_default : opt)
1558 if opt and not is_disabler(exe)
1560 manadocs += ['sys-utils/zramctl.8.adoc']
1561 bashcompletions += ['zramctl']
1567 include_directories : includes,
1568 link_with : [lib_common,
1570 install_dir : usrbin_exec_dir,
1572 if not is_disabler(exe)
1574 manadocs += ['sys-utils/prlimit.1.adoc']
1575 bashcompletions += ['prlimit']
1581 include_directories : includes,
1582 link_with : [lib_common,
1585 install_dir : usrbin_exec_dir,
1587 if not is_disabler(exe)
1589 manadocs += ['sys-utils/lsns.8.adoc']
1590 bashcompletions += ['lsns']
1593 opt = not get_option('build-mount').disabled()
1597 include_directories : includes,
1598 link_with : [lib_common,
1601 dependencies : lib_selinux,
1603 build_by_default : opt)
1607 include_directories : includes,
1608 link_with : [lib_common,
1611 build_by_default : opt)
1612 if opt and not is_disabler(exe)
1614 manadocs += ['sys-utils/fstab.5.adoc',
1615 'sys-utils/mount.8.adoc',
1616 'sys-utils/umount.8.adoc']
1617 bashcompletions += ['mount', 'umount']
1620 opt2 = opt and 'mount' in static_programs
1624 include_directories : includes,
1625 link_args : ['--static'],
1626 link_with : [lib_common,
1627 lib_smartcols_static,
1630 build_by_default : opt2)
1631 if opt2 and not is_disabler(exe)
1635 opt2 = opt and 'umount' in static_programs
1639 include_directories : includes,
1640 link_args : ['--static'],
1641 link_with : [lib_common,
1644 build_by_default : opt2)
1645 if opt2 and not is_disabler(exe)
1654 include_directories : includes,
1655 link_with : [lib_common,
1659 install_dir : sbindir,
1661 if not is_disabler(exe)
1663 manadocs += ['sys-utils/swapon.8.adoc']
1664 bashcompletions += ['swapon']
1670 include_directories : includes,
1671 link_with : [lib_common,
1674 install_dir : sbindir,
1676 if not is_disabler(exe)
1678 manlinks += {'swapoff.8': 'swapon.8'}
1679 bashcompletions += ['swapoff']
1685 include_directories : includes,
1686 link_with : [lib_common,
1688 dependencies : [rtas_libs],
1689 install_dir : usrbin_exec_dir,
1691 if not is_disabler(exe)
1693 manadocs += ['sys-utils/lscpu.1.adoc']
1694 bashcompletions += ['lscpu']
1700 include_directories : includes,
1701 link_with : [lib_common],
1702 install_dir : sbindir,
1705 manadocs += ['sys-utils/chcpu.8.adoc']
1706 bashcompletions += ['chcpu']
1711 include_directories : includes,
1712 link_with : [lib_common,
1715 if not is_disabler(exe)
1717 manadocs += ['sys-utils/wdctl.8.adoc']
1718 bashcompletions += ['wdctl']
1721 opt = not get_option('build-mountpoint').disabled()
1725 include_directories : includes,
1726 link_with : [lib_mount],
1728 build_by_default : opt)
1729 if opt and not is_disabler(exe)
1731 manadocs += ['sys-utils/mountpoint.1.adoc']
1732 bashcompletions += ['mountpoint']
1735 opt = not get_option('build-fallocate').disabled()
1739 include_directories : includes,
1740 link_with : [lib_common],
1741 install_dir : usrbin_exec_dir,
1743 build_by_default : opt)
1744 if opt and not is_disabler(exe)
1746 manadocs += ['sys-utils/fallocate.1.adoc']
1747 bashcompletions += ['fallocate']
1750 opt = not get_option('build-pivot_root').disabled()
1754 include_directories : includes,
1755 install_dir : sbindir,
1757 build_by_default : opt)
1758 if opt and not is_disabler(exe)
1760 manadocs += ['sys-utils/pivot_root.8.adoc']
1761 bashcompletions += ['pivot_root']
1764 opt = not get_option('build-switch_root').disabled()
1765 if opt and not have_dirfd and not have_ddfd
1766 error('neither dirfd nor ddfd are available')
1770 switch_root_sources,
1771 include_directories : includes,
1772 install_dir : sbindir,
1774 build_by_default : opt)
1775 if opt and not is_disabler(exe)
1777 manadocs += ['sys-utils/switch_root.8.adoc']
1780 opt = not get_option('build-unshare').disabled()
1784 include_directories : includes,
1785 link_with : [lib_common],
1786 install_dir : usrbin_exec_dir,
1788 build_by_default : opt)
1789 if opt and not is_disabler(exe)
1791 manadocs += ['sys-utils/unshare.1.adoc']
1792 bashcompletions += ['unshare']
1795 opt = opt and 'unshare' in static_programs
1799 include_directories : includes,
1800 link_with : [lib_common],
1801 install_dir : usrbin_exec_dir,
1803 build_by_default : opt)
1804 if opt and not is_disabler(exe)
1808 opt = not get_option('build-nsenter').disabled()
1812 include_directories : includes,
1813 link_with : [lib_common],
1814 dependencies : [lib_selinux],
1815 install_dir : usrbin_exec_dir,
1817 build_by_default : opt)
1818 if opt and not is_disabler(exe)
1820 manadocs += ['sys-utils/nsenter.1.adoc']
1821 bashcompletions += ['nsenter']
1824 opt = opt and 'nsenter' in static_programs
1828 include_directories : includes,
1829 link_with : [lib_common],
1830 dependencies : [lib_selinux],
1831 install_dir : usrbin_exec_dir,
1833 build_by_default : opt)
1834 if opt and not is_disabler(exe)
1838 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1842 include_directories : includes,
1843 link_with : [lib_common],
1844 dependencies : [lib_cap_ng],
1845 install_dir : usrbin_exec_dir,
1847 build_by_default : opt)
1848 if opt and not is_disabler(exe)
1850 manadocs += ['sys-utils/setpriv.1.adoc']
1851 bashcompletions += ['setpriv']
1857 include_directories : includes,
1858 link_with : [lib_common],
1859 dependencies : realtime_libs,
1860 install_dir : usrbin_exec_dir,
1863 manadocs += ['sys-utils/flock.1.adoc']
1864 bashcompletions += ['flock']
1866 opt = not get_option('build-lsirq').disabled()
1870 include_directories : includes,
1871 link_with : [lib_common,
1873 install_dir : usrbin_exec_dir,
1875 build_by_default : opt)
1876 if opt and not is_disabler(exe)
1878 manadocs += ['sys-utils/lsirq.1.adoc']
1879 bashcompletions += ['lsirq']
1882 opt = not get_option('build-irqtop').disabled()
1886 include_directories : includes,
1887 dependencies : [realtime_libs, curses_libs],
1888 link_with : [lib_common,
1891 install_dir : usrbin_exec_dir,
1893 build_by_default : opt)
1894 if opt and not is_disabler(exe)
1896 manadocs += ['sys-utils/irqtop.1.adoc']
1897 bashcompletions += ['irqtop']
1900 opt = not get_option('build-ipcs').disabled()
1904 include_directories : includes,
1905 link_with : [lib_common,
1907 install_dir : usrbin_exec_dir,
1909 build_by_default : opt)
1910 if opt and not is_disabler(exe)
1912 manadocs += ['sys-utils/lsipc.1.adoc']
1913 bashcompletions += ['lsipc']
1920 include_directories : includes,
1921 link_with : [lib_common],
1922 dependencies : [lib_m,
1924 install_dir : sbindir,
1926 build_by_default : opt)
1927 if opt and not is_disabler(exe)
1929 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1930 bashcompletions += ['hwclock']
1936 include_directories : includes,
1937 install_dir : sbindir,
1940 manadocs += ['disk-utils/mkfs.8.adoc']
1941 bashcompletions += ['mkfs']
1943 opt = not get_option('build-bfs').disabled()
1947 include_directories : includes,
1948 link_with : [lib_common],
1949 install_dir : sbindir,
1951 build_by_default : opt)
1952 if opt and not is_disabler(exe)
1954 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1955 bashcompletions += ['mkfs.bfs']
1961 include_directories : includes,
1962 link_with : [lib_common],
1963 install_dir : usrbin_exec_dir,
1966 manadocs += ['disk-utils/isosize.8.adoc']
1967 bashcompletions += ['isosize']
1972 include_directories : includes,
1973 link_with : [lib_common,
1976 dependencies: [lib_selinux],
1977 install_dir : sbindir,
1979 if opt and not is_disabler(exe)
1981 manadocs += ['disk-utils/mkswap.8.adoc']
1982 bashcompletions += ['mkswap']
1988 include_directories : includes,
1989 link_with : [lib_common,
1992 install_dir : sbindir,
1994 if opt and not is_disabler(exe)
1996 manadocs += ['disk-utils/swaplabel.8.adoc']
1997 bashcompletions += ['swaplabel']
2000 opt = not get_option('build-fsck').disabled()
2004 include_directories : includes,
2005 link_with : [lib_common,
2008 dependencies : realtime_libs,
2009 install_dir : sbindir,
2011 build_by_default : opt)
2012 if opt and not is_disabler(exe)
2014 manadocs += ['disk-utils/fsck.8.adoc']
2015 bashcompletions += ['fsck']
2018 opt = not get_option('build-minix').disabled()
2022 include_directories : includes,
2023 link_with : [lib_common],
2024 install_dir : sbindir,
2026 build_by_default : opt)
2030 include_directories : includes,
2031 c_args : '-DTEST_SCRIPT',
2032 link_with : [lib_common],
2033 build_by_default : opt)
2037 include_directories : includes,
2038 link_with : [lib_common],
2039 install_dir : sbindir,
2041 build_by_default : opt)
2042 if opt and not is_disabler(exe)
2043 exes += [exe, exe2, exe3]
2044 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2045 bashcompletions += ['mkfs.minix', 'fsck.minix']
2048 opt = not get_option('build-cramfs').disabled()
2051 mkfs_cramfs_sources,
2052 include_directories : includes,
2053 link_with : [lib_common],
2054 dependencies : [lib_z],
2055 install_dir : sbindir,
2057 build_by_default : opt)
2060 fsck_cramfs_sources,
2061 include_directories : includes,
2062 link_with : [lib_common],
2063 dependencies : [lib_z],
2064 install_dir : sbindir,
2066 build_by_default : opt)
2067 if not is_disabler(exe)
2069 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2070 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2073 opt = not get_option('build-raw').disabled()
2075 cc.has_header('linux/raw.h', required: opt)
2080 include_directories : includes,
2081 install_dir : sbindir,
2083 build_by_default : opt)
2084 if opt and not is_disabler(exe)
2086 manadocs += ['disk-utils/raw.8.adoc']
2087 bashcompletions += ['raw']
2090 opt = not get_option('build-fdformat').disabled()
2094 include_directories : includes,
2095 link_with : [lib_common],
2096 install_dir : usrsbin_exec_dir,
2098 build_by_default : opt)
2099 if opt and not is_disabler(exe)
2101 manadocs += ['disk-utils/fdformat.8.adoc']
2107 include_directories : includes,
2108 link_with : [lib_common],
2109 install_dir : sbindir,
2111 manadocs += ['disk-utils/blockdev.8.adoc']
2112 bashcompletions += ['blockdev']
2114 opt = not get_option('build-fdisks').disabled()
2115 if opt and not have_dirfd and not have_ddfd
2116 error('neither dirfd nor ddfd are available')
2121 include_directories : includes,
2122 link_with : [lib_common,
2126 dependencies : [lib_readline],
2127 install_dir : sbindir,
2129 build_by_default : opt)
2130 if opt and not is_disabler(exe)
2132 bashcompletions += ['fdisk']
2135 opt2 = opt and 'fdisk' in static_programs
2139 link_args : ['--static'],
2140 include_directories : includes,
2141 link_with : [lib_common,
2144 lib_smartcols.get_static_lib()],
2145 dependencies : [lib_readline_static],
2146 install_dir : sbindir,
2148 build_by_default : opt2)
2149 if opt2 and not is_disabler(exe)
2156 include_directories : includes,
2157 link_with : [lib_common,
2161 dependencies : [lib_readline],
2162 install_dir : sbindir,
2164 build_by_default : opt)
2165 if opt and not is_disabler(exe)
2167 bashcompletions += ['sfdisk']
2170 opt2 = opt and 'sfdisk' in static_programs
2174 include_directories : includes,
2175 link_with : [lib_common,
2178 lib_smartcols.get_static_lib()],
2179 dependencies : [lib_readline_static],
2180 install_dir : sbindir,
2182 build_by_default : opt2)
2183 if opt2 and not is_disabler(exe)
2190 include_directories : includes,
2191 link_with : [lib_common,
2196 dependencies : [curses_libs],
2197 install_dir : sbindir,
2199 build_by_default : opt)
2200 if opt and not is_disabler(exe)
2202 manadocs += ['disk-utils/fdisk.8.adoc',
2203 'disk-utils/sfdisk.8.adoc',
2204 'disk-utils/cfdisk.8.adoc']
2205 bashcompletions += ['cfdisk']
2208 opt = not get_option('build-partx').disabled()
2212 include_directories : includes,
2213 link_with : [lib_common],
2214 install_dir : usrsbin_exec_dir,
2216 build_by_default : opt)
2220 include_directories : includes,
2221 link_with : [lib_common],
2222 install_dir : usrsbin_exec_dir,
2224 build_by_default : opt)
2228 include_directories : includes,
2229 link_with : [lib_common],
2230 install_dir : usrsbin_exec_dir,
2232 build_by_default : opt)
2236 include_directories : includes,
2237 link_with : [lib_common,
2240 install_dir : usrsbin_exec_dir,
2242 build_by_default : opt)
2244 exes += [exe, exe2, exe3, exe4]
2245 manadocs += ['disk-utils/addpart.8.adoc',
2246 'disk-utils/delpart.8.adoc',
2247 'disk-utils/resizepart.8.adoc',
2248 'disk-utils/partx.8.adoc']
2249 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2252 ############################################################
2257 include_directories : includes,
2258 link_with : [lib_common],
2259 dependencies : [lib_util,
2263 install_dir : usrbin_exec_dir,
2266 manadocs += ['term-utils/script.1.adoc']
2267 bashcompletions += ['script']
2272 include_directories : includes,
2273 c_args : '-DTEST_SCRIPT',
2274 link_with : [lib_common],
2275 dependencies : [lib_util,
2284 include_directories : includes,
2285 link_with : [lib_common],
2286 dependencies : [lib_util,
2289 install_dir : usrbin_exec_dir,
2292 manadocs += ['term-utils/scriptlive.1.adoc']
2293 bashcompletions += ['scriptlive']
2297 scriptreplay_sources,
2298 include_directories : includes,
2299 link_with : [lib_common],
2300 dependencies : [math_libs],
2301 install_dir : usrbin_exec_dir,
2304 manadocs += ['term-utils/scriptreplay.1.adoc']
2305 bashcompletions += ['scriptreplay']
2307 opt = not get_option('build-agetty').disabled()
2311 include_directories : includes,
2312 link_with : [lib_common, logindefs_c],
2313 dependencies : BSD ? lib_util : [],
2314 install_dir : sbindir,
2316 build_by_default : opt)
2319 manadocs += ['term-utils/agetty.8.adoc']
2322 opt = not get_option('build-setterm').disabled()
2326 include_directories : includes,
2327 link_with : [lib_common],
2328 dependencies : [curses_libs],
2329 install_dir : usrbin_exec_dir,
2331 build_by_default : opt)
2334 manadocs += ['term-utils/setterm.1.adoc']
2335 bashcompletions += ['setterm']
2338 opt = not get_option('build-mesg').disabled()
2342 include_directories : includes,
2343 link_with : [lib_common],
2344 install_dir : usrbin_exec_dir,
2346 build_by_default : opt)
2349 manadocs += ['term-utils/mesg.1.adoc']
2350 bashcompletions += ['mesg']
2353 opt = not get_option('build-wall').disabled()
2357 include_directories : includes,
2358 link_with : [lib_common],
2359 install_dir : usrbin_exec_dir,
2361 build_by_default : opt)
2364 manadocs += ['term-utils/wall.1.adoc']
2365 bashcompletions += ['wall']
2368 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2369 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2371 opt = not get_option('build-write').disabled()
2375 include_directories : includes,
2376 link_with : [lib_common],
2377 install_dir : usrbin_exec_dir,
2379 build_by_default : opt)
2382 manadocs += ['term-utils/write.1.adoc']
2385 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2386 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2388 opt = not get_option('build-login').disabled()
2392 include_directories : includes,
2393 link_with : [lib_common, logindefs_c],
2394 dependencies : [lib_pam,
2398 build_by_default : opt)
2399 if not is_disabler(exe)
2401 manadocs += ['login-utils/login.1.adoc']
2404 opt = not get_option('build-sulogin').disabled()
2408 include_directories : includes,
2409 link_with : [lib_common],
2410 dependencies : [lib_crypt,
2412 install_dir : sbindir,
2414 build_by_default : opt)
2415 if not is_disabler(exe)
2417 manadocs += ['login-utils/sulogin.8.adoc']
2423 include_directories : includes,
2424 link_with : [lib_common,
2426 dependencies : [curses_libs],
2427 install_dir : usrbin_exec_dir,
2430 manadocs += ['misc-utils/cal.1.adoc']
2431 bashcompletions += ['cal']
2433 opt = not get_option('build-logger').disabled()
2437 include_directories : includes,
2438 link_with : [lib_common],
2439 dependencies : [lib_systemd],
2440 install_dir : usrbin_exec_dir,
2442 build_by_default : opt)
2443 if opt and not is_disabler(exe)
2445 manadocs += ['misc-utils/logger.1.adoc']
2446 bashcompletions += ['logger']
2452 include_directories : includes,
2453 c_args : '-DTEST_LOGGER',
2454 link_with : [lib_common],
2455 dependencies : [lib_systemd])
2456 if not is_disabler(exe)
2463 include_directories : includes,
2464 install_dir : usrbin_exec_dir,
2467 manadocs += ['misc-utils/look.1.adoc']
2468 bashcompletions += ['look']
2473 include_directories : includes,
2474 link_with : [lib_common],
2475 install_dir : usrbin_exec_dir,
2478 manadocs += ['misc-utils/mcookie.1.adoc']
2479 bashcompletions += ['mcookie']
2484 include_directories : includes,
2485 dependencies : [lib_selinux],
2486 install_dir : usrbin_exec_dir,
2489 manadocs += ['misc-utils/namei.1.adoc']
2490 bashcompletions += ['namei']
2495 include_directories : includes,
2496 link_with : [lib_common],
2497 install_dir : usrbin_exec_dir,
2500 manadocs += ['misc-utils/whereis.1.adoc']
2501 bashcompletions += ['whereis']
2506 include_directories : includes,
2507 link_with : [lib_common,
2510 install_dir : usrbin_exec_dir,
2512 if not is_disabler(exe)
2514 manadocs += ['misc-utils/lslocks.8.adoc']
2515 bashcompletions += ['lslocks']
2521 include_directories : includes,
2522 link_with : [lib_common,
2526 dependencies : lib_udev,
2528 if not is_disabler(exe)
2530 manadocs += ['misc-utils/lsblk.8.adoc']
2531 bashcompletions += ['lsblk']
2537 include_directories : includes,
2538 link_with : [lib_common,
2540 install_dir : usrbin_exec_dir,
2542 if not is_disabler(exe)
2544 manadocs += ['misc-utils/lsfd.1.adoc']
2550 include_directories : includes,
2551 link_with : [lib_uuid],
2552 install_dir : usrbin_exec_dir,
2554 if not is_disabler(exe)
2556 manadocs += ['misc-utils/uuidgen.1.adoc']
2557 bashcompletions += ['uuidgen']
2563 include_directories : includes,
2564 link_with : [lib_common,
2567 install_dir : usrbin_exec_dir,
2569 if not is_disabler(exe)
2571 manadocs += ['misc-utils/uuidparse.1.adoc']
2572 bashcompletions += ['uuidparse']
2579 include_directories : includes,
2580 link_with : [lib_common,
2582 dependencies : [realtime_libs,
2584 install_dir : usrsbin_exec_dir,
2586 build_by_default : opt)
2590 include_directories : includes,
2591 link_with : [lib_common,
2593 dependencies : thread_libs,
2594 build_by_default : opt)
2595 if not is_disabler(exe)
2597 manadocs += ['misc-utils/uuidd.8.adoc']
2598 bashcompletions += ['uuidd']
2601 opt = build_libblkid
2605 include_directories : includes,
2606 link_with : [lib_common,
2608 install_dir : sbindir,
2610 build_by_default : opt)
2611 if opt and not is_disabler(exe)
2613 manadocs += ['misc-utils/blkid.8.adoc']
2614 bashcompletions += ['blkid']
2617 opt = opt and 'blkid' in static_programs
2621 include_directories : includes,
2622 link_with : [lib_common,
2624 install_dir : sbindir,
2626 build_by_default : opt)
2627 if opt and not is_disabler(exe)
2633 'libblkid/samples/mkfs.c',
2634 include_directories : includes,
2635 link_with : lib_blkid)
2636 if not is_disabler(exe)
2641 'sample-partitions',
2642 'libblkid/samples/partitions.c',
2643 include_directories : includes,
2644 link_with : lib_blkid)
2645 if not is_disabler(exe)
2650 'sample-superblocks',
2651 'libblkid/samples/superblocks.c',
2652 include_directories : includes,
2653 link_with : lib_blkid)
2654 if not is_disabler(exe)
2660 'libblkid/samples/topology.c',
2661 include_directories : includes,
2662 link_with : lib_blkid)
2663 if not is_disabler(exe)
2667 ############################################################
2672 include_directories : includes,
2673 link_with : [lib_blkid],
2674 install_dir : sbindir,
2676 if not is_disabler(exe)
2678 manadocs += ['misc-utils/findfs.8.adoc']
2679 bashcompletions += ['findfs']
2685 include_directories : includes,
2686 link_with : [lib_common,
2689 install_dir : sbindir,
2691 if not is_disabler(exe)
2693 manadocs += ['misc-utils/wipefs.8.adoc']
2694 bashcompletions += ['wipefs']
2700 include_directories : includes,
2701 link_with : [lib_common,
2705 dependencies : [lib_udev],
2707 if not is_disabler(exe)
2709 manadocs += ['misc-utils/findmnt.8.adoc']
2710 bashcompletions += ['findmnt']
2716 include_directories : includes,
2717 link_with : [lib_common],
2719 if not is_disabler(exe)
2721 manadocs += ['misc-utils/kill.1.adoc']
2724 opt = not get_option('build-rename').disabled()
2728 include_directories : includes,
2729 install_dir : usrbin_exec_dir,
2731 build_by_default : opt)
2732 if opt and not is_disabler(exe)
2734 manadocs += ['misc-utils/rename.1.adoc']
2735 bashcompletions += ['rename']
2741 include_directories : includes,
2742 link_with : [lib_common],
2743 install_dir : usrbin_exec_dir,
2746 manadocs += ['misc-utils/getopt.1.adoc']
2747 bashcompletions += ['getopt']
2752 include_directories : includes,
2753 link_with : [lib_common,
2755 install_dir : usrbin_exec_dir,
2757 if not is_disabler(exe)
2759 manadocs += ['misc-utils/fincore.1.adoc']
2760 bashcompletions += ['fincore']
2766 include_directories : includes,
2767 link_with : [lib_common],
2768 install_dir : usrbin_exec_dir,
2770 if not is_disabler(exe)
2772 manadocs += ['misc-utils/hardlink.1.adoc']
2773 bashcompletions += ['hardlink']
2776 opt = not get_option('build-pipesz').disabled()
2780 include_directories : includes,
2781 link_with : [lib_common],
2782 install_dir : usrbin_exec_dir,
2784 if opt and not is_disabler(exe)
2786 manadocs += ['misc-utils/pipesz.1.adoc']
2787 bashcompletions += ['pipesz']
2793 include_directories : includes,
2794 c_args : '-DTEST_CAL',
2795 link_with : [lib_common,
2797 dependencies : [curses_libs])
2798 if not is_disabler(exe)
2805 include_directories : includes,
2806 link_with : [lib_common],
2807 install_dir : usrbin_exec_dir,
2809 if not is_disabler(exe)
2811 manadocs += ['misc-utils/fadvise.1.adoc']
2812 bashcompletions += ['fadvise']
2818 include_directories : includes,
2819 link_with : [lib_common],
2820 install_dir : usrbin_exec_dir,
2822 if not is_disabler(exe)
2824 manadocs += ['misc-utils/waitpid.1.adoc']
2825 bashcompletions += ['waitpid']
2828 ############################################################
2830 opt = not get_option('build-schedutils').disabled()
2833 'schedutils/chrt.c',
2834 include_directories : includes,
2835 link_with : lib_common,
2836 install_dir : usrbin_exec_dir,
2838 build_by_default : opt)
2842 'schedutils/ionice.c',
2843 include_directories : includes,
2844 link_with : lib_common,
2845 install_dir : usrbin_exec_dir,
2847 build_by_default : opt)
2851 'schedutils/taskset.c',
2852 include_directories : includes,
2853 link_with : lib_common,
2854 install_dir : usrbin_exec_dir,
2856 build_by_default : opt)
2860 'schedutils/uclampset.c',
2861 include_directories : includes,
2862 link_with : lib_common,
2863 install_dir : usrbin_exec_dir,
2865 build_by_default : opt)
2867 if opt and not is_disabler(exe)
2868 exes += [exe, exe2, exe3, exe4]
2869 manadocs += ['schedutils/chrt.1.adoc',
2870 'schedutils/ionice.1.adoc',
2871 'schedutils/taskset.1.adoc',
2872 'schedutils/uclampset.1.adoc']
2873 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2876 ############################################################
2878 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2883 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2884 include_directories : dir_include,
2885 link_with : lib_common)
2891 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2892 include_directories : dir_include,
2893 link_with : lib_common)
2899 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2900 include_directories : dir_include,
2901 link_with : lib_common)
2907 c_args : ['-DTEST_PROGRAM_MANGLE'],
2908 include_directories : dir_include)
2914 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2915 include_directories : dir_include)
2921 'lib/color-names.c',
2922 c_args : ['-DTEST_PROGRAM_COLORS'],
2923 include_directories : dir_include,
2924 link_with : [lib_common, lib_tcolors])
2930 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2931 include_directories : dir_include)
2934 # XXX: HAVE_OPENAT && HAVE_DIRFD
2938 c_args : ['-DTEST_PROGRAM_PROCFS'],
2939 include_directories : dir_include,
2940 link_with : lib_common)
2943 # XXX: HAVE_OPENAT && HAVE_DIRFD
2948 have_cpu_set_t ? 'lib/cpuset.c' : [],
2949 c_args : ['-DTEST_PROGRAM_PATH'],
2950 include_directories : dir_include,
2951 link_with : lib_common)
2959 c_args : ['-DTEST_PROGRAM_PTY'],
2960 include_directories : dir_include,
2961 link_with : [lib_common],
2962 dependencies : [lib_m,
2971 c_args : ['-DTEST_PROGRAM_CPUSET'],
2972 include_directories : dir_include)
2982 have_cpu_set_t ? 'lib/cpuset.c' : [],
2983 c_args : ['-DTEST_PROGRAM_SYSFS'],
2984 include_directories : dir_include)
2990 c_args : ['-DTEST_PROGRAM_PAGER'],
2991 include_directories : dir_include)
2995 'test_linux_version',
2996 'lib/linux_version.c',
2997 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
2998 include_directories : dir_include)
3004 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3005 include_directories : dir_include)
3009 'test_canonicalize',
3010 'lib/canonicalize.c',
3011 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3012 include_directories : dir_include)
3019 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3020 include_directories : dir_include)
3026 c_args : ['-DTEST_PROGRAM'],
3027 include_directories : dir_include,
3028 link_with : lib_common)
3034 c_args : ['-DTEST_PROGRAM'],
3035 include_directories : dir_include,
3036 link_with : [lib_common, logindefs_c])
3040 ############################################################
3044 'libuuid/src/test_uuid.c',
3045 include_directories : [dir_include, dir_libuuid],
3046 link_with : lib_uuid,
3047 dependencies : socket_libs)
3048 if not is_disabler(exe)
3052 ############################################################
3054 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3056 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3060 'libfdisk/src/ask.c',
3061 c_args : libfdisk_tests_cflags,
3062 include_directories : lib_fdisk_includes,
3063 link_with : libfdisk_tests_ldadd)
3064 if not is_disabler(exe)
3070 'libfdisk/src/gpt.c',
3071 c_args : libfdisk_tests_cflags,
3072 include_directories : lib_fdisk_includes,
3073 link_with : libfdisk_tests_ldadd)
3074 if not is_disabler(exe)
3080 'libfdisk/src/utils.c',
3081 c_args : libfdisk_tests_cflags,
3082 include_directories : lib_fdisk_includes,
3083 link_with : libfdisk_tests_ldadd)
3084 if not is_disabler(exe)
3089 'test_fdisk_script',
3090 'libfdisk/src/script.c',
3091 c_args : libfdisk_tests_cflags,
3092 include_directories : lib_fdisk_includes,
3093 link_with : libfdisk_tests_ldadd)
3094 if not is_disabler(exe)
3099 'test_fdisk_version',
3100 'libfdisk/src/version.c',
3101 c_args : libfdisk_tests_cflags,
3102 include_directories : lib_fdisk_includes,
3103 link_with : libfdisk_tests_ldadd)
3104 if not is_disabler(exe)
3110 'libfdisk/src/item.c',
3111 c_args : libfdisk_tests_cflags,
3112 include_directories : lib_fdisk_includes,
3113 link_with : libfdisk_tests_ldadd)
3114 if not is_disabler(exe)
3118 sample_fdisk_cflags = ['-Wno-unused']
3119 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3122 'sample-fdisk-mkpart',
3123 'libfdisk/samples/mkpart.c',
3124 c_args : sample_fdisk_cflags,
3125 include_directories : lib_fdisk_includes,
3126 link_with : sample_fdisk_ldadd)
3127 if not is_disabler(exe)
3132 'sample-fdisk-mkpart-fullspec',
3133 'libfdisk/samples/mkpart-fullspec.c',
3134 c_args : sample_fdisk_cflags,
3135 include_directories : lib_fdisk_includes,
3136 link_with : sample_fdisk_ldadd)
3137 if not is_disabler(exe)
3141 ############################################################
3145 'tests/helpers/test_mbsencode.c',
3146 include_directories : includes,
3147 link_with : lib_common)
3152 'tests/helpers/test_byteswap.c',
3153 include_directories : includes)
3158 'tests/helpers/test_md5.c',
3160 include_directories : includes)
3165 'tests/helpers/test_sha1.c',
3167 include_directories : includes)
3172 'tests/helpers/test_pathnames.c',
3173 include_directories : includes)
3178 'tests/helpers/test_strerror.c',
3179 include_directories : includes)
3184 'tests/helpers/test_sysinfo.c',
3185 include_directories : includes)
3190 'tests/helpers/test_sigreceive.c',
3191 include_directories : includes,
3192 link_with : lib_common)
3197 'tests/helpers/test_tiocsti.c',
3198 include_directories : includes)
3202 'test_uuid_namespace',
3203 'tests/helpers/test_uuid_namespace.c',
3207 include_directories : includes)
3213 'tests/helpers/test_mkfds.c',
3214 include_directories : includes)
3217 ############################################################
3221 'sample-scols-tree',
3222 'libsmartcols/samples/tree.c',
3223 include_directories : includes,
3224 link_with : [lib_smartcols, lib_common])
3225 if not is_disabler(exe)
3230 'sample-scols-title',
3231 'libsmartcols/samples/title.c',
3232 include_directories : includes,
3233 link_with : [lib_smartcols, lib_common])
3234 if not is_disabler(exe)
3239 'sample-scols-wrap',
3240 'libsmartcols/samples/wrap.c',
3241 include_directories : includes,
3242 link_with : [lib_smartcols, lib_common])
3243 if not is_disabler(exe)
3248 'sample-scols-continuous',
3249 'libsmartcols/samples/continuous.c',
3250 include_directories : includes,
3251 link_with : [lib_smartcols, lib_common])
3252 if not is_disabler(exe)
3257 'sample-scols-maxout',
3258 'libsmartcols/samples/maxout.c',
3259 include_directories : includes,
3260 link_with : [lib_smartcols, lib_common])
3261 if not is_disabler(exe)
3266 'sample-scols-fromfile',
3267 'libsmartcols/samples/fromfile.c',
3268 include_directories : includes,
3269 link_with : [lib_smartcols, lib_common])
3270 if not is_disabler(exe)
3275 'sample-scols-grouping-simple',
3276 'libsmartcols/samples/grouping-simple.c',
3277 include_directories : includes,
3278 link_with : [lib_smartcols, lib_common])
3279 if not is_disabler(exe)
3284 'sample-scols-grouping-overlay',
3285 'libsmartcols/samples/grouping-overlay.c',
3286 include_directories : includes,
3287 link_with : [lib_smartcols, lib_common])
3288 if not is_disabler(exe)
3292 ############################################################
3294 # Let the test runner know whether we're running under asan and export
3295 # some paths. We use a file on disk so that it is possible to run the
3296 # test scripts from commandline without setting any variables.
3297 configure_file(output : 'meson.conf',
3302 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3305 run_sh = find_program('tests/run.sh')
3309 '--srcdir=' + meson.current_source_dir(),
3310 '--builddir=' + meson.current_build_dir(),
3316 manadocs += ['lib/terminal-colors.d.5.adoc']
3317 manadocs += ['libblkid/libblkid.3.adoc']
3321 'libuuid/man/uuid.3.adoc',
3322 'libuuid/man/uuid_clear.3.adoc',
3323 'libuuid/man/uuid_compare.3.adoc',
3324 'libuuid/man/uuid_copy.3.adoc',
3325 'libuuid/man/uuid_generate.3.adoc',
3326 'libuuid/man/uuid_is_null.3.adoc',
3327 'libuuid/man/uuid_parse.3.adoc',
3328 'libuuid/man/uuid_time.3.adoc',
3329 'libuuid/man/uuid_unparse.3.adoc']
3331 'uuid_generate_random.3': 'uuid_generate.3',
3332 'uuid_generate_time.3': 'uuid_generate.3',
3333 'uuid_generate_time_safe.3': 'uuid_generate.3',
3337 asciidoctor = find_program('asciidoctor', required : false)
3338 if asciidoctor.found()
3339 foreach adoc : manadocs
3340 name = adoc.split('/')[-1]
3341 page = name.split('.adoc')[0]
3342 section = page.split('.')[-1]
3343 mandirn = join_paths(mandir, 'man' + section)
3348 command : [ asciidoctor,
3350 '-a', 'VERSION=' + meson.project_version(),
3351 '-a', 'release-version=' + meson.project_version(),
3352 '-a', 'ADJTIME_PATH=/etc/adjtime',
3353 '-a', 'package-docdir=' + docdir,
3354 '--base-dir=' + meson.current_source_dir(),
3355 '--destination-dir=' + meson.current_build_dir(),
3356 '--load-path', '@SOURCE_ROOT@/tools',
3357 '--require', 'asciidoctor-includetracker',
3361 depfile : page + '.deps',
3363 install_dir : mandirn)
3366 foreach link_name, target : manlinks
3367 link_section = link_name.split('.')[-1]
3368 target_section = target.split('.')[-1]
3369 meson.add_install_script(meson_make_manpage_stub,
3370 join_paths('man' + target_section, target),
3371 join_paths(mandir, 'man' + link_section, link_name))
3375 if bash_completion.found()
3376 foreach completion : bashcompletions
3378 join_paths('bash-completion', completion),
3379 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3382 foreach link_name, target : bashcompletionslinks
3383 meson.add_install_script(meson_make_symlink,
3385 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))