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 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
696 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
698 build_plymouth_support = get_option('build-plymouth-support')
699 have_tiocglcktrmios = cc.has_header_symbol(
700 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
701 required : build_plymouth_support.enabled())
702 have_sock_cloexec = cc.has_header_symbol(
703 'sys/socket.h', 'SOCK_CLOEXEC',
704 prefix : '#include <sys/types.h>',
705 required : build_plymouth_support.enabled())
706 have_sock_nonblock = cc.has_header_symbol(
707 'sys/socket.h', 'SOCK_NONBLOCK',
708 prefix : '#include <sys/types.h>',
709 required : build_plymouth_support.enabled())
710 have_so_passcred = cc.has_header_symbol(
711 'sys/socket.h', 'SO_PASSCRED',
712 prefix : '#include <sys/types.h>',
713 required : build_plymouth_support.enabled())
715 build_plymouth_support = (not build_plymouth_support.disabled() and
716 have_tiocglcktrmios and
717 have_sock_cloexec and
718 have_sock_nonblock and
720 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
721 summary('plymouth support',
722 build_plymouth_support ? 'enabled' : 'disabled',
723 section : 'components')
725 # check for valid fallocate() function
726 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
727 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
728 # and program can't be linked.
736 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
737 return ret == 0 ? 0 : 1;
740 have = cc.links(code, name : 'fallocate() function')
741 conf.set('HAVE_FALLOCATE', have ? 1 : false)
749 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
750 return ret == 0 ? 0 : 1;
753 have = cc.links(code, name : 'posix_fallocate() function')
754 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
756 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
757 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
758 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
760 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
761 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
762 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
764 ############################################################
767 fs_search_path = get_option('fs-search-path')
768 fs_search_path_extra = get_option('fs-search-path-extra')
769 if fs_search_path_extra != ''
770 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
772 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
774 systemdsystemunitdir = ''
776 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
779 sysvinit = get_option('sysvinit').enabled()
780 sysvinitrcdir = sysconfdir + '/init.d'
782 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
783 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
785 have = get_option('chsh-only-listed')
786 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
788 have = get_option('use-tty-group')
789 conf.set('USE_TTY_GROUP', have ? 1 : false)
791 build_hwclock = not get_option('build-hwclock').disabled()
792 bison = find_program('bison', required: build_hwclock)
793 bison_gen = generator(
795 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
796 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
800 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
801 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
805 configuration : conf)
807 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
812 '-Waddress-of-packed-member',
813 '-Wdiscarded-qualifiers',
814 '-Wembedded-directive',
817 '-Wimplicit-function-declaration',
818 '-Wmissing-declarations',
819 '-Wmissing-parameter-type',
820 '-Wmissing-prototypes',
822 '-Wno-missing-field-initializers',
823 '-Wold-style-definition',
827 '-Wstrict-prototypes',
830 '-Wunused-but-set-parameter',
831 '-Wunused-but-set-variable',
832 '-Wunused-parameter',
836 foreach compiler_flag : compiler_flags
837 if cc.has_argument(compiler_flag)
838 add_project_arguments(compiler_flag, language : 'c')
846 bashcompletionslinks = {}
852 subdir('libsmartcols')
855 subdir('login-utils')
863 includes = [dir_include,
873 opt = not get_option('build-chfn-chsh').disabled()
878 include_directories : includes,
879 link_with : [lib_common, logindefs_c],
880 dependencies : chfn_chsh_deps,
881 install_dir : usrbin_exec_dir,
883 build_by_default : opt)
887 'login-utils/chsh.c',
890 include_directories : includes,
891 link_with : lib_common,
892 dependencies : chfn_chsh_deps,
893 install_dir : usrbin_exec_dir,
895 build_by_default : opt)
896 if opt and not is_disabler(exe)
898 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
899 bashcompletions += ['chfn', 'chsh']
904 test_islocal_sources,
905 include_directories : includes,
906 c_args : '-DTEST_PROGRAM')
911 test_consoles_sources,
912 c_args : ['-DTEST_PROGRAM'],
913 include_directories : includes,
914 link_with : lib_common)
917 opt = not get_option('build-last').disabled()
921 include_directories : includes,
922 link_with : [lib_common],
923 install_dir : usrbin_exec_dir,
925 build_by_default : opt)
926 if opt and not is_disabler(exe)
928 meson.add_install_script(meson_make_symlink,
930 join_paths(usrbin_exec_dir, 'lastb'))
931 manadocs += ['login-utils/last.1.adoc']
932 manlinks += {'lastb.1': 'last.1'}
933 bashcompletions += ['last']
934 bashcompletionslinks += {'lastb': 'last'}
937 opt = not get_option('build-nologin').disabled()
940 'login-utils/nologin.c',
941 include_directories : includes,
942 install_dir : sbindir,
943 link_with : [lib_common],
945 build_by_default : opt)
946 if opt and not is_disabler(exe)
948 manadocs += ['login-utils/nologin.8.adoc']
951 opt = not get_option('build-utmpdump').disabled()
954 'login-utils/utmpdump.c',
955 include_directories : includes,
956 link_with : [lib_common],
957 install_dir : usrbin_exec_dir,
959 build_by_default : opt)
960 if opt and not is_disabler(exe)
962 manadocs += ['login-utils/utmpdump.1.adoc']
963 bashcompletions += ['utmpdump']
966 opt = not get_option('build-su').disabled()
970 'login-utils/su-common.c',
971 'login-utils/su-common.h',
975 include_directories : includes,
976 link_with : [lib_common, logindefs_c],
977 dependencies : [lib_pam,
982 build_by_default : opt)
983 if opt and not is_disabler(exe)
985 manadocs += ['login-utils/su.1.adoc']
986 bashcompletions += ['su']
989 opt = not get_option('build-newgrp').disabled()
992 'login-utils/newgrp.c',
993 include_directories : includes,
994 dependencies : [lib_crypt],
995 install_dir : usrbin_exec_dir,
997 build_by_default : opt)
998 if opt and not is_disabler(exe)
1000 manadocs += ['login-utils/newgrp.1.adoc']
1003 opt = not get_option('build-lslogins').disabled()
1006 'login-utils/lslogins.c',
1007 include_directories : includes,
1008 link_with : [lib_common,
1011 dependencies : [lib_selinux,
1013 install_dir : usrbin_exec_dir,
1015 build_by_default : opt)
1016 if opt and not is_disabler(exe)
1018 manadocs += ['login-utils/lslogins.1.adoc']
1019 bashcompletions += ['lslogins']
1022 opt = not get_option('build-vipw').disabled()
1025 'login-utils/vipw.c',
1026 'login-utils/setpwnam.h',
1027 include_directories : includes,
1028 link_with : [lib_common],
1029 dependencies : [lib_selinux],
1030 install_dir : usrbin_exec_dir,
1032 build_by_default : opt)
1033 if opt and not is_disabler(exe)
1035 meson.add_install_script(meson_make_symlink,
1037 join_paths(usrbin_exec_dir, 'vigr'))
1038 manadocs += ['login-utils/vipw.8.adoc']
1041 opt = not get_option('build-runuser').disabled()
1044 'login-utils/runuser.c',
1045 'login-utils/su-common.c',
1046 'login-utils/su-common.h',
1050 include_directories : includes,
1051 link_with : [lib_common, logindefs_c],
1052 dependencies : [lib_pam,
1056 install_dir : sbindir,
1058 build_by_default : opt)
1059 if opt and not is_disabler(exe)
1061 manadocs += ['login-utils/runuser.1.adoc']
1062 bashcompletionslinks += {'runuser': 'su'}
1065 ############################################################
1070 include_directories : includes,
1071 link_with : lib_common,
1072 install_dir : usrbin_exec_dir,
1075 manadocs += ['text-utils/col.1.adoc']
1076 bashcompletions += ['col']
1081 include_directories : includes,
1082 install_dir : usrbin_exec_dir,
1085 manadocs += ['text-utils/colcrt.1.adoc']
1086 bashcompletions += ['colcrt']
1091 include_directories : includes,
1092 link_with : lib_common,
1093 install_dir : usrbin_exec_dir,
1096 manadocs += ['text-utils/colrm.1.adoc']
1097 bashcompletions += ['colrm']
1102 include_directories : includes,
1103 install_dir : usrbin_exec_dir,
1106 manadocs += ['text-utils/rev.1.adoc']
1107 bashcompletions += ['rev']
1112 include_directories : includes,
1113 link_with : [lib_common,
1115 install_dir : usrbin_exec_dir,
1117 if not is_disabler(exe)
1119 manadocs += ['text-utils/column.1.adoc']
1120 bashcompletions += ['column']
1123 opt = not get_option('build-line').disabled()
1127 include_directories : includes,
1128 install_dir : usrbin_exec_dir,
1130 build_by_default : opt)
1131 if opt and not is_disabler(exe)
1133 manadocs += ['text-utils/line.1.adoc']
1136 opt = not get_option('build-pg').disabled()
1140 link_with : lib_common,
1141 include_directories : includes,
1142 dependencies : [lib_tinfo,
1144 install_dir : usrbin_exec_dir,
1146 build_by_default : opt)
1147 if opt and not is_disabler(exe)
1149 manadocs += ['text-utils/pg.1.adoc']
1150 bashcompletions += ['pg']
1153 opt = not get_option('build-ul').disabled()
1157 include_directories : includes,
1158 dependencies : [lib_tinfo,
1160 install_dir : usrbin_exec_dir,
1162 build_by_default : opt)
1163 if opt and not is_disabler(exe)
1165 manadocs += ['text-utils/ul.1.adoc']
1166 bashcompletions += ['ul']
1169 opt = not get_option('build-more').disabled()
1173 link_with : [lib_common],
1174 include_directories : includes,
1175 dependencies : [lib_tinfo,
1179 build_by_default : opt)
1183 link_with : [lib_common],
1184 include_directories : includes,
1185 c_args : '-DTEST_PROGRAM',
1186 dependencies : [lib_tinfo,
1189 build_by_default : opt)
1191 if opt and not is_disabler(exe)
1193 manadocs += ['text-utils/more.1.adoc']
1194 bashcompletions += ['more']
1200 include_directories : includes,
1201 link_with : [lib_common,
1203 install_dir : usrbin_exec_dir,
1205 if not is_disabler(exe)
1207 manadocs += ['text-utils/hexdump.1.adoc']
1208 bashcompletions += ['hexdump']
1211 opt = not get_option('build-lsmem').disabled()
1215 include_directories : includes,
1216 link_with : [lib_common,
1218 install_dir : usrbin_exec_dir,
1220 build_by_default : opt)
1221 if opt and not is_disabler(exe)
1223 manadocs += ['sys-utils/lsmem.1.adoc']
1224 bashcompletions += ['lsmem']
1227 opt = not get_option('build-chmem').disabled()
1231 include_directories : includes,
1232 link_with : [lib_common],
1233 install_dir : usrbin_exec_dir,
1235 build_by_default : opt)
1236 if opt and not is_disabler(exe)
1238 manadocs += ['sys-utils/chmem.8.adoc']
1239 bashcompletions += ['chmem']
1245 include_directories : includes,
1246 link_with : [lib_common],
1247 install_dir : usrbin_exec_dir,
1250 manadocs += ['sys-utils/choom.1.adoc']
1255 include_directories : includes,
1256 link_with : [lib_common],
1257 install_dir : usrbin_exec_dir,
1260 manadocs += ['sys-utils/ipcmk.1.adoc']
1261 bashcompletions += ['ipcmk']
1266 include_directories : includes,
1267 link_with : [lib_common],
1268 install_dir : usrbin_exec_dir,
1271 manadocs += ['sys-utils/ipcrm.1.adoc']
1272 bashcompletions += ['ipcrm']
1274 opt = not get_option('build-ipcs').disabled()
1278 include_directories : includes,
1279 link_with : [lib_common],
1280 install_dir : usrbin_exec_dir,
1282 build_by_default : opt)
1283 if opt and not is_disabler(exe)
1285 manadocs += ['sys-utils/ipcs.1.adoc']
1286 bashcompletions += ['ipcs']
1289 opt = not get_option('build-rfkill').disabled()
1293 include_directories : includes,
1294 link_with : [lib_common,
1296 install_dir : usrsbin_exec_dir,
1298 build_by_default : opt)
1299 if opt and not is_disabler(exe)
1301 manadocs += ['sys-utils/rfkill.8.adoc']
1302 bashcompletions += ['rfkill']
1308 include_directories : includes,
1309 link_with : [lib_common,
1311 install_dir : usrbin_exec_dir,
1313 if not is_disabler(exe)
1315 manadocs += ['sys-utils/renice.1.adoc']
1316 bashcompletions += ['renice']
1322 include_directories : includes,
1323 link_with : [lib_common,
1325 install_dir : usrbin_exec_dir,
1327 if opt and not is_disabler(exe)
1329 manadocs += ['sys-utils/setsid.1.adoc']
1330 bashcompletions += ['setsid']
1335 readprofile_sources,
1336 include_directories : includes,
1337 link_with : [lib_common,
1339 install_dir : usrsbin_exec_dir,
1341 if not is_disabler(exe)
1343 manadocs += ['sys-utils/readprofile.8.adoc']
1344 bashcompletions += ['readprofile']
1347 opt = not get_option('build-tunelp').disabled()
1351 include_directories : includes,
1352 link_with : [lib_common],
1353 install_dir : usrsbin_exec_dir,
1355 build_by_default : opt)
1356 if opt and not is_disabler(exe)
1358 manadocs += ['sys-utils/tunelp.8.adoc']
1359 bashcompletions += ['tunelp']
1365 include_directories : includes,
1366 link_with : [lib_common,
1368 install_dir : sbindir,
1370 if not is_disabler(exe)
1372 manadocs += ['sys-utils/fstrim.8.adoc']
1373 bashcompletions += ['fstrim']
1379 include_directories : includes,
1380 link_with : [lib_common,
1383 if not is_disabler(exe)
1385 manadocs += ['sys-utils/dmesg.1.adoc']
1386 bashcompletions += ['dmesg']
1392 include_directories : dir_include,
1393 c_args : '-DTEST_DMESG',
1394 link_with : [lib_common,
1396 if not is_disabler(exe)
1403 include_directories : includes,
1404 link_with : [lib_common],
1405 install_dir : sbindir,
1408 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1409 bashcompletions += ['ctrlaltdel']
1414 include_directories : includes,
1415 install_dir : sbindir,
1418 manadocs += ['sys-utils/fsfreeze.8.adoc']
1419 bashcompletions += ['fsfreeze']
1424 include_directories : includes,
1425 link_with : [lib_common,
1427 install_dir : sbindir,
1430 manadocs += ['sys-utils/blkdiscard.8.adoc']
1431 bashcompletions += ['blkdiscard']
1436 include_directories : includes,
1437 link_with : [lib_common],
1438 install_dir : sbindir,
1441 manadocs += ['sys-utils/blkzone.8.adoc']
1442 bashcompletions += ['blkzone']
1447 include_directories : includes,
1448 link_with : [lib_common],
1449 install_dir : sbindir,
1452 manadocs += ['sys-utils/blkpr.8.adoc']
1457 include_directories : includes,
1458 link_with : [lib_common],
1459 install_dir : usrsbin_exec_dir,
1462 manadocs += ['sys-utils/ldattach.8.adoc']
1463 bashcompletions += ['ldattach']
1468 include_directories : includes,
1469 link_with : [lib_common],
1470 install_dir : usrsbin_exec_dir,
1473 manadocs += ['sys-utils/rtcwake.8.adoc']
1474 bashcompletions += ['rtcwake']
1479 include_directories : includes,
1480 link_with : [lib_common],
1481 install_dir : usrbin_exec_dir,
1484 manadocs += ['sys-utils/setarch.8.adoc']
1485 bashcompletions += ['setarch']
1487 setarch_links = ['uname26', 'linux32', 'linux64']
1488 setarch_links_arch = {
1489 's390x' : ['s390', 's390x'],
1491 'x86_64' : ['i386', 'x86_64'],
1492 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1493 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1494 'mips64' : ['mips', 'mips64', 'mips32'],
1495 'ia64' : ['i386', 'ia64'],
1496 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1498 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1500 foreach link: setarch_links
1501 meson.add_install_script(meson_make_symlink,
1503 join_paths(usrbin_exec_dir, link))
1504 manlinks += {link + '.8': 'setarch.8'}
1507 opt = not get_option('build-eject').disabled()
1511 include_directories : includes,
1512 link_with : [lib_common,
1514 install_dir : usrbin_exec_dir,
1516 build_by_default : opt)
1517 if opt and not is_disabler(exe)
1519 manadocs += ['sys-utils/eject.1.adoc']
1520 bashcompletions += ['eject']
1523 opt = not get_option('build-losetup').disabled()
1527 include_directories : includes,
1528 link_with : [lib_common,
1530 install_dir : sbindir,
1532 build_by_default : opt)
1533 if opt and not is_disabler(exe)
1534 manadocs += ['sys-utils/losetup.8.adoc']
1536 bashcompletions += ['losetup']
1539 opt = opt and 'losetup' in static_programs
1543 include_directories : includes,
1544 link_args : ['--static'],
1545 link_with : [lib_common,
1546 lib_smartcols.get_static_lib()],
1547 install_dir : sbindir,
1549 build_by_default : opt)
1550 if opt and not is_disabler(exe)
1554 opt = not get_option('build-zramctl').disabled()
1558 include_directories : includes,
1559 link_with : [lib_common,
1561 install_dir : sbindir,
1563 build_by_default : opt)
1564 if opt and not is_disabler(exe)
1566 manadocs += ['sys-utils/zramctl.8.adoc']
1567 bashcompletions += ['zramctl']
1573 include_directories : includes,
1574 link_with : [lib_common,
1576 install_dir : usrbin_exec_dir,
1578 if not is_disabler(exe)
1580 manadocs += ['sys-utils/prlimit.1.adoc']
1581 bashcompletions += ['prlimit']
1587 include_directories : includes,
1588 link_with : [lib_common,
1591 install_dir : usrbin_exec_dir,
1593 if not is_disabler(exe)
1595 manadocs += ['sys-utils/lsns.8.adoc']
1596 bashcompletions += ['lsns']
1599 opt = not get_option('build-mount').disabled()
1603 include_directories : includes,
1604 link_with : [lib_common,
1607 dependencies : lib_selinux,
1609 build_by_default : opt)
1613 include_directories : includes,
1614 link_with : [lib_common,
1617 build_by_default : opt)
1618 if opt and not is_disabler(exe)
1620 manadocs += ['sys-utils/fstab.5.adoc',
1621 'sys-utils/mount.8.adoc',
1622 'sys-utils/umount.8.adoc']
1623 bashcompletions += ['mount', 'umount']
1626 opt2 = opt and 'mount' in static_programs
1630 include_directories : includes,
1631 link_args : ['--static'],
1632 link_with : [lib_common,
1633 lib_smartcols_static,
1636 build_by_default : opt2)
1637 if opt2 and not is_disabler(exe)
1641 opt2 = opt and 'umount' in static_programs
1645 include_directories : includes,
1646 link_args : ['--static'],
1647 link_with : [lib_common,
1650 build_by_default : opt2)
1651 if opt2 and not is_disabler(exe)
1660 include_directories : includes,
1661 link_with : [lib_common,
1665 install_dir : sbindir,
1667 if not is_disabler(exe)
1669 manadocs += ['sys-utils/swapon.8.adoc']
1670 bashcompletions += ['swapon']
1676 include_directories : includes,
1677 link_with : [lib_common,
1680 install_dir : sbindir,
1682 if not is_disabler(exe)
1684 manlinks += {'swapoff.8': 'swapon.8'}
1685 bashcompletions += ['swapoff']
1691 include_directories : includes,
1692 link_with : [lib_common,
1694 dependencies : [rtas_libs],
1695 install_dir : usrbin_exec_dir,
1697 if not is_disabler(exe)
1699 manadocs += ['sys-utils/lscpu.1.adoc']
1700 bashcompletions += ['lscpu']
1706 include_directories : includes,
1707 link_with : [lib_common],
1708 install_dir : sbindir,
1711 manadocs += ['sys-utils/chcpu.8.adoc']
1712 bashcompletions += ['chcpu']
1717 include_directories : includes,
1718 link_with : [lib_common,
1721 if not is_disabler(exe)
1723 manadocs += ['sys-utils/wdctl.8.adoc']
1724 bashcompletions += ['wdctl']
1727 opt = not get_option('build-mountpoint').disabled()
1731 include_directories : includes,
1732 link_with : [lib_mount],
1734 build_by_default : opt)
1735 if opt and not is_disabler(exe)
1737 manadocs += ['sys-utils/mountpoint.1.adoc']
1738 bashcompletions += ['mountpoint']
1741 opt = not get_option('build-fallocate').disabled()
1745 include_directories : includes,
1746 link_with : [lib_common],
1747 install_dir : usrbin_exec_dir,
1749 build_by_default : opt)
1750 if opt and not is_disabler(exe)
1752 manadocs += ['sys-utils/fallocate.1.adoc']
1753 bashcompletions += ['fallocate']
1756 opt = not get_option('build-pivot_root').disabled()
1760 include_directories : includes,
1761 install_dir : sbindir,
1763 build_by_default : opt)
1764 if opt and not is_disabler(exe)
1766 manadocs += ['sys-utils/pivot_root.8.adoc']
1767 bashcompletions += ['pivot_root']
1770 opt = not get_option('build-switch_root').disabled()
1771 if opt and not have_dirfd and not have_ddfd
1772 error('neither dirfd nor ddfd are available')
1776 switch_root_sources,
1777 include_directories : includes,
1778 install_dir : sbindir,
1780 build_by_default : opt)
1781 if opt and not is_disabler(exe)
1783 manadocs += ['sys-utils/switch_root.8.adoc']
1786 opt = not get_option('build-unshare').disabled()
1790 include_directories : includes,
1791 link_with : [lib_common],
1792 install_dir : usrbin_exec_dir,
1794 build_by_default : opt)
1795 if opt and not is_disabler(exe)
1797 manadocs += ['sys-utils/unshare.1.adoc']
1798 bashcompletions += ['unshare']
1801 opt = opt and 'unshare' in static_programs
1805 include_directories : includes,
1806 link_with : [lib_common],
1807 install_dir : usrbin_exec_dir,
1809 build_by_default : opt)
1810 if opt and not is_disabler(exe)
1814 opt = not get_option('build-nsenter').disabled()
1818 include_directories : includes,
1819 link_with : [lib_common],
1820 dependencies : [lib_selinux],
1821 install_dir : usrbin_exec_dir,
1823 build_by_default : opt)
1824 if opt and not is_disabler(exe)
1826 manadocs += ['sys-utils/nsenter.1.adoc']
1827 bashcompletions += ['nsenter']
1830 opt = opt and 'nsenter' in static_programs
1834 include_directories : includes,
1835 link_with : [lib_common],
1836 dependencies : [lib_selinux],
1837 install_dir : usrbin_exec_dir,
1839 build_by_default : opt)
1840 if opt and not is_disabler(exe)
1844 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1848 include_directories : includes,
1849 link_with : [lib_common],
1850 dependencies : [lib_cap_ng],
1851 install_dir : usrbin_exec_dir,
1853 build_by_default : opt)
1854 if opt and not is_disabler(exe)
1856 manadocs += ['sys-utils/setpriv.1.adoc']
1857 bashcompletions += ['setpriv']
1863 include_directories : includes,
1864 link_with : [lib_common],
1865 dependencies : realtime_libs,
1866 install_dir : usrbin_exec_dir,
1869 manadocs += ['sys-utils/flock.1.adoc']
1870 bashcompletions += ['flock']
1872 opt = not get_option('build-lsirq').disabled()
1876 include_directories : includes,
1877 link_with : [lib_common,
1879 install_dir : usrbin_exec_dir,
1881 build_by_default : opt)
1882 if opt and not is_disabler(exe)
1884 manadocs += ['sys-utils/lsirq.1.adoc']
1885 bashcompletions += ['lsirq']
1888 opt = not get_option('build-irqtop').disabled()
1892 include_directories : includes,
1893 dependencies : [realtime_libs, curses_libs],
1894 link_with : [lib_common,
1897 install_dir : usrbin_exec_dir,
1899 build_by_default : opt)
1900 if opt and not is_disabler(exe)
1902 manadocs += ['sys-utils/irqtop.1.adoc']
1903 bashcompletions += ['irqtop']
1906 opt = not get_option('build-ipcs').disabled()
1910 include_directories : includes,
1911 link_with : [lib_common,
1913 install_dir : usrbin_exec_dir,
1915 build_by_default : opt)
1916 if opt and not is_disabler(exe)
1918 manadocs += ['sys-utils/lsipc.1.adoc']
1919 bashcompletions += ['lsipc']
1926 include_directories : includes,
1927 link_with : [lib_common],
1928 dependencies : [lib_m,
1930 install_dir : sbindir,
1932 build_by_default : opt)
1933 if opt and not is_disabler(exe)
1935 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1936 bashcompletions += ['hwclock']
1942 include_directories : includes,
1943 install_dir : sbindir,
1946 manadocs += ['disk-utils/mkfs.8.adoc']
1947 bashcompletions += ['mkfs']
1949 opt = not get_option('build-bfs').disabled()
1953 include_directories : includes,
1954 link_with : [lib_common],
1955 install_dir : sbindir,
1957 build_by_default : opt)
1958 if opt and not is_disabler(exe)
1960 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1961 bashcompletions += ['mkfs.bfs']
1967 include_directories : includes,
1968 link_with : [lib_common],
1969 install_dir : usrbin_exec_dir,
1972 manadocs += ['disk-utils/isosize.8.adoc']
1973 bashcompletions += ['isosize']
1978 include_directories : includes,
1979 link_with : [lib_common,
1982 dependencies: [lib_selinux],
1983 install_dir : sbindir,
1985 if opt and not is_disabler(exe)
1987 manadocs += ['disk-utils/mkswap.8.adoc']
1988 bashcompletions += ['mkswap']
1994 include_directories : includes,
1995 link_with : [lib_common,
1998 install_dir : sbindir,
2000 if opt and not is_disabler(exe)
2002 manadocs += ['disk-utils/swaplabel.8.adoc']
2003 bashcompletions += ['swaplabel']
2006 opt = not get_option('build-fsck').disabled()
2010 include_directories : includes,
2011 link_with : [lib_common,
2014 dependencies : realtime_libs,
2015 install_dir : sbindir,
2017 build_by_default : opt)
2018 if opt and not is_disabler(exe)
2020 manadocs += ['disk-utils/fsck.8.adoc']
2021 bashcompletions += ['fsck']
2024 opt = not get_option('build-minix').disabled()
2028 include_directories : includes,
2029 link_with : [lib_common],
2030 install_dir : sbindir,
2032 build_by_default : opt)
2036 include_directories : includes,
2037 c_args : '-DTEST_SCRIPT',
2038 link_with : [lib_common],
2039 build_by_default : opt)
2043 include_directories : includes,
2044 link_with : [lib_common],
2045 install_dir : sbindir,
2047 build_by_default : opt)
2048 if opt and not is_disabler(exe)
2049 exes += [exe, exe2, exe3]
2050 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2051 bashcompletions += ['mkfs.minix', 'fsck.minix']
2054 opt = not get_option('build-cramfs').disabled()
2057 mkfs_cramfs_sources,
2058 include_directories : includes,
2059 link_with : [lib_common],
2060 dependencies : [lib_z],
2061 install_dir : sbindir,
2063 build_by_default : opt)
2066 fsck_cramfs_sources,
2067 include_directories : includes,
2068 link_with : [lib_common],
2069 dependencies : [lib_z],
2070 install_dir : sbindir,
2072 build_by_default : opt)
2073 if not is_disabler(exe)
2075 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2076 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2079 opt = not get_option('build-raw').disabled()
2081 cc.has_header('linux/raw.h', required: opt)
2086 include_directories : includes,
2087 install_dir : sbindir,
2089 build_by_default : opt)
2090 if opt and not is_disabler(exe)
2092 manadocs += ['disk-utils/raw.8.adoc']
2093 bashcompletions += ['raw']
2096 opt = not get_option('build-fdformat').disabled()
2100 include_directories : includes,
2101 link_with : [lib_common],
2102 install_dir : usrsbin_exec_dir,
2104 build_by_default : opt)
2105 if opt and not is_disabler(exe)
2107 manadocs += ['disk-utils/fdformat.8.adoc']
2113 include_directories : includes,
2114 link_with : [lib_common],
2115 install_dir : sbindir,
2117 manadocs += ['disk-utils/blockdev.8.adoc']
2118 bashcompletions += ['blockdev']
2120 opt = not get_option('build-fdisks').disabled()
2121 if opt and not have_dirfd and not have_ddfd
2122 error('neither dirfd nor ddfd are available')
2127 include_directories : includes,
2128 link_with : [lib_common,
2132 dependencies : [lib_readline],
2133 install_dir : sbindir,
2135 build_by_default : opt)
2136 if opt and not is_disabler(exe)
2138 bashcompletions += ['fdisk']
2141 opt2 = opt and 'fdisk' in static_programs
2145 link_args : ['--static'],
2146 include_directories : includes,
2147 link_with : [lib_common,
2150 lib_smartcols.get_static_lib()],
2151 dependencies : [lib_readline_static],
2152 install_dir : sbindir,
2154 build_by_default : opt2)
2155 if opt2 and not is_disabler(exe)
2162 include_directories : includes,
2163 link_with : [lib_common,
2167 dependencies : [lib_readline],
2168 install_dir : sbindir,
2170 build_by_default : opt)
2171 if opt and not is_disabler(exe)
2173 bashcompletions += ['sfdisk']
2176 opt2 = opt and 'sfdisk' in static_programs
2180 include_directories : includes,
2181 link_with : [lib_common,
2184 lib_smartcols.get_static_lib()],
2185 dependencies : [lib_readline_static],
2186 install_dir : sbindir,
2188 build_by_default : opt2)
2189 if opt2 and not is_disabler(exe)
2196 include_directories : includes,
2197 link_with : [lib_common,
2202 dependencies : [curses_libs],
2203 install_dir : sbindir,
2205 build_by_default : opt)
2206 if opt and not is_disabler(exe)
2208 manadocs += ['disk-utils/fdisk.8.adoc',
2209 'disk-utils/sfdisk.8.adoc',
2210 'disk-utils/cfdisk.8.adoc']
2211 bashcompletions += ['cfdisk']
2214 opt = not get_option('build-partx').disabled()
2218 include_directories : includes,
2219 link_with : [lib_common],
2220 install_dir : usrsbin_exec_dir,
2222 build_by_default : opt)
2226 include_directories : includes,
2227 link_with : [lib_common],
2228 install_dir : usrsbin_exec_dir,
2230 build_by_default : opt)
2234 include_directories : includes,
2235 link_with : [lib_common],
2236 install_dir : usrsbin_exec_dir,
2238 build_by_default : opt)
2242 include_directories : includes,
2243 link_with : [lib_common,
2246 install_dir : usrsbin_exec_dir,
2248 build_by_default : opt)
2250 exes += [exe, exe2, exe3, exe4]
2251 manadocs += ['disk-utils/addpart.8.adoc',
2252 'disk-utils/delpart.8.adoc',
2253 'disk-utils/resizepart.8.adoc',
2254 'disk-utils/partx.8.adoc']
2255 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2258 ############################################################
2263 include_directories : includes,
2264 link_with : [lib_common],
2265 dependencies : [lib_util,
2269 install_dir : usrbin_exec_dir,
2272 manadocs += ['term-utils/script.1.adoc']
2273 bashcompletions += ['script']
2278 include_directories : includes,
2279 c_args : '-DTEST_SCRIPT',
2280 link_with : [lib_common],
2281 dependencies : [lib_util,
2290 include_directories : includes,
2291 link_with : [lib_common],
2292 dependencies : [lib_util,
2295 install_dir : usrbin_exec_dir,
2298 manadocs += ['term-utils/scriptlive.1.adoc']
2299 bashcompletions += ['scriptlive']
2303 scriptreplay_sources,
2304 include_directories : includes,
2305 link_with : [lib_common],
2306 dependencies : [math_libs],
2307 install_dir : usrbin_exec_dir,
2310 manadocs += ['term-utils/scriptreplay.1.adoc']
2311 bashcompletions += ['scriptreplay']
2313 opt = not get_option('build-agetty').disabled()
2317 include_directories : includes,
2318 link_with : [lib_common, logindefs_c],
2319 dependencies : BSD ? lib_util : [],
2320 install_dir : sbindir,
2322 build_by_default : opt)
2325 manadocs += ['term-utils/agetty.8.adoc']
2328 opt = not get_option('build-setterm').disabled()
2332 include_directories : includes,
2333 link_with : [lib_common],
2334 dependencies : [curses_libs],
2335 install_dir : usrbin_exec_dir,
2337 build_by_default : opt)
2340 manadocs += ['term-utils/setterm.1.adoc']
2341 bashcompletions += ['setterm']
2344 opt = not get_option('build-mesg').disabled()
2348 include_directories : includes,
2349 link_with : [lib_common],
2350 install_dir : usrbin_exec_dir,
2352 build_by_default : opt)
2355 manadocs += ['term-utils/mesg.1.adoc']
2356 bashcompletions += ['mesg']
2359 opt = not get_option('build-wall').disabled()
2363 include_directories : includes,
2364 link_with : [lib_common],
2365 install_dir : usrbin_exec_dir,
2367 build_by_default : opt)
2370 manadocs += ['term-utils/wall.1.adoc']
2371 bashcompletions += ['wall']
2374 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2375 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2377 opt = not get_option('build-write').disabled()
2381 include_directories : includes,
2382 link_with : [lib_common],
2383 install_dir : usrbin_exec_dir,
2385 build_by_default : opt)
2388 manadocs += ['term-utils/write.1.adoc']
2391 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2392 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2394 opt = not get_option('build-login').disabled()
2398 include_directories : includes,
2399 link_with : [lib_common, logindefs_c],
2400 dependencies : [lib_pam,
2404 build_by_default : opt)
2405 if not is_disabler(exe)
2407 manadocs += ['login-utils/login.1.adoc']
2410 opt = not get_option('build-sulogin').disabled()
2414 include_directories : includes,
2415 link_with : [lib_common],
2416 dependencies : [lib_crypt,
2418 install_dir : sbindir,
2420 build_by_default : opt)
2421 if not is_disabler(exe)
2423 manadocs += ['login-utils/sulogin.8.adoc']
2429 include_directories : includes,
2430 link_with : [lib_common,
2432 dependencies : [curses_libs],
2433 install_dir : usrbin_exec_dir,
2436 manadocs += ['misc-utils/cal.1.adoc']
2437 bashcompletions += ['cal']
2439 opt = not get_option('build-logger').disabled()
2443 include_directories : includes,
2444 link_with : [lib_common],
2445 dependencies : [lib_systemd],
2446 install_dir : usrbin_exec_dir,
2448 build_by_default : opt)
2449 if opt and not is_disabler(exe)
2451 manadocs += ['misc-utils/logger.1.adoc']
2452 bashcompletions += ['logger']
2458 include_directories : includes,
2459 c_args : '-DTEST_LOGGER',
2460 link_with : [lib_common],
2461 dependencies : [lib_systemd])
2462 if not is_disabler(exe)
2469 include_directories : includes,
2470 install_dir : usrbin_exec_dir,
2473 manadocs += ['misc-utils/look.1.adoc']
2474 bashcompletions += ['look']
2479 include_directories : includes,
2480 link_with : [lib_common],
2481 install_dir : usrbin_exec_dir,
2484 manadocs += ['misc-utils/mcookie.1.adoc']
2485 bashcompletions += ['mcookie']
2490 include_directories : includes,
2491 dependencies : [lib_selinux],
2492 install_dir : usrbin_exec_dir,
2495 manadocs += ['misc-utils/namei.1.adoc']
2496 bashcompletions += ['namei']
2501 include_directories : includes,
2502 link_with : [lib_common],
2503 install_dir : usrbin_exec_dir,
2506 manadocs += ['misc-utils/whereis.1.adoc']
2507 bashcompletions += ['whereis']
2512 include_directories : includes,
2513 link_with : [lib_common,
2516 install_dir : usrbin_exec_dir,
2518 if not is_disabler(exe)
2520 manadocs += ['misc-utils/lslocks.8.adoc']
2521 bashcompletions += ['lslocks']
2527 include_directories : includes,
2528 link_with : [lib_common,
2532 dependencies : lib_udev,
2534 if not is_disabler(exe)
2536 manadocs += ['misc-utils/lsblk.8.adoc']
2537 bashcompletions += ['lsblk']
2543 include_directories : includes,
2544 link_with : [lib_common,
2546 install_dir : usrbin_exec_dir,
2548 if not is_disabler(exe)
2550 manadocs += ['misc-utils/lsfd.1.adoc']
2556 include_directories : includes,
2557 link_with : [lib_uuid],
2558 install_dir : usrbin_exec_dir,
2560 if not is_disabler(exe)
2562 manadocs += ['misc-utils/uuidgen.1.adoc']
2563 bashcompletions += ['uuidgen']
2569 include_directories : includes,
2570 link_with : [lib_common,
2573 install_dir : usrbin_exec_dir,
2575 if not is_disabler(exe)
2577 manadocs += ['misc-utils/uuidparse.1.adoc']
2578 bashcompletions += ['uuidparse']
2585 include_directories : includes,
2586 link_with : [lib_common,
2588 dependencies : [realtime_libs,
2590 install_dir : usrsbin_exec_dir,
2592 build_by_default : opt)
2596 include_directories : includes,
2597 link_with : [lib_common,
2599 dependencies : thread_libs,
2600 build_by_default : opt)
2601 if not is_disabler(exe)
2603 manadocs += ['misc-utils/uuidd.8.adoc']
2604 bashcompletions += ['uuidd']
2607 opt = build_libblkid
2611 include_directories : includes,
2612 link_with : [lib_common,
2614 install_dir : sbindir,
2616 build_by_default : opt)
2617 if opt and not is_disabler(exe)
2619 manadocs += ['misc-utils/blkid.8.adoc']
2620 bashcompletions += ['blkid']
2623 opt = opt and 'blkid' in static_programs
2627 include_directories : includes,
2628 link_with : [lib_common,
2630 install_dir : sbindir,
2632 build_by_default : opt)
2633 if opt and not is_disabler(exe)
2639 'libblkid/samples/mkfs.c',
2640 include_directories : includes,
2641 link_with : lib_blkid)
2642 if not is_disabler(exe)
2647 'sample-partitions',
2648 'libblkid/samples/partitions.c',
2649 include_directories : includes,
2650 link_with : lib_blkid)
2651 if not is_disabler(exe)
2656 'sample-superblocks',
2657 'libblkid/samples/superblocks.c',
2658 include_directories : includes,
2659 link_with : lib_blkid)
2660 if not is_disabler(exe)
2666 'libblkid/samples/topology.c',
2667 include_directories : includes,
2668 link_with : lib_blkid)
2669 if not is_disabler(exe)
2674 'test_blkid_fuzz_sample',
2675 'libblkid/src/fuzz.c',
2676 include_directories: includes,
2677 link_with: lib_blkid)
2678 if not is_disabler(exe)
2682 ############################################################
2687 include_directories : includes,
2688 link_with : [lib_blkid],
2689 install_dir : sbindir,
2691 if not is_disabler(exe)
2693 manadocs += ['misc-utils/findfs.8.adoc']
2694 bashcompletions += ['findfs']
2700 include_directories : includes,
2701 link_with : [lib_common,
2704 install_dir : sbindir,
2706 if not is_disabler(exe)
2708 manadocs += ['misc-utils/wipefs.8.adoc']
2709 bashcompletions += ['wipefs']
2715 include_directories : includes,
2716 link_with : [lib_common,
2720 dependencies : [lib_udev],
2722 if not is_disabler(exe)
2724 manadocs += ['misc-utils/findmnt.8.adoc']
2725 bashcompletions += ['findmnt']
2731 include_directories : includes,
2732 link_with : [lib_common],
2734 if not is_disabler(exe)
2736 manadocs += ['misc-utils/kill.1.adoc']
2739 opt = not get_option('build-rename').disabled()
2743 include_directories : includes,
2744 install_dir : usrbin_exec_dir,
2746 build_by_default : opt)
2747 if opt and not is_disabler(exe)
2749 manadocs += ['misc-utils/rename.1.adoc']
2750 bashcompletions += ['rename']
2756 include_directories : includes,
2757 link_with : [lib_common],
2758 install_dir : usrbin_exec_dir,
2761 manadocs += ['misc-utils/getopt.1.adoc']
2762 bashcompletions += ['getopt']
2767 include_directories : includes,
2768 link_with : [lib_common,
2770 install_dir : usrbin_exec_dir,
2772 if not is_disabler(exe)
2774 manadocs += ['misc-utils/fincore.1.adoc']
2775 bashcompletions += ['fincore']
2781 include_directories : includes,
2782 link_with : [lib_common],
2783 install_dir : usrbin_exec_dir,
2785 if not is_disabler(exe)
2787 manadocs += ['misc-utils/hardlink.1.adoc']
2788 bashcompletions += ['hardlink']
2791 opt = not get_option('build-pipesz').disabled()
2795 include_directories : includes,
2796 link_with : [lib_common],
2797 install_dir : usrbin_exec_dir,
2799 if opt and not is_disabler(exe)
2801 manadocs += ['misc-utils/pipesz.1.adoc']
2802 bashcompletions += ['pipesz']
2808 include_directories : includes,
2809 c_args : '-DTEST_CAL',
2810 link_with : [lib_common,
2812 dependencies : [curses_libs])
2813 if not is_disabler(exe)
2820 include_directories : includes,
2821 link_with : [lib_common],
2822 install_dir : usrbin_exec_dir,
2824 if not is_disabler(exe)
2826 manadocs += ['misc-utils/fadvise.1.adoc']
2827 bashcompletions += ['fadvise']
2833 include_directories : includes,
2834 link_with : [lib_common],
2835 install_dir : usrbin_exec_dir,
2837 if not is_disabler(exe)
2839 manadocs += ['misc-utils/waitpid.1.adoc']
2840 bashcompletions += ['waitpid']
2843 ############################################################
2845 opt = not get_option('build-schedutils').disabled()
2848 'schedutils/chrt.c',
2849 include_directories : includes,
2850 link_with : lib_common,
2851 install_dir : usrbin_exec_dir,
2853 build_by_default : opt)
2857 'schedutils/ionice.c',
2858 include_directories : includes,
2859 link_with : lib_common,
2860 install_dir : usrbin_exec_dir,
2862 build_by_default : opt)
2866 'schedutils/taskset.c',
2867 include_directories : includes,
2868 link_with : lib_common,
2869 install_dir : usrbin_exec_dir,
2871 build_by_default : opt)
2875 'schedutils/uclampset.c',
2876 include_directories : includes,
2877 link_with : lib_common,
2878 install_dir : usrbin_exec_dir,
2880 build_by_default : opt)
2882 if opt and not is_disabler(exe)
2883 exes += [exe, exe2, exe3, exe4]
2884 manadocs += ['schedutils/chrt.1.adoc',
2885 'schedutils/ionice.1.adoc',
2886 'schedutils/taskset.1.adoc',
2887 'schedutils/uclampset.1.adoc']
2888 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2891 ############################################################
2893 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2898 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2899 include_directories : dir_include,
2900 link_with : lib_common)
2906 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2907 include_directories : dir_include,
2908 link_with : lib_common)
2914 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2915 include_directories : dir_include,
2916 link_with : lib_common)
2922 c_args : ['-DTEST_PROGRAM_MANGLE'],
2923 include_directories : dir_include)
2929 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2930 include_directories : dir_include)
2936 'lib/color-names.c',
2937 c_args : ['-DTEST_PROGRAM_COLORS'],
2938 include_directories : dir_include,
2939 link_with : [lib_common, lib_tcolors])
2945 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2946 include_directories : dir_include)
2949 # XXX: HAVE_OPENAT && HAVE_DIRFD
2953 c_args : ['-DTEST_PROGRAM_PROCFS'],
2954 include_directories : dir_include,
2955 link_with : lib_common)
2958 # XXX: HAVE_OPENAT && HAVE_DIRFD
2963 have_cpu_set_t ? 'lib/cpuset.c' : [],
2964 c_args : ['-DTEST_PROGRAM_PATH'],
2965 include_directories : dir_include,
2966 link_with : lib_common)
2974 c_args : ['-DTEST_PROGRAM_PTY'],
2975 include_directories : dir_include,
2976 link_with : [lib_common],
2977 dependencies : [lib_m,
2986 c_args : ['-DTEST_PROGRAM_CPUSET'],
2987 include_directories : dir_include)
2997 have_cpu_set_t ? 'lib/cpuset.c' : [],
2998 c_args : ['-DTEST_PROGRAM_SYSFS'],
2999 include_directories : dir_include)
3005 c_args : ['-DTEST_PROGRAM_PAGER'],
3006 include_directories : dir_include)
3010 'test_linux_version',
3011 'lib/linux_version.c',
3012 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3013 include_directories : dir_include)
3019 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3020 include_directories : dir_include)
3024 'test_canonicalize',
3025 'lib/canonicalize.c',
3026 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3027 include_directories : dir_include)
3034 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3035 include_directories : dir_include)
3041 c_args : ['-DTEST_PROGRAM'],
3042 include_directories : dir_include,
3043 link_with : lib_common)
3049 c_args : ['-DTEST_PROGRAM'],
3050 include_directories : dir_include,
3051 link_with : [lib_common, logindefs_c])
3055 ############################################################
3059 'libuuid/src/test_uuid.c',
3060 include_directories : [dir_include, dir_libuuid],
3061 link_with : lib_uuid,
3062 dependencies : socket_libs)
3063 if not is_disabler(exe)
3067 ############################################################
3069 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3071 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3075 'libfdisk/src/ask.c',
3076 c_args : libfdisk_tests_cflags,
3077 include_directories : lib_fdisk_includes,
3078 link_with : libfdisk_tests_ldadd)
3079 if not is_disabler(exe)
3085 'libfdisk/src/gpt.c',
3086 c_args : libfdisk_tests_cflags,
3087 include_directories : lib_fdisk_includes,
3088 link_with : libfdisk_tests_ldadd)
3089 if not is_disabler(exe)
3095 'libfdisk/src/utils.c',
3096 c_args : libfdisk_tests_cflags,
3097 include_directories : lib_fdisk_includes,
3098 link_with : libfdisk_tests_ldadd)
3099 if not is_disabler(exe)
3104 'test_fdisk_script',
3105 'libfdisk/src/script.c',
3106 c_args : libfdisk_tests_cflags,
3107 include_directories : lib_fdisk_includes,
3108 link_with : libfdisk_tests_ldadd)
3109 if not is_disabler(exe)
3114 'test_fdisk_version',
3115 'libfdisk/src/version.c',
3116 c_args : libfdisk_tests_cflags,
3117 include_directories : lib_fdisk_includes,
3118 link_with : libfdisk_tests_ldadd)
3119 if not is_disabler(exe)
3125 'libfdisk/src/item.c',
3126 c_args : libfdisk_tests_cflags,
3127 include_directories : lib_fdisk_includes,
3128 link_with : libfdisk_tests_ldadd)
3129 if not is_disabler(exe)
3133 sample_fdisk_cflags = ['-Wno-unused']
3134 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3137 'sample-fdisk-mkpart',
3138 'libfdisk/samples/mkpart.c',
3139 c_args : sample_fdisk_cflags,
3140 include_directories : lib_fdisk_includes,
3141 link_with : sample_fdisk_ldadd)
3142 if not is_disabler(exe)
3147 'sample-fdisk-mkpart-fullspec',
3148 'libfdisk/samples/mkpart-fullspec.c',
3149 c_args : sample_fdisk_cflags,
3150 include_directories : lib_fdisk_includes,
3151 link_with : sample_fdisk_ldadd)
3152 if not is_disabler(exe)
3156 ############################################################
3160 'tests/helpers/test_mbsencode.c',
3161 include_directories : includes,
3162 link_with : lib_common)
3167 'tests/helpers/test_byteswap.c',
3168 include_directories : includes)
3173 'tests/helpers/test_md5.c',
3175 include_directories : includes)
3180 'tests/helpers/test_sha1.c',
3182 include_directories : includes)
3187 'tests/helpers/test_pathnames.c',
3188 include_directories : includes)
3193 'tests/helpers/test_strerror.c',
3194 include_directories : includes)
3199 'tests/helpers/test_sysinfo.c',
3200 include_directories : includes)
3205 'tests/helpers/test_sigreceive.c',
3206 include_directories : includes,
3207 link_with : lib_common)
3212 'tests/helpers/test_tiocsti.c',
3213 include_directories : includes)
3217 'test_uuid_namespace',
3218 'tests/helpers/test_uuid_namespace.c',
3222 include_directories : includes)
3228 'tests/helpers/test_mkfds.c',
3229 include_directories : includes)
3232 ############################################################
3236 'sample-scols-tree',
3237 'libsmartcols/samples/tree.c',
3238 include_directories : includes,
3239 link_with : [lib_smartcols, lib_common])
3240 if not is_disabler(exe)
3245 'sample-scols-title',
3246 'libsmartcols/samples/title.c',
3247 include_directories : includes,
3248 link_with : [lib_smartcols, lib_common])
3249 if not is_disabler(exe)
3254 'sample-scols-wrap',
3255 'libsmartcols/samples/wrap.c',
3256 include_directories : includes,
3257 link_with : [lib_smartcols, lib_common])
3258 if not is_disabler(exe)
3263 'sample-scols-continuous',
3264 'libsmartcols/samples/continuous.c',
3265 include_directories : includes,
3266 link_with : [lib_smartcols, lib_common])
3267 if not is_disabler(exe)
3272 'sample-scols-maxout',
3273 'libsmartcols/samples/maxout.c',
3274 include_directories : includes,
3275 link_with : [lib_smartcols, lib_common])
3276 if not is_disabler(exe)
3281 'sample-scols-fromfile',
3282 'libsmartcols/samples/fromfile.c',
3283 include_directories : includes,
3284 link_with : [lib_smartcols, lib_common])
3285 if not is_disabler(exe)
3290 'sample-scols-grouping-simple',
3291 'libsmartcols/samples/grouping-simple.c',
3292 include_directories : includes,
3293 link_with : [lib_smartcols, lib_common])
3294 if not is_disabler(exe)
3299 'sample-scols-grouping-overlay',
3300 'libsmartcols/samples/grouping-overlay.c',
3301 include_directories : includes,
3302 link_with : [lib_smartcols, lib_common])
3303 if not is_disabler(exe)
3307 ############################################################
3309 # Let the test runner know whether we're running under asan and export
3310 # some paths. We use a file on disk so that it is possible to run the
3311 # test scripts from commandline without setting any variables.
3312 configure_file(output : 'meson.conf',
3317 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3320 run_sh = find_program('tests/run.sh')
3324 '--srcdir=' + meson.current_source_dir(),
3325 '--builddir=' + meson.current_build_dir(),
3331 manadocs += ['lib/terminal-colors.d.5.adoc']
3332 manadocs += ['libblkid/libblkid.3.adoc']
3336 'libuuid/man/uuid.3.adoc',
3337 'libuuid/man/uuid_clear.3.adoc',
3338 'libuuid/man/uuid_compare.3.adoc',
3339 'libuuid/man/uuid_copy.3.adoc',
3340 'libuuid/man/uuid_generate.3.adoc',
3341 'libuuid/man/uuid_is_null.3.adoc',
3342 'libuuid/man/uuid_parse.3.adoc',
3343 'libuuid/man/uuid_time.3.adoc',
3344 'libuuid/man/uuid_unparse.3.adoc']
3346 'uuid_generate_random.3': 'uuid_generate.3',
3347 'uuid_generate_time.3': 'uuid_generate.3',
3348 'uuid_generate_time_safe.3': 'uuid_generate.3',
3352 asciidoctor = find_program('asciidoctor', required : false)
3353 if asciidoctor.found()
3354 foreach adoc : manadocs
3355 name = adoc.split('/')[-1]
3356 page = name.split('.adoc')[0]
3357 section = page.split('.')[-1]
3358 mandirn = join_paths(mandir, 'man' + section)
3363 command : [ asciidoctor,
3365 '-a', 'VERSION=' + meson.project_version(),
3366 '-a', 'release-version=' + meson.project_version(),
3367 '-a', 'ADJTIME_PATH=/etc/adjtime',
3368 '-a', 'package-docdir=' + docdir,
3369 '--base-dir=' + meson.current_source_dir(),
3370 '--destination-dir=' + meson.current_build_dir(),
3371 '--load-path', '@SOURCE_ROOT@/tools',
3372 '--require', 'asciidoctor-includetracker',
3376 depfile : page + '.deps',
3378 install_dir : mandirn)
3381 foreach link_name, target : manlinks
3382 link_section = link_name.split('.')[-1]
3383 target_section = target.split('.')[-1]
3384 meson.add_install_script(meson_make_manpage_stub,
3385 join_paths('man' + target_section, target),
3386 join_paths(mandir, 'man' + link_section, link_name))
3390 if bash_completion.found()
3391 foreach completion : bashcompletions
3393 join_paths('bash-completion', completion),
3394 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3397 foreach link_name, target : bashcompletionslinks
3398 meson.add_install_script(meson_make_symlink,
3400 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))