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)
175 linux/net_namespace.h
221 lib_m = cc.find_library('m')
223 lib_tinfo = dependency(
225 required : get_option('tinfo'))
227 lib_ncursesw = dependency(
229 required : get_option('ncursesw'))
230 if lib_ncursesw.found()
231 headers += ['ncursesw/ncurses.h',
235 lib_ncurses = disabler()
237 lib_ncurses = dependency(
239 required : get_option('ncurses'))
240 headers += ['ncurses.h',
244 conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
245 conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
246 conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
248 lib_slang = dependency(
250 required : get_option('slang'))
252 headers += ['slang.h',
257 conf.set('HAVE_SLANG', lib_slang.found())
259 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
260 if curses_libs.found()
261 have = cc.has_function('use_default_colors', dependencies : curses_libs)
262 conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false)
263 have = cc.has_function('resizeterm', dependencies : curses_libs)
264 conf.set('HAVE_RESIZETERM', have ? 1 : false)
271 required : get_option('zlib'))
273 lib_readline = dependency(
275 required : get_option('readline'))
276 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
278 lib_readline_static = dependency(
281 required : need_static_libs ? get_option('readline') : disabler())
283 if meson.version().version_compare('>= 0.59.0')
284 lib_intl = dependency(
286 required : get_option('nls'))
287 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
289 if get_option('nls').enabled()
290 error('nls is not supported with meson before 0.59.0')
292 lib_intl = dependency('', required : false)
295 lib_user = dependency(
298 required : get_option('libuser'))
299 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
301 lib_util = cc.find_library(
303 required : get_option('libutil'))
304 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
306 lib_utempter = cc.find_library(
308 required : get_option('libutempter'))
309 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
311 systemd = dependency(
313 required : get_option('systemd'))
315 lib_systemd = dependency(
317 required : get_option('systemd'))
318 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
319 conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false)
321 lib_udev = dependency(
323 required : get_option('systemd'))
324 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
326 lib_crypt = cc.find_library('crypt')
328 lib_pam = cc.find_library('pam', required : get_option('build-login'))
329 if not lib_pam.found()
330 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
332 if not lib_pam.found()
333 lib_pam = cc.find_library('pam', required : get_option('build-su'))
335 if not lib_pam.found()
336 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
339 lib_pam_misc = cc.find_library('pam_misc')
340 lib_pam = [lib_pam, lib_pam_misc]
342 lib_pam_misc = declare_dependency()
345 lib_cryptsetup = dependency(
347 required : get_option('cryptsetup'))
348 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
350 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
351 if meson.version().version_compare('>= 0.62.0')
352 lib_dl = dependency('dl')
354 lib_dl = cc.find_library('dl')
356 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
357 summary('cryptsetup support (dlopen)',
359 section : 'components')
361 summary('cryptsetup support',
362 lib_cryptsetup.found() ? 'enabled' : 'disabled',
363 section : 'components')
366 have = cc.has_function(
367 'crypt_activate_by_signed_key',
368 dependencies : lib_cryptsetup)
369 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
371 lib_cap_ng = dependency(
373 required : get_option('build-setpriv'))
375 lib_selinux = dependency(
378 required : get_option('selinux'))
379 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
381 lib_magic = dependency(
383 required : get_option('magic'))
384 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
386 lib_econf = dependency(
388 required : get_option('econf'))
389 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
391 lib_audit = dependency(
393 required : get_option('audit'))
394 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
396 conf.set('HAVE_SMACK', not get_option('smack').disabled())
398 foreach header : headers
399 have = cc.has_header(header)
400 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
403 header = 'linux/btrfs.h'
404 enable_btrfs = cc.has_header(header,
405 required : get_option('btrfs'))
406 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
407 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
409 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
414 have = cc.has_header(header,
416 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
419 have = cc.has_header('sched.h')
420 conf.set10('HAVE_DECL_CPU_ALLOC', have)
421 # We get -1 if the size cannot be determined
422 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
423 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
425 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
426 conf.set10('HAVE_ENVIRON_DECL', have)
428 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
429 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
431 have = cc.has_function('strsignal')
432 conf.set10('HAVE_STRSIGNAL_DECL', have)
434 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
435 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
437 have = cc.has_type('loff_t', prefix : '#include <sys/types.h>')
438 conf.set('HAVE_LOFF_T', have ? 1 : false)
440 have = cc.compiles('''
441 #define _GNU_SOURCE 1
442 #include <langinfo.h>
445 str = nl_langinfo (ALTMON_1);
446 str = nl_langinfo (ALTMON_2);
447 str = nl_langinfo (ALTMON_3);
448 str = nl_langinfo (ALTMON_4);
449 str = nl_langinfo (ALTMON_5);
450 str = nl_langinfo (ALTMON_6);
451 str = nl_langinfo (ALTMON_7);
452 str = nl_langinfo (ALTMON_8);
453 str = nl_langinfo (ALTMON_9);
454 str = nl_langinfo (ALTMON_10);
455 str = nl_langinfo (ALTMON_11);
456 str = nl_langinfo (ALTMON_12);
460 name : 'langinfo.h defines ALTMON_x constants')
461 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
463 have = cc.compiles('''
464 #define _GNU_SOURCE 1
465 #include <langinfo.h>
468 str = nl_langinfo (_NL_ABALTMON_1);
469 str = nl_langinfo (_NL_ABALTMON_2);
470 str = nl_langinfo (_NL_ABALTMON_3);
471 str = nl_langinfo (_NL_ABALTMON_4);
472 str = nl_langinfo (_NL_ABALTMON_5);
473 str = nl_langinfo (_NL_ABALTMON_6);
474 str = nl_langinfo (_NL_ABALTMON_7);
475 str = nl_langinfo (_NL_ABALTMON_8);
476 str = nl_langinfo (_NL_ABALTMON_9);
477 str = nl_langinfo (_NL_ABALTMON_10);
478 str = nl_langinfo (_NL_ABALTMON_11);
479 str = nl_langinfo (_NL_ABALTMON_12);
483 name : 'langinfo.h defines _NL_ABALTMON_x constants')
484 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
577 have = cc.has_function(func)
578 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
579 # This makes little sense, but is necessary to avoid warnings about
580 # redefined macros from Python.h, which uses this convention.
581 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
584 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
585 conf.set('AGETTY_RELOAD', have ? 1 : false)
587 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
590 have_dirfd = (cc.has_function('dirfd') or
591 cc.has_header_symbol('dirent.h', 'dirfd',
592 prefix : '#include <sys/types.h>'))
593 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
595 have_ddfd = cc.has_member('DIR', 'dd_fd',
597 #include <sys/types.h>
600 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
602 have = cc.has_member('struct tm', 'tm_gmtoff',
607 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
611 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
612 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
614 have = cc.has_member('struct termios', 'c_line',
615 prefix : '#include <termios.h>')
616 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
618 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
619 prefix : '#include <sys/stat.h>')
620 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
622 # replacement for AC_STRUCT_TIMEZONE
623 have = cc.has_member('struct tm', 'tm_zone',
624 prefix : '#include <time.h>')
625 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
627 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
628 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
630 have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY')
631 conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false)
633 have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY')
634 conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false)
639 extern char *tzname[];
642 return tzname ? 0 : 1;
644 '''.format(have ? 1 : 0)
645 have = cc.compiles(code, name : 'using tzname[]')
646 conf.set('HAVE_TZNAME', have ? 1 : false)
649 if not cc.has_function('socket')
650 socket_libs += cc.find_library('socket', required : true)
651 have = cc.has_function('socket',
652 dependencies : socket_libs)
654 error('socket() function not available')
659 have = cc.has_function('clock_gettime')
661 realtime_libs += cc.find_library('rt', required : true)
662 have = cc.has_function('clock_gettime',
663 dependencies : realtime_libs)
665 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
667 thread_libs = dependency('threads')
669 have = cc.has_function('timer_create')
671 realtime_libs = [cc.find_library('rt', required : true)]
672 have = cc.has_function('timer_create',
673 dependencies : realtime_libs)
675 realtime_libs += thread_libs
676 have = cc.has_function('timer_create',
677 dependencies : realtime_libs)
680 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
682 have = cc.has_function('setitimer')
683 conf.set('HAVE_SETITIMER', have ? 1 : false)
686 rtas_libs = cc.find_library('rtas', required : false)
687 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
690 if not cc.has_header_symbol('math.h', 'isnan')
691 lib = cc.find_library('m', required : true)
692 if (cc.has_function('isnan', dependencies : lib) and
693 cc.has_function('__isnan', dependencies : lib))
698 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
699 args : '-D_GNU_SOURCE')
700 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
703 extern char *__progname;
705 return (*__progname != 0);
708 have = cc.compiles(code, name : 'using __progname')
709 conf.set('HAVE___PROGNAME', have ? 1 : false)
711 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
712 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
714 build_plymouth_support = get_option('build-plymouth-support')
715 have_tiocglcktrmios = cc.has_header_symbol(
716 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
717 required : build_plymouth_support.enabled())
718 have_sock_cloexec = cc.has_header_symbol(
719 'sys/socket.h', 'SOCK_CLOEXEC',
720 prefix : '#include <sys/types.h>',
721 required : build_plymouth_support.enabled())
722 have_sock_nonblock = cc.has_header_symbol(
723 'sys/socket.h', 'SOCK_NONBLOCK',
724 prefix : '#include <sys/types.h>',
725 required : build_plymouth_support.enabled())
726 have_so_passcred = cc.has_header_symbol(
727 'sys/socket.h', 'SO_PASSCRED',
728 prefix : '#include <sys/types.h>',
729 required : build_plymouth_support.enabled())
731 build_plymouth_support = (not build_plymouth_support.disabled() and
732 have_tiocglcktrmios and
733 have_sock_cloexec and
734 have_sock_nonblock and
736 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
737 summary('plymouth support',
738 build_plymouth_support ? 'enabled' : 'disabled',
739 section : 'components')
741 # check for valid fallocate() function
742 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
743 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
744 # and program can't be linked.
752 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
753 return ret == 0 ? 0 : 1;
756 have = cc.links(code, name : 'fallocate() function')
757 conf.set('HAVE_FALLOCATE', have ? 1 : false)
765 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
766 return ret == 0 ? 0 : 1;
769 have = cc.links(code, name : 'posix_fallocate() function')
770 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
772 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
773 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
774 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
776 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
777 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
778 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
780 ############################################################
783 fs_search_path = get_option('fs-search-path')
784 fs_search_path_extra = get_option('fs-search-path-extra')
785 if fs_search_path_extra != ''
786 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
788 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
790 systemdsystemunitdir = ''
792 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
795 sysvinit = get_option('sysvinit').enabled()
796 sysvinitrcdir = sysconfdir + '/init.d'
798 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
799 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
801 have = get_option('chsh-only-listed')
802 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
804 have = get_option('use-tty-group')
805 conf.set('USE_TTY_GROUP', have ? 1 : false)
807 build_hwclock = not get_option('build-hwclock').disabled()
808 bison = find_program('bison', required: build_hwclock)
809 bison_gen = generator(
811 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
812 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
816 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
817 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
821 configuration : conf)
823 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
828 '-Waddress-of-packed-member',
829 '-Wdiscarded-qualifiers',
830 '-Wembedded-directive',
833 '-Wimplicit-function-declaration',
834 '-Wmissing-declarations',
835 '-Wmissing-parameter-type',
836 '-Wmissing-prototypes',
838 '-Wno-missing-field-initializers',
839 '-Wold-style-definition',
843 '-Wstrict-prototypes',
846 '-Wunused-but-set-parameter',
847 '-Wunused-but-set-variable',
848 '-Wunused-parameter',
852 foreach compiler_flag : compiler_flags
853 if cc.has_argument(compiler_flag)
854 add_project_arguments(compiler_flag, language : 'c')
862 bashcompletionslinks = {}
868 subdir('libsmartcols')
871 subdir('login-utils')
879 includes = [dir_include,
889 opt = not get_option('build-chfn-chsh').disabled()
894 include_directories : includes,
895 link_with : [lib_common, logindefs_c],
896 dependencies : chfn_chsh_deps,
897 install_dir : usrbin_exec_dir,
899 build_by_default : opt)
903 'login-utils/chsh.c',
906 include_directories : includes,
907 link_with : lib_common,
908 dependencies : chfn_chsh_deps,
909 install_dir : usrbin_exec_dir,
911 build_by_default : opt)
912 if opt and not is_disabler(exe)
914 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
915 bashcompletions += ['chfn', 'chsh']
920 test_islocal_sources,
921 include_directories : includes,
922 c_args : '-DTEST_PROGRAM')
927 test_consoles_sources,
928 c_args : ['-DTEST_PROGRAM'],
929 include_directories : includes,
930 link_with : lib_common)
933 opt = not get_option('build-last').disabled()
937 include_directories : includes,
938 link_with : [lib_common],
939 install_dir : usrbin_exec_dir,
941 build_by_default : opt)
942 if opt and not is_disabler(exe)
944 meson.add_install_script(meson_make_symlink,
946 join_paths(usrbin_exec_dir, 'lastb'))
947 manadocs += ['login-utils/last.1.adoc']
948 manlinks += {'lastb.1': 'last.1'}
949 bashcompletions += ['last']
950 bashcompletionslinks += {'lastb': 'last'}
953 opt = not get_option('build-nologin').disabled()
956 'login-utils/nologin.c',
957 include_directories : includes,
958 install_dir : sbindir,
959 link_with : [lib_common],
961 build_by_default : opt)
962 if opt and not is_disabler(exe)
964 manadocs += ['login-utils/nologin.8.adoc']
967 opt = not get_option('build-utmpdump').disabled()
970 'login-utils/utmpdump.c',
971 include_directories : includes,
972 link_with : [lib_common],
973 install_dir : usrbin_exec_dir,
975 build_by_default : opt)
976 if opt and not is_disabler(exe)
978 manadocs += ['login-utils/utmpdump.1.adoc']
979 bashcompletions += ['utmpdump']
982 opt = not get_option('build-su').disabled()
986 'login-utils/su-common.c',
987 'login-utils/su-common.h',
991 include_directories : includes,
992 link_with : [lib_common, logindefs_c],
993 dependencies : [lib_pam,
998 build_by_default : opt)
999 if opt and not is_disabler(exe)
1001 manadocs += ['login-utils/su.1.adoc']
1002 bashcompletions += ['su']
1005 opt = not get_option('build-newgrp').disabled()
1008 'login-utils/newgrp.c',
1009 include_directories : includes,
1010 dependencies : [lib_crypt],
1011 install_dir : usrbin_exec_dir,
1013 build_by_default : opt)
1014 if opt and not is_disabler(exe)
1016 manadocs += ['login-utils/newgrp.1.adoc']
1019 opt = not get_option('build-lslogins').disabled()
1022 'login-utils/lslogins.c',
1023 include_directories : includes,
1024 link_with : [lib_common,
1027 dependencies : [lib_selinux,
1029 install_dir : usrbin_exec_dir,
1031 build_by_default : opt)
1032 if opt and not is_disabler(exe)
1034 manadocs += ['login-utils/lslogins.1.adoc']
1035 bashcompletions += ['lslogins']
1038 opt = not get_option('build-vipw').disabled()
1041 'login-utils/vipw.c',
1042 'login-utils/setpwnam.h',
1043 include_directories : includes,
1044 link_with : [lib_common],
1045 dependencies : [lib_selinux],
1046 install_dir : usrbin_exec_dir,
1048 build_by_default : opt)
1049 if opt and not is_disabler(exe)
1051 meson.add_install_script(meson_make_symlink,
1053 join_paths(usrbin_exec_dir, 'vigr'))
1054 manadocs += ['login-utils/vipw.8.adoc']
1057 opt = not get_option('build-runuser').disabled()
1060 'login-utils/runuser.c',
1061 'login-utils/su-common.c',
1062 'login-utils/su-common.h',
1066 include_directories : includes,
1067 link_with : [lib_common, logindefs_c],
1068 dependencies : [lib_pam,
1072 install_dir : sbindir,
1074 build_by_default : opt)
1075 if opt and not is_disabler(exe)
1077 manadocs += ['login-utils/runuser.1.adoc']
1078 bashcompletionslinks += {'runuser': 'su'}
1081 ############################################################
1086 include_directories : includes,
1087 link_with : lib_common,
1088 install_dir : usrbin_exec_dir,
1091 manadocs += ['text-utils/col.1.adoc']
1092 bashcompletions += ['col']
1097 include_directories : includes,
1098 install_dir : usrbin_exec_dir,
1101 manadocs += ['text-utils/colcrt.1.adoc']
1102 bashcompletions += ['colcrt']
1107 include_directories : includes,
1108 link_with : lib_common,
1109 install_dir : usrbin_exec_dir,
1112 manadocs += ['text-utils/colrm.1.adoc']
1113 bashcompletions += ['colrm']
1118 include_directories : includes,
1119 install_dir : usrbin_exec_dir,
1122 manadocs += ['text-utils/rev.1.adoc']
1123 bashcompletions += ['rev']
1128 include_directories : includes,
1129 link_with : [lib_common,
1131 install_dir : usrbin_exec_dir,
1133 if not is_disabler(exe)
1135 manadocs += ['text-utils/column.1.adoc']
1136 bashcompletions += ['column']
1139 opt = not get_option('build-line').disabled()
1143 include_directories : includes,
1144 install_dir : usrbin_exec_dir,
1146 build_by_default : opt)
1147 if opt and not is_disabler(exe)
1149 manadocs += ['text-utils/line.1.adoc']
1152 opt = not get_option('build-pg').disabled()
1156 link_with : lib_common,
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/pg.1.adoc']
1166 bashcompletions += ['pg']
1169 opt = not get_option('build-ul').disabled()
1173 include_directories : includes,
1174 dependencies : [lib_tinfo,
1176 install_dir : usrbin_exec_dir,
1178 build_by_default : opt)
1179 if opt and not is_disabler(exe)
1181 manadocs += ['text-utils/ul.1.adoc']
1182 bashcompletions += ['ul']
1185 opt = not get_option('build-more').disabled()
1189 link_with : [lib_common],
1190 include_directories : includes,
1191 dependencies : [lib_tinfo,
1195 build_by_default : opt)
1199 link_with : [lib_common],
1200 include_directories : includes,
1201 c_args : '-DTEST_PROGRAM',
1202 dependencies : [lib_tinfo,
1205 build_by_default : opt)
1207 if opt and not is_disabler(exe)
1209 manadocs += ['text-utils/more.1.adoc']
1210 bashcompletions += ['more']
1216 include_directories : includes,
1217 link_with : [lib_common,
1219 install_dir : usrbin_exec_dir,
1221 if not is_disabler(exe)
1223 manadocs += ['text-utils/hexdump.1.adoc']
1224 bashcompletions += ['hexdump']
1227 opt = not get_option('build-lsmem').disabled()
1231 include_directories : includes,
1232 link_with : [lib_common,
1234 install_dir : usrbin_exec_dir,
1236 build_by_default : opt)
1237 if opt and not is_disabler(exe)
1239 manadocs += ['sys-utils/lsmem.1.adoc']
1240 bashcompletions += ['lsmem']
1243 opt = not get_option('build-chmem').disabled()
1247 include_directories : includes,
1248 link_with : [lib_common],
1249 install_dir : usrbin_exec_dir,
1251 build_by_default : opt)
1252 if opt and not is_disabler(exe)
1254 manadocs += ['sys-utils/chmem.8.adoc']
1255 bashcompletions += ['chmem']
1261 include_directories : includes,
1262 link_with : [lib_common],
1263 install_dir : usrbin_exec_dir,
1266 manadocs += ['sys-utils/choom.1.adoc']
1271 include_directories : includes,
1272 link_with : [lib_common],
1273 install_dir : usrbin_exec_dir,
1276 manadocs += ['sys-utils/ipcmk.1.adoc']
1277 bashcompletions += ['ipcmk']
1282 include_directories : includes,
1283 link_with : [lib_common],
1284 install_dir : usrbin_exec_dir,
1287 manadocs += ['sys-utils/ipcrm.1.adoc']
1288 bashcompletions += ['ipcrm']
1290 opt = not get_option('build-ipcs').disabled()
1294 include_directories : includes,
1295 link_with : [lib_common],
1296 install_dir : usrbin_exec_dir,
1298 build_by_default : opt)
1299 if opt and not is_disabler(exe)
1301 manadocs += ['sys-utils/ipcs.1.adoc']
1302 bashcompletions += ['ipcs']
1305 opt = not get_option('build-rfkill').disabled()
1309 include_directories : includes,
1310 link_with : [lib_common,
1312 install_dir : usrsbin_exec_dir,
1314 build_by_default : opt)
1315 if opt and not is_disabler(exe)
1317 manadocs += ['sys-utils/rfkill.8.adoc']
1318 bashcompletions += ['rfkill']
1324 include_directories : includes,
1325 link_with : [lib_common,
1327 install_dir : usrbin_exec_dir,
1329 if not is_disabler(exe)
1331 manadocs += ['sys-utils/renice.1.adoc']
1332 bashcompletions += ['renice']
1338 include_directories : includes,
1339 link_with : [lib_common,
1341 install_dir : usrbin_exec_dir,
1343 if opt and not is_disabler(exe)
1345 manadocs += ['sys-utils/setsid.1.adoc']
1346 bashcompletions += ['setsid']
1351 readprofile_sources,
1352 include_directories : includes,
1353 link_with : [lib_common,
1355 install_dir : usrsbin_exec_dir,
1357 if not is_disabler(exe)
1359 manadocs += ['sys-utils/readprofile.8.adoc']
1360 bashcompletions += ['readprofile']
1363 opt = not get_option('build-tunelp').disabled()
1367 include_directories : includes,
1368 link_with : [lib_common],
1369 install_dir : usrsbin_exec_dir,
1371 build_by_default : opt)
1372 if opt and not is_disabler(exe)
1374 manadocs += ['sys-utils/tunelp.8.adoc']
1375 bashcompletions += ['tunelp']
1381 include_directories : includes,
1382 link_with : [lib_common,
1384 install_dir : sbindir,
1386 if not is_disabler(exe)
1388 manadocs += ['sys-utils/fstrim.8.adoc']
1389 bashcompletions += ['fstrim']
1395 include_directories : includes,
1396 link_with : [lib_common,
1399 if not is_disabler(exe)
1401 manadocs += ['sys-utils/dmesg.1.adoc']
1402 bashcompletions += ['dmesg']
1408 include_directories : dir_include,
1409 c_args : '-DTEST_DMESG',
1410 link_with : [lib_common,
1412 if not is_disabler(exe)
1419 include_directories : includes,
1420 link_with : [lib_common],
1421 install_dir : sbindir,
1424 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1425 bashcompletions += ['ctrlaltdel']
1430 include_directories : includes,
1431 install_dir : sbindir,
1434 manadocs += ['sys-utils/fsfreeze.8.adoc']
1435 bashcompletions += ['fsfreeze']
1440 include_directories : includes,
1441 link_with : [lib_common,
1443 install_dir : sbindir,
1446 manadocs += ['sys-utils/blkdiscard.8.adoc']
1447 bashcompletions += ['blkdiscard']
1452 include_directories : includes,
1453 link_with : [lib_common],
1454 install_dir : sbindir,
1457 manadocs += ['sys-utils/blkzone.8.adoc']
1458 bashcompletions += ['blkzone']
1463 include_directories : includes,
1464 link_with : [lib_common],
1465 install_dir : sbindir,
1468 manadocs += ['sys-utils/blkpr.8.adoc']
1473 include_directories : includes,
1474 link_with : [lib_common],
1475 install_dir : usrsbin_exec_dir,
1478 manadocs += ['sys-utils/ldattach.8.adoc']
1479 bashcompletions += ['ldattach']
1484 include_directories : includes,
1485 link_with : [lib_common],
1486 install_dir : usrsbin_exec_dir,
1489 manadocs += ['sys-utils/rtcwake.8.adoc']
1490 bashcompletions += ['rtcwake']
1495 include_directories : includes,
1496 link_with : [lib_common],
1497 install_dir : usrbin_exec_dir,
1500 manadocs += ['sys-utils/setarch.8.adoc']
1501 bashcompletions += ['setarch']
1503 setarch_links = ['uname26', 'linux32', 'linux64']
1504 setarch_links_arch = {
1505 's390x' : ['s390', 's390x'],
1507 'x86_64' : ['i386', 'x86_64'],
1508 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1509 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1510 'mips64' : ['mips', 'mips64', 'mips32'],
1511 'ia64' : ['i386', 'ia64'],
1512 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1514 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1516 foreach link: setarch_links
1517 meson.add_install_script(meson_make_symlink,
1519 join_paths(usrbin_exec_dir, link))
1520 manlinks += {link + '.8': 'setarch.8'}
1523 opt = not get_option('build-eject').disabled()
1527 include_directories : includes,
1528 link_with : [lib_common,
1530 install_dir : usrbin_exec_dir,
1532 build_by_default : opt)
1533 if opt and not is_disabler(exe)
1535 manadocs += ['sys-utils/eject.1.adoc']
1536 bashcompletions += ['eject']
1539 opt = not get_option('build-losetup').disabled()
1543 include_directories : includes,
1544 link_with : [lib_common,
1546 install_dir : sbindir,
1548 build_by_default : opt)
1549 if opt and not is_disabler(exe)
1550 manadocs += ['sys-utils/losetup.8.adoc']
1552 bashcompletions += ['losetup']
1555 opt = opt and 'losetup' in static_programs
1559 include_directories : includes,
1560 link_args : ['--static'],
1561 link_with : [lib_common,
1562 lib_smartcols.get_static_lib()],
1563 install_dir : sbindir,
1565 build_by_default : opt)
1566 if opt and not is_disabler(exe)
1570 opt = not get_option('build-zramctl').disabled()
1574 include_directories : includes,
1575 link_with : [lib_common,
1577 install_dir : sbindir,
1579 build_by_default : opt)
1580 if opt and not is_disabler(exe)
1582 manadocs += ['sys-utils/zramctl.8.adoc']
1583 bashcompletions += ['zramctl']
1589 include_directories : includes,
1590 link_with : [lib_common,
1592 install_dir : usrbin_exec_dir,
1594 if not is_disabler(exe)
1596 manadocs += ['sys-utils/prlimit.1.adoc']
1597 bashcompletions += ['prlimit']
1603 include_directories : includes,
1604 link_with : [lib_common,
1607 install_dir : usrbin_exec_dir,
1609 if not is_disabler(exe)
1611 manadocs += ['sys-utils/lsns.8.adoc']
1612 bashcompletions += ['lsns']
1615 opt = not get_option('build-mount').disabled()
1619 include_directories : includes,
1620 link_with : [lib_common,
1623 dependencies : lib_selinux,
1625 build_by_default : opt)
1629 include_directories : includes,
1630 link_with : [lib_common,
1633 build_by_default : opt)
1634 if opt and not is_disabler(exe)
1636 manadocs += ['sys-utils/fstab.5.adoc',
1637 'sys-utils/mount.8.adoc',
1638 'sys-utils/umount.8.adoc']
1639 bashcompletions += ['mount', 'umount']
1642 opt2 = opt and 'mount' in static_programs
1646 include_directories : includes,
1647 link_args : ['--static'],
1648 link_with : [lib_common,
1649 lib_smartcols_static,
1652 build_by_default : opt2)
1653 if opt2 and not is_disabler(exe)
1657 opt2 = opt and 'umount' in static_programs
1661 include_directories : includes,
1662 link_args : ['--static'],
1663 link_with : [lib_common,
1666 build_by_default : opt2)
1667 if opt2 and not is_disabler(exe)
1676 include_directories : includes,
1677 link_with : [lib_common,
1681 install_dir : sbindir,
1683 if not is_disabler(exe)
1685 manadocs += ['sys-utils/swapon.8.adoc']
1686 bashcompletions += ['swapon']
1692 include_directories : includes,
1693 link_with : [lib_common,
1696 install_dir : sbindir,
1698 if not is_disabler(exe)
1700 manlinks += {'swapoff.8': 'swapon.8'}
1701 bashcompletions += ['swapoff']
1707 include_directories : includes,
1708 link_with : [lib_common,
1710 dependencies : [rtas_libs],
1711 install_dir : usrbin_exec_dir,
1713 if not is_disabler(exe)
1715 manadocs += ['sys-utils/lscpu.1.adoc']
1716 bashcompletions += ['lscpu']
1722 include_directories : includes,
1723 link_with : [lib_common],
1724 install_dir : sbindir,
1727 manadocs += ['sys-utils/chcpu.8.adoc']
1728 bashcompletions += ['chcpu']
1733 include_directories : includes,
1734 link_with : [lib_common,
1737 if not is_disabler(exe)
1739 manadocs += ['sys-utils/wdctl.8.adoc']
1740 bashcompletions += ['wdctl']
1743 opt = not get_option('build-mountpoint').disabled()
1747 include_directories : includes,
1748 link_with : [lib_mount],
1750 build_by_default : opt)
1751 if opt and not is_disabler(exe)
1753 manadocs += ['sys-utils/mountpoint.1.adoc']
1754 bashcompletions += ['mountpoint']
1757 opt = not get_option('build-fallocate').disabled()
1761 include_directories : includes,
1762 link_with : [lib_common],
1763 install_dir : usrbin_exec_dir,
1765 build_by_default : opt)
1766 if opt and not is_disabler(exe)
1768 manadocs += ['sys-utils/fallocate.1.adoc']
1769 bashcompletions += ['fallocate']
1772 opt = not get_option('build-pivot_root').disabled()
1776 include_directories : includes,
1777 install_dir : sbindir,
1779 build_by_default : opt)
1780 if opt and not is_disabler(exe)
1782 manadocs += ['sys-utils/pivot_root.8.adoc']
1783 bashcompletions += ['pivot_root']
1786 opt = not get_option('build-switch_root').disabled()
1787 if opt and not have_dirfd and not have_ddfd
1788 error('neither dirfd nor ddfd are available')
1792 switch_root_sources,
1793 include_directories : includes,
1794 install_dir : sbindir,
1796 build_by_default : opt)
1797 if opt and not is_disabler(exe)
1799 manadocs += ['sys-utils/switch_root.8.adoc']
1802 opt = not get_option('build-unshare').disabled()
1806 include_directories : includes,
1807 link_with : [lib_common],
1808 install_dir : usrbin_exec_dir,
1810 build_by_default : opt)
1811 if opt and not is_disabler(exe)
1813 manadocs += ['sys-utils/unshare.1.adoc']
1814 bashcompletions += ['unshare']
1817 opt = opt and 'unshare' in static_programs
1821 include_directories : includes,
1822 link_with : [lib_common],
1823 install_dir : usrbin_exec_dir,
1825 build_by_default : opt)
1826 if opt and not is_disabler(exe)
1830 opt = not get_option('build-nsenter').disabled()
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)
1842 manadocs += ['sys-utils/nsenter.1.adoc']
1843 bashcompletions += ['nsenter']
1846 opt = opt and 'nsenter' in static_programs
1850 include_directories : includes,
1851 link_with : [lib_common],
1852 dependencies : [lib_selinux],
1853 install_dir : usrbin_exec_dir,
1855 build_by_default : opt)
1856 if opt and not is_disabler(exe)
1860 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1864 include_directories : includes,
1865 link_with : [lib_common],
1866 dependencies : [lib_cap_ng],
1867 install_dir : usrbin_exec_dir,
1869 build_by_default : opt)
1870 if opt and not is_disabler(exe)
1872 manadocs += ['sys-utils/setpriv.1.adoc']
1873 bashcompletions += ['setpriv']
1879 include_directories : includes,
1880 link_with : [lib_common],
1881 dependencies : realtime_libs,
1882 install_dir : usrbin_exec_dir,
1885 manadocs += ['sys-utils/flock.1.adoc']
1886 bashcompletions += ['flock']
1888 opt = not get_option('build-lsirq').disabled()
1892 include_directories : includes,
1893 link_with : [lib_common,
1895 install_dir : usrbin_exec_dir,
1897 build_by_default : opt)
1898 if opt and not is_disabler(exe)
1900 manadocs += ['sys-utils/lsirq.1.adoc']
1901 bashcompletions += ['lsirq']
1904 opt = not get_option('build-irqtop').disabled()
1908 include_directories : includes,
1909 dependencies : [realtime_libs, curses_libs],
1910 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/irqtop.1.adoc']
1919 bashcompletions += ['irqtop']
1922 opt = not get_option('build-ipcs').disabled()
1926 include_directories : includes,
1927 link_with : [lib_common,
1929 install_dir : usrbin_exec_dir,
1931 build_by_default : opt)
1932 if opt and not is_disabler(exe)
1934 manadocs += ['sys-utils/lsipc.1.adoc']
1935 bashcompletions += ['lsipc']
1942 include_directories : includes,
1943 link_with : [lib_common],
1944 dependencies : [lib_m,
1946 install_dir : sbindir,
1948 build_by_default : opt)
1949 if opt and not is_disabler(exe)
1951 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1952 bashcompletions += ['hwclock']
1958 include_directories : includes,
1959 install_dir : sbindir,
1962 manadocs += ['disk-utils/mkfs.8.adoc']
1963 bashcompletions += ['mkfs']
1965 opt = not get_option('build-bfs').disabled()
1969 include_directories : includes,
1970 link_with : [lib_common],
1971 install_dir : sbindir,
1973 build_by_default : opt)
1974 if opt and not is_disabler(exe)
1976 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1977 bashcompletions += ['mkfs.bfs']
1983 include_directories : includes,
1984 link_with : [lib_common],
1985 install_dir : usrbin_exec_dir,
1988 manadocs += ['disk-utils/isosize.8.adoc']
1989 bashcompletions += ['isosize']
1994 include_directories : includes,
1995 link_with : [lib_common,
1998 dependencies: [lib_selinux],
1999 install_dir : sbindir,
2001 if opt and not is_disabler(exe)
2003 manadocs += ['disk-utils/mkswap.8.adoc']
2004 bashcompletions += ['mkswap']
2010 include_directories : includes,
2011 link_with : [lib_common,
2014 install_dir : sbindir,
2016 if opt and not is_disabler(exe)
2018 manadocs += ['disk-utils/swaplabel.8.adoc']
2019 bashcompletions += ['swaplabel']
2022 opt = not get_option('build-fsck').disabled()
2026 include_directories : includes,
2027 link_with : [lib_common,
2030 dependencies : realtime_libs,
2031 install_dir : sbindir,
2033 build_by_default : opt)
2034 if opt and not is_disabler(exe)
2036 manadocs += ['disk-utils/fsck.8.adoc']
2037 bashcompletions += ['fsck']
2040 opt = not get_option('build-minix').disabled()
2044 include_directories : includes,
2045 link_with : [lib_common],
2046 install_dir : sbindir,
2048 build_by_default : opt)
2052 include_directories : includes,
2053 c_args : '-DTEST_SCRIPT',
2054 link_with : [lib_common],
2055 build_by_default : opt)
2059 include_directories : includes,
2060 link_with : [lib_common],
2061 install_dir : sbindir,
2063 build_by_default : opt)
2064 if opt and not is_disabler(exe)
2065 exes += [exe, exe2, exe3]
2066 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2067 bashcompletions += ['mkfs.minix', 'fsck.minix']
2070 opt = not get_option('build-cramfs').disabled()
2073 mkfs_cramfs_sources,
2074 include_directories : includes,
2075 link_with : [lib_common],
2076 dependencies : [lib_z],
2077 install_dir : sbindir,
2079 build_by_default : opt)
2082 fsck_cramfs_sources,
2083 include_directories : includes,
2084 link_with : [lib_common],
2085 dependencies : [lib_z],
2086 install_dir : sbindir,
2088 build_by_default : opt)
2089 if not is_disabler(exe)
2091 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2092 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2095 opt = not get_option('build-raw').disabled()
2097 cc.has_header('linux/raw.h', required: opt)
2102 include_directories : includes,
2103 install_dir : sbindir,
2105 build_by_default : opt)
2106 if opt and not is_disabler(exe)
2108 manadocs += ['disk-utils/raw.8.adoc']
2109 bashcompletions += ['raw']
2112 opt = not get_option('build-fdformat').disabled()
2116 include_directories : includes,
2117 link_with : [lib_common],
2118 install_dir : usrsbin_exec_dir,
2120 build_by_default : opt)
2121 if opt and not is_disabler(exe)
2123 manadocs += ['disk-utils/fdformat.8.adoc']
2129 include_directories : includes,
2130 link_with : [lib_common],
2131 install_dir : sbindir,
2133 manadocs += ['disk-utils/blockdev.8.adoc']
2134 bashcompletions += ['blockdev']
2136 opt = not get_option('build-fdisks').disabled()
2137 if opt and not have_dirfd and not have_ddfd
2138 error('neither dirfd nor ddfd are available')
2143 include_directories : includes,
2144 link_with : [lib_common,
2148 dependencies : [lib_readline],
2149 install_dir : sbindir,
2151 build_by_default : opt)
2152 if opt and not is_disabler(exe)
2154 bashcompletions += ['fdisk']
2157 opt2 = opt and 'fdisk' in static_programs
2161 link_args : ['--static'],
2162 include_directories : includes,
2163 link_with : [lib_common,
2166 lib_smartcols.get_static_lib()],
2167 dependencies : [lib_readline_static],
2168 install_dir : sbindir,
2170 build_by_default : opt2)
2171 if opt2 and not is_disabler(exe)
2178 include_directories : includes,
2179 link_with : [lib_common,
2183 dependencies : [lib_readline],
2184 install_dir : sbindir,
2186 build_by_default : opt)
2187 if opt and not is_disabler(exe)
2189 bashcompletions += ['sfdisk']
2192 opt2 = opt and 'sfdisk' in static_programs
2196 include_directories : includes,
2197 link_with : [lib_common,
2200 lib_smartcols.get_static_lib()],
2201 dependencies : [lib_readline_static],
2202 install_dir : sbindir,
2204 build_by_default : opt2)
2205 if opt2 and not is_disabler(exe)
2212 include_directories : includes,
2213 link_with : [lib_common,
2218 dependencies : [curses_libs],
2219 install_dir : sbindir,
2221 build_by_default : opt)
2222 if opt and not is_disabler(exe)
2224 manadocs += ['disk-utils/fdisk.8.adoc',
2225 'disk-utils/sfdisk.8.adoc',
2226 'disk-utils/cfdisk.8.adoc']
2227 bashcompletions += ['cfdisk']
2230 opt = not get_option('build-partx').disabled()
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],
2244 install_dir : usrsbin_exec_dir,
2246 build_by_default : opt)
2250 include_directories : includes,
2251 link_with : [lib_common],
2252 install_dir : usrsbin_exec_dir,
2254 build_by_default : opt)
2258 include_directories : includes,
2259 link_with : [lib_common,
2262 install_dir : usrsbin_exec_dir,
2264 build_by_default : opt)
2266 exes += [exe, exe2, exe3, exe4]
2267 manadocs += ['disk-utils/addpart.8.adoc',
2268 'disk-utils/delpart.8.adoc',
2269 'disk-utils/resizepart.8.adoc',
2270 'disk-utils/partx.8.adoc']
2271 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2274 ############################################################
2279 include_directories : includes,
2280 link_with : [lib_common],
2281 dependencies : [lib_util,
2285 install_dir : usrbin_exec_dir,
2288 manadocs += ['term-utils/script.1.adoc']
2289 bashcompletions += ['script']
2294 include_directories : includes,
2295 c_args : '-DTEST_SCRIPT',
2296 link_with : [lib_common],
2297 dependencies : [lib_util,
2306 include_directories : includes,
2307 link_with : [lib_common],
2308 dependencies : [lib_util,
2311 install_dir : usrbin_exec_dir,
2314 manadocs += ['term-utils/scriptlive.1.adoc']
2315 bashcompletions += ['scriptlive']
2319 scriptreplay_sources,
2320 include_directories : includes,
2321 link_with : [lib_common],
2322 dependencies : [math_libs],
2323 install_dir : usrbin_exec_dir,
2326 manadocs += ['term-utils/scriptreplay.1.adoc']
2327 bashcompletions += ['scriptreplay']
2329 opt = not get_option('build-agetty').disabled()
2333 include_directories : includes,
2334 link_with : [lib_common, logindefs_c],
2335 dependencies : BSD ? lib_util : [],
2336 install_dir : sbindir,
2338 build_by_default : opt)
2341 manadocs += ['term-utils/agetty.8.adoc']
2344 opt = not get_option('build-setterm').disabled()
2348 include_directories : includes,
2349 link_with : [lib_common],
2350 dependencies : [curses_libs],
2351 install_dir : usrbin_exec_dir,
2353 build_by_default : opt)
2356 manadocs += ['term-utils/setterm.1.adoc']
2357 bashcompletions += ['setterm']
2360 opt = not get_option('build-mesg').disabled()
2364 include_directories : includes,
2365 link_with : [lib_common],
2366 install_dir : usrbin_exec_dir,
2368 build_by_default : opt)
2371 manadocs += ['term-utils/mesg.1.adoc']
2372 bashcompletions += ['mesg']
2375 opt = not get_option('build-wall').disabled()
2379 include_directories : includes,
2380 link_with : [lib_common],
2381 install_dir : usrbin_exec_dir,
2383 build_by_default : opt)
2386 manadocs += ['term-utils/wall.1.adoc']
2387 bashcompletions += ['wall']
2390 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2391 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2393 opt = not get_option('build-write').disabled()
2397 include_directories : includes,
2398 link_with : [lib_common],
2399 install_dir : usrbin_exec_dir,
2401 build_by_default : opt)
2404 manadocs += ['term-utils/write.1.adoc']
2407 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2408 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2410 opt = not get_option('build-login').disabled()
2414 include_directories : includes,
2415 link_with : [lib_common, logindefs_c],
2416 dependencies : [lib_pam,
2420 build_by_default : opt)
2421 if not is_disabler(exe)
2423 manadocs += ['login-utils/login.1.adoc']
2426 opt = not get_option('build-sulogin').disabled()
2430 include_directories : includes,
2431 link_with : [lib_common],
2432 dependencies : [lib_crypt,
2434 install_dir : sbindir,
2436 build_by_default : opt)
2437 if not is_disabler(exe)
2439 manadocs += ['login-utils/sulogin.8.adoc']
2445 include_directories : includes,
2446 link_with : [lib_common,
2448 dependencies : [curses_libs],
2449 install_dir : usrbin_exec_dir,
2452 manadocs += ['misc-utils/cal.1.adoc']
2453 bashcompletions += ['cal']
2455 opt = not get_option('build-logger').disabled()
2459 include_directories : includes,
2460 link_with : [lib_common],
2461 dependencies : [lib_systemd],
2462 install_dir : usrbin_exec_dir,
2464 build_by_default : opt)
2465 if opt and not is_disabler(exe)
2467 manadocs += ['misc-utils/logger.1.adoc']
2468 bashcompletions += ['logger']
2474 include_directories : includes,
2475 c_args : '-DTEST_LOGGER',
2476 link_with : [lib_common],
2477 dependencies : [lib_systemd])
2478 if not is_disabler(exe)
2485 include_directories : includes,
2486 install_dir : usrbin_exec_dir,
2489 manadocs += ['misc-utils/look.1.adoc']
2490 bashcompletions += ['look']
2495 include_directories : includes,
2496 link_with : [lib_common],
2497 install_dir : usrbin_exec_dir,
2500 manadocs += ['misc-utils/mcookie.1.adoc']
2501 bashcompletions += ['mcookie']
2506 include_directories : includes,
2507 dependencies : [lib_selinux],
2508 install_dir : usrbin_exec_dir,
2511 manadocs += ['misc-utils/namei.1.adoc']
2512 bashcompletions += ['namei']
2517 include_directories : includes,
2518 link_with : [lib_common],
2519 install_dir : usrbin_exec_dir,
2522 manadocs += ['misc-utils/whereis.1.adoc']
2523 bashcompletions += ['whereis']
2528 include_directories : includes,
2529 link_with : [lib_common,
2532 install_dir : usrbin_exec_dir,
2534 if not is_disabler(exe)
2536 manadocs += ['misc-utils/lslocks.8.adoc']
2537 bashcompletions += ['lslocks']
2543 include_directories : includes,
2544 link_with : [lib_common,
2548 dependencies : lib_udev,
2550 if not is_disabler(exe)
2552 manadocs += ['misc-utils/lsblk.8.adoc']
2553 bashcompletions += ['lsblk']
2559 include_directories : includes,
2560 link_with : [lib_common,
2562 install_dir : usrbin_exec_dir,
2564 if not is_disabler(exe)
2566 manadocs += ['misc-utils/lsfd.1.adoc']
2572 include_directories : includes,
2573 link_with : [lib_uuid],
2574 install_dir : usrbin_exec_dir,
2576 if not is_disabler(exe)
2578 manadocs += ['misc-utils/uuidgen.1.adoc']
2579 bashcompletions += ['uuidgen']
2585 include_directories : includes,
2586 link_with : [lib_common,
2589 install_dir : usrbin_exec_dir,
2591 if not is_disabler(exe)
2593 manadocs += ['misc-utils/uuidparse.1.adoc']
2594 bashcompletions += ['uuidparse']
2601 include_directories : includes,
2602 link_with : [lib_common,
2604 dependencies : [realtime_libs,
2606 install_dir : usrsbin_exec_dir,
2608 build_by_default : opt)
2612 include_directories : includes,
2613 link_with : [lib_common,
2615 dependencies : thread_libs,
2616 build_by_default : opt)
2617 if not is_disabler(exe)
2619 manadocs += ['misc-utils/uuidd.8.adoc']
2620 bashcompletions += ['uuidd']
2623 opt = build_libblkid
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)
2635 manadocs += ['misc-utils/blkid.8.adoc']
2636 bashcompletions += ['blkid']
2639 opt = opt and 'blkid' in static_programs
2643 include_directories : includes,
2644 link_with : [lib_common,
2646 install_dir : sbindir,
2648 build_by_default : opt)
2649 if opt and not is_disabler(exe)
2655 'libblkid/samples/mkfs.c',
2656 include_directories : includes,
2657 link_with : lib_blkid)
2658 if not is_disabler(exe)
2663 'sample-partitions',
2664 'libblkid/samples/partitions.c',
2665 include_directories : includes,
2666 link_with : lib_blkid)
2667 if not is_disabler(exe)
2672 'sample-superblocks',
2673 'libblkid/samples/superblocks.c',
2674 include_directories : includes,
2675 link_with : lib_blkid)
2676 if not is_disabler(exe)
2682 'libblkid/samples/topology.c',
2683 include_directories : includes,
2684 link_with : lib_blkid)
2685 if not is_disabler(exe)
2690 'test_blkid_fuzz_sample',
2691 'libblkid/src/fuzz.c',
2692 include_directories: includes,
2693 link_with: lib_blkid)
2694 if not is_disabler(exe)
2698 ############################################################
2703 include_directories : includes,
2704 link_with : [lib_blkid],
2705 install_dir : sbindir,
2707 if not is_disabler(exe)
2709 manadocs += ['misc-utils/findfs.8.adoc']
2710 bashcompletions += ['findfs']
2716 include_directories : includes,
2717 link_with : [lib_common,
2720 install_dir : sbindir,
2722 if not is_disabler(exe)
2724 manadocs += ['misc-utils/wipefs.8.adoc']
2725 bashcompletions += ['wipefs']
2731 include_directories : includes,
2732 link_with : [lib_common,
2736 dependencies : [lib_udev],
2738 if not is_disabler(exe)
2740 manadocs += ['misc-utils/findmnt.8.adoc']
2741 bashcompletions += ['findmnt']
2747 include_directories : includes,
2748 link_with : [lib_common],
2750 if not is_disabler(exe)
2752 manadocs += ['misc-utils/kill.1.adoc']
2755 opt = not get_option('build-rename').disabled()
2759 include_directories : includes,
2760 install_dir : usrbin_exec_dir,
2762 build_by_default : opt)
2763 if opt and not is_disabler(exe)
2765 manadocs += ['misc-utils/rename.1.adoc']
2766 bashcompletions += ['rename']
2772 include_directories : includes,
2773 link_with : [lib_common],
2774 install_dir : usrbin_exec_dir,
2777 manadocs += ['misc-utils/getopt.1.adoc']
2778 bashcompletions += ['getopt']
2783 include_directories : includes,
2784 link_with : [lib_common,
2786 install_dir : usrbin_exec_dir,
2788 if not is_disabler(exe)
2790 manadocs += ['misc-utils/fincore.1.adoc']
2791 bashcompletions += ['fincore']
2797 include_directories : includes,
2798 link_with : [lib_common],
2799 install_dir : usrbin_exec_dir,
2801 if not is_disabler(exe)
2803 manadocs += ['misc-utils/hardlink.1.adoc']
2804 bashcompletions += ['hardlink']
2807 opt = not get_option('build-pipesz').disabled()
2811 include_directories : includes,
2812 link_with : [lib_common],
2813 install_dir : usrbin_exec_dir,
2815 if opt and not is_disabler(exe)
2817 manadocs += ['misc-utils/pipesz.1.adoc']
2818 bashcompletions += ['pipesz']
2824 include_directories : includes,
2825 c_args : '-DTEST_CAL',
2826 link_with : [lib_common,
2828 dependencies : [curses_libs])
2829 if not is_disabler(exe)
2836 include_directories : includes,
2837 link_with : [lib_common],
2838 install_dir : usrbin_exec_dir,
2840 if not is_disabler(exe)
2842 manadocs += ['misc-utils/fadvise.1.adoc']
2843 bashcompletions += ['fadvise']
2849 include_directories : includes,
2850 link_with : [lib_common],
2851 install_dir : usrbin_exec_dir,
2853 if not is_disabler(exe)
2855 manadocs += ['misc-utils/waitpid.1.adoc']
2856 bashcompletions += ['waitpid']
2861 'misc-utils/enosys.c',
2862 include_directories : includes,
2863 link_with : [lib_common],
2864 install_dir : usrbin_exec_dir,
2866 if not is_disabler(exe)
2868 bashcompletions += ['enosys']
2871 ############################################################
2873 opt = not get_option('build-schedutils').disabled()
2876 'schedutils/chrt.c',
2877 include_directories : includes,
2878 link_with : lib_common,
2879 install_dir : usrbin_exec_dir,
2881 build_by_default : opt)
2885 'schedutils/ionice.c',
2886 include_directories : includes,
2887 link_with : lib_common,
2888 install_dir : usrbin_exec_dir,
2890 build_by_default : opt)
2894 'schedutils/taskset.c',
2895 include_directories : includes,
2896 link_with : lib_common,
2897 install_dir : usrbin_exec_dir,
2899 build_by_default : opt)
2903 'schedutils/uclampset.c',
2904 include_directories : includes,
2905 link_with : lib_common,
2906 install_dir : usrbin_exec_dir,
2908 build_by_default : opt)
2910 if opt and not is_disabler(exe)
2911 exes += [exe, exe2, exe3, exe4]
2912 manadocs += ['schedutils/chrt.1.adoc',
2913 'schedutils/ionice.1.adoc',
2914 'schedutils/taskset.1.adoc',
2915 'schedutils/uclampset.1.adoc']
2916 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2919 ############################################################
2921 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2926 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2927 include_directories : dir_include,
2928 link_with : lib_common)
2934 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2935 include_directories : dir_include,
2936 link_with : lib_common)
2942 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2943 include_directories : dir_include,
2944 link_with : lib_common)
2950 c_args : ['-DTEST_PROGRAM_MANGLE'],
2951 include_directories : dir_include)
2957 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2958 include_directories : dir_include)
2964 'lib/color-names.c',
2965 c_args : ['-DTEST_PROGRAM_COLORS'],
2966 include_directories : dir_include,
2967 link_with : [lib_common, lib_tcolors])
2973 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2974 include_directories : dir_include)
2977 # XXX: HAVE_OPENAT && HAVE_DIRFD
2981 c_args : ['-DTEST_PROGRAM_PROCFS'],
2982 include_directories : dir_include,
2983 link_with : lib_common)
2986 # XXX: HAVE_OPENAT && HAVE_DIRFD
2991 have_cpu_set_t ? 'lib/cpuset.c' : [],
2992 c_args : ['-DTEST_PROGRAM_PATH'],
2993 include_directories : dir_include,
2994 link_with : lib_common)
3002 c_args : ['-DTEST_PROGRAM_PTY'],
3003 include_directories : dir_include,
3004 link_with : [lib_common],
3005 dependencies : [lib_m,
3014 c_args : ['-DTEST_PROGRAM_CPUSET'],
3015 include_directories : dir_include)
3025 have_cpu_set_t ? 'lib/cpuset.c' : [],
3026 c_args : ['-DTEST_PROGRAM_SYSFS'],
3027 include_directories : dir_include)
3033 c_args : ['-DTEST_PROGRAM_PAGER'],
3034 include_directories : dir_include)
3038 'test_linux_version',
3039 'lib/linux_version.c',
3040 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3041 include_directories : dir_include)
3047 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3048 include_directories : dir_include)
3052 'test_canonicalize',
3053 'lib/canonicalize.c',
3054 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3055 include_directories : dir_include)
3062 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3063 include_directories : dir_include)
3069 c_args : ['-DTEST_PROGRAM'],
3070 include_directories : dir_include,
3071 link_with : lib_common)
3077 c_args : ['-DTEST_PROGRAM'],
3078 include_directories : dir_include,
3079 link_with : [lib_common, logindefs_c])
3083 ############################################################
3087 'libuuid/src/test_uuid.c',
3088 include_directories : [dir_include, dir_libuuid],
3089 link_with : lib_uuid,
3090 dependencies : socket_libs)
3091 if not is_disabler(exe)
3095 ############################################################
3097 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3099 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3103 'libfdisk/src/ask.c',
3104 c_args : libfdisk_tests_cflags,
3105 include_directories : lib_fdisk_includes,
3106 link_with : libfdisk_tests_ldadd)
3107 if not is_disabler(exe)
3113 'libfdisk/src/gpt.c',
3114 c_args : libfdisk_tests_cflags,
3115 include_directories : lib_fdisk_includes,
3116 link_with : libfdisk_tests_ldadd)
3117 if not is_disabler(exe)
3123 'libfdisk/src/utils.c',
3124 c_args : libfdisk_tests_cflags,
3125 include_directories : lib_fdisk_includes,
3126 link_with : libfdisk_tests_ldadd)
3127 if not is_disabler(exe)
3132 'test_fdisk_script',
3133 'libfdisk/src/script.c',
3134 c_args : libfdisk_tests_cflags,
3135 include_directories : lib_fdisk_includes,
3136 link_with : libfdisk_tests_ldadd)
3137 if not is_disabler(exe)
3142 'test_fdisk_version',
3143 'libfdisk/src/version.c',
3144 c_args : libfdisk_tests_cflags,
3145 include_directories : lib_fdisk_includes,
3146 link_with : libfdisk_tests_ldadd)
3147 if not is_disabler(exe)
3153 'libfdisk/src/item.c',
3154 c_args : libfdisk_tests_cflags,
3155 include_directories : lib_fdisk_includes,
3156 link_with : libfdisk_tests_ldadd)
3157 if not is_disabler(exe)
3161 sample_fdisk_cflags = ['-Wno-unused']
3162 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3165 'sample-fdisk-mkpart',
3166 'libfdisk/samples/mkpart.c',
3167 c_args : sample_fdisk_cflags,
3168 include_directories : lib_fdisk_includes,
3169 link_with : sample_fdisk_ldadd)
3170 if not is_disabler(exe)
3175 'sample-fdisk-mkpart-fullspec',
3176 'libfdisk/samples/mkpart-fullspec.c',
3177 c_args : sample_fdisk_cflags,
3178 include_directories : lib_fdisk_includes,
3179 link_with : sample_fdisk_ldadd)
3180 if not is_disabler(exe)
3184 ############################################################
3188 'tests/helpers/test_mbsencode.c',
3189 include_directories : includes,
3190 link_with : lib_common)
3195 'tests/helpers/test_byteswap.c',
3196 include_directories : includes)
3201 'tests/helpers/test_md5.c',
3203 include_directories : includes)
3208 'tests/helpers/test_sha1.c',
3210 include_directories : includes)
3215 'tests/helpers/test_pathnames.c',
3216 include_directories : includes)
3221 'tests/helpers/test_strerror.c',
3222 include_directories : includes)
3227 'tests/helpers/test_sysinfo.c',
3228 include_directories : includes)
3233 'tests/helpers/test_sigreceive.c',
3234 include_directories : includes,
3235 link_with : lib_common)
3240 'tests/helpers/test_tiocsti.c',
3241 include_directories : includes)
3245 'test_uuid_namespace',
3246 'tests/helpers/test_uuid_namespace.c',
3250 include_directories : includes)
3256 'tests/helpers/test_mkfds.c',
3257 include_directories : includes)
3262 'tests/helpers/test_enosys.c',
3263 include_directories : includes)
3266 ############################################################
3270 'sample-scols-tree',
3271 'libsmartcols/samples/tree.c',
3272 include_directories : includes,
3273 link_with : [lib_smartcols, lib_common])
3274 if not is_disabler(exe)
3279 'sample-scols-title',
3280 'libsmartcols/samples/title.c',
3281 include_directories : includes,
3282 link_with : [lib_smartcols, lib_common])
3283 if not is_disabler(exe)
3288 'sample-scols-wrap',
3289 'libsmartcols/samples/wrap.c',
3290 include_directories : includes,
3291 link_with : [lib_smartcols, lib_common])
3292 if not is_disabler(exe)
3297 'sample-scols-continuous',
3298 'libsmartcols/samples/continuous.c',
3299 include_directories : includes,
3300 link_with : [lib_smartcols, lib_common])
3301 if not is_disabler(exe)
3306 'sample-scols-maxout',
3307 'libsmartcols/samples/maxout.c',
3308 include_directories : includes,
3309 link_with : [lib_smartcols, lib_common])
3310 if not is_disabler(exe)
3315 'sample-scols-fromfile',
3316 'libsmartcols/samples/fromfile.c',
3317 include_directories : includes,
3318 link_with : [lib_smartcols, lib_common])
3319 if not is_disabler(exe)
3324 'sample-scols-grouping-simple',
3325 'libsmartcols/samples/grouping-simple.c',
3326 include_directories : includes,
3327 link_with : [lib_smartcols, lib_common])
3328 if not is_disabler(exe)
3333 'sample-scols-grouping-overlay',
3334 'libsmartcols/samples/grouping-overlay.c',
3335 include_directories : includes,
3336 link_with : [lib_smartcols, lib_common])
3337 if not is_disabler(exe)
3341 ############################################################
3343 # Let the test runner know whether we're running under asan and export
3344 # some paths. We use a file on disk so that it is possible to run the
3345 # test scripts from commandline without setting any variables.
3346 configure_file(output : 'meson.conf',
3351 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3354 run_sh = find_program('tests/run.sh')
3358 '--srcdir=' + meson.current_source_dir(),
3359 '--builddir=' + meson.current_build_dir(),
3365 manadocs += ['lib/terminal-colors.d.5.adoc']
3366 manadocs += ['libblkid/libblkid.3.adoc']
3370 'libuuid/man/uuid.3.adoc',
3371 'libuuid/man/uuid_clear.3.adoc',
3372 'libuuid/man/uuid_compare.3.adoc',
3373 'libuuid/man/uuid_copy.3.adoc',
3374 'libuuid/man/uuid_generate.3.adoc',
3375 'libuuid/man/uuid_is_null.3.adoc',
3376 'libuuid/man/uuid_parse.3.adoc',
3377 'libuuid/man/uuid_time.3.adoc',
3378 'libuuid/man/uuid_unparse.3.adoc']
3380 'uuid_generate_random.3': 'uuid_generate.3',
3381 'uuid_generate_time.3': 'uuid_generate.3',
3382 'uuid_generate_time_safe.3': 'uuid_generate.3',
3386 asciidoctor = find_program('asciidoctor', required : false)
3387 if asciidoctor.found()
3388 foreach adoc : manadocs
3389 name = adoc.split('/')[-1]
3390 page = name.split('.adoc')[0]
3391 section = page.split('.')[-1]
3392 mandirn = join_paths(mandir, 'man' + section)
3397 command : [ asciidoctor,
3399 '-a', 'VERSION=' + meson.project_version(),
3400 '-a', 'release-version=' + meson.project_version(),
3401 '-a', 'ADJTIME_PATH=/etc/adjtime',
3402 '-a', 'package-docdir=' + docdir,
3403 '--base-dir=' + meson.current_source_dir(),
3404 '--destination-dir=' + meson.current_build_dir(),
3405 '--load-path', '@SOURCE_ROOT@/tools',
3406 '--require', 'asciidoctor-includetracker',
3410 depfile : page + '.deps',
3412 install_dir : mandirn)
3415 foreach link_name, target : manlinks
3416 link_section = link_name.split('.')[-1]
3417 target_section = target.split('.')[-1]
3418 meson.add_install_script(meson_make_manpage_stub,
3419 join_paths('man' + target_section, target),
3420 join_paths(mandir, 'man' + link_section, link_name))
3424 if bash_completion.found()
3425 foreach completion : bashcompletions
3427 join_paths('bash-completion', completion),
3428 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3431 foreach link_name, target : bashcompletionslinks
3432 meson.add_install_script(meson_make_symlink,
3434 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))