1 project('util-linux', 'c',
2 version : run_command('tools/git-version-gen', check: true).stdout(),
3 meson_version: '>=0.57.0',
7 pkgconfig = import('pkgconfig')
9 libblkid_version = '1.1.0'
10 libblkid_date = '01-Jun-2021'
11 libuuid_version = '1.3.0'
12 libmount_version = '1.1.0'
13 libsmartcols_version = '1.1.0'
14 libfdisk_version = '1.1.0'
16 prefixdir = get_option('prefix')
17 if not prefixdir.startswith('/')
18 error('Prefix is not absolute: "@0@"'.format(prefixdir))
20 bindir = join_paths(prefixdir, get_option('bindir'))
21 sbindir = join_paths(prefixdir, get_option('sbindir'))
22 sysconfstaticdir = join_paths(prefixdir, 'lib')
23 docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux')
24 mandir = join_paths(prefixdir, get_option('mandir'))
26 execprefixdir = prefixdir
27 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
28 usrbin_exec_dir = join_paths(execprefixdir, bindir)
29 usrsbin_exec_dir = join_paths(execprefixdir, sbindir)
30 bash_completion = dependency('bash-completion', required : get_option('build-bash-completion'))
32 vendordir = get_option('vendordir')
34 add_project_arguments('-D_GNU_SOURCE', language : 'c')
36 cc = meson.get_compiler('c')
38 conf = configuration_data()
39 conf.set_quoted('PACKAGE', meson.project_name())
40 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
41 package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version())
42 conf.set_quoted('PACKAGE_STRING', package_string)
44 codes = [''' {print $1} ''',
45 ''' {sub("-.*","",$2); print $2} ''',
46 ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} ''']
49 res = run_command('bash', '-c',
50 '''echo '@0@' | awk -F. '@1@' '''.format(
51 meson.project_version(), code), check: true)
52 pc_version += res.stdout().strip()
54 pc_version = '.'.join(pc_version)
56 conf.set_quoted('LIBBLKID_VERSION', libblkid_version)
57 conf.set_quoted('LIBBLKID_DATE', libblkid_date)
59 conf.set('bindir', bindir)
60 conf.set('sbindir', sbindir)
61 conf.set('runstatedir', runstatedir)
62 conf.set('sysconfdir', sysconfdir)
63 conf.set('usrsbin_execdir', usrsbin_exec_dir)
64 conf.set('docdir', docdir)
65 conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir)
66 conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir)
67 conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime')
68 conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :(
70 conf.set_quoted('_PATH_VENDORDIR', vendordir)
71 conf.set('USE_VENDORDIR', vendordir == '' ? false : 1)
73 build_libblkid = not get_option('build-libblkid').disabled()
74 conf.set('HAVE_LIBBLKID', build_libblkid ? 1 : false)
75 summary('libblkid', build_libblkid ? 'enabled' : 'disabled', section : 'components')
77 build_libuuid = not get_option('build-libuuid').disabled()
78 conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false)
79 summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components')
81 have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
82 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
83 conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
85 build_libmount = not get_option('build-libmount').disabled()
86 conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false)
87 conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1)
88 conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false)
89 summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components')
91 build_libsmartcols = not get_option('build-libsmartcols').disabled()
92 conf.set('HAVE_LIBSMARTCOLS', build_libsmartcols ? 1 : false)
93 summary('libsmartcols', build_libsmartcols ? 'enabled' : 'disabled', section : 'components')
95 build_libfdisk = not get_option('build-libfdisk').disabled()
96 conf.set('HAVE_LIBFDISK', build_libfdisk ? 1 : false)
97 summary('libfdisk', build_libfdisk ? 'enabled' : 'disabled', section : 'components')
99 build_uuidd = not get_option('build-uuidd').disabled()
100 conf.set('HAVE_UUIDD', build_uuidd ? 1 : false)
101 summary('uuidd', build_uuidd ? 'enabled' : 'disabled', section : 'components')
103 static_programs = get_option('static-programs')
104 need_static_libs = static_programs.length() > 0 # a rough estimate...
105 summary('static programs', static_programs)
107 LINUX = host_machine.system() in ['linux']
108 BSD = host_machine.system() in ['dragonfly', 'freebsd', 'netbsd', 'openbsd']
110 ############################################################
128 have = cc.compiles(code, name : 'wchar_t support')
129 if not have and get_option('widechar').enabled()
130 error('widechar support requested but unavailable')
132 if get_option('ncurses').enabled() and get_option('widechar').enabled()
133 error('widechar support is incompatible with non-wide ncurses')
135 conf.set('HAVE_WIDECHAR', have ? 1 : false)
176 linux/net_namespace.h
222 lib_m = cc.find_library('m')
224 lib_tinfo = dependency(
226 required : get_option('tinfo'))
228 lib_ncursesw = dependency(
230 required : get_option('ncursesw'))
231 if lib_ncursesw.found()
232 headers += ['ncursesw/ncurses.h',
236 lib_ncurses = disabler()
238 lib_ncurses = dependency(
240 required : get_option('ncurses'))
241 headers += ['ncurses.h',
245 conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
246 conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
247 conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
249 lib_slang = dependency(
251 required : get_option('slang'))
253 headers += ['slang.h',
258 conf.set('HAVE_SLANG', lib_slang.found())
260 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
261 if curses_libs.found()
262 have = cc.has_function('use_default_colors', dependencies : curses_libs)
263 conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false)
264 have = cc.has_function('resizeterm', dependencies : curses_libs)
265 conf.set('HAVE_RESIZETERM', have ? 1 : false)
272 required : get_option('zlib'))
274 lib_readline = dependency(
276 required : get_option('readline'))
277 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
279 lib_readline_static = dependency(
282 required : need_static_libs ? get_option('readline') : disabler())
284 if meson.version().version_compare('>= 0.59.0')
285 lib_intl = dependency(
287 required : get_option('nls'))
288 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
290 if get_option('nls').enabled()
291 error('nls is not supported with meson before 0.59.0')
293 lib_intl = dependency('', required : false)
296 lib_user = dependency(
299 required : get_option('libuser'))
300 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
302 lib_util = cc.find_library(
304 required : get_option('libutil'))
305 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
307 lib_utempter = cc.find_library(
309 required : get_option('libutempter'))
310 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
312 systemd = dependency(
314 required : get_option('systemd'))
316 lib_systemd = dependency(
318 required : get_option('systemd'))
319 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
320 conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false)
322 lib_udev = dependency(
324 required : get_option('systemd'))
325 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
327 lib_crypt = cc.find_library('crypt')
329 lib_pam = cc.find_library('pam', required : get_option('build-login'))
330 if not lib_pam.found()
331 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
333 if not lib_pam.found()
334 lib_pam = cc.find_library('pam', required : get_option('build-su'))
336 if not lib_pam.found()
337 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
340 lib_pam_misc = cc.find_library('pam_misc')
341 lib_pam = [lib_pam, lib_pam_misc]
343 lib_pam_misc = declare_dependency()
346 lib_cryptsetup = dependency(
348 required : get_option('cryptsetup'))
349 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
351 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
352 if meson.version().version_compare('>= 0.62.0')
353 lib_dl = dependency('dl')
355 lib_dl = cc.find_library('dl')
357 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
358 summary('cryptsetup support (dlopen)',
360 section : 'components')
362 summary('cryptsetup support',
363 lib_cryptsetup.found() ? 'enabled' : 'disabled',
364 section : 'components')
367 have = cc.has_function(
368 'crypt_activate_by_signed_key',
369 dependencies : lib_cryptsetup)
370 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
372 lib_cap_ng = dependency(
374 required : get_option('build-setpriv'))
376 lib_selinux = dependency(
379 required : get_option('selinux'))
380 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
382 lib_magic = dependency(
384 required : get_option('magic'))
385 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
387 lib_econf = dependency(
389 required : get_option('econf'))
390 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
392 lib_audit = dependency(
394 required : get_option('audit'))
395 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
397 conf.set('HAVE_SMACK', not get_option('smack').disabled())
399 foreach header : headers
400 have = cc.has_header(header)
401 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
404 header = 'linux/btrfs.h'
405 enable_btrfs = cc.has_header(header,
406 required : get_option('btrfs'))
407 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
408 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
410 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
415 have = cc.has_header(header,
417 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
420 have = cc.has_header('sched.h')
421 conf.set10('HAVE_DECL_CPU_ALLOC', have)
422 # We get -1 if the size cannot be determined
423 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
424 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
426 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
427 conf.set10('HAVE_ENVIRON_DECL', have)
429 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
430 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
432 have = cc.has_function('strsignal')
433 conf.set10('HAVE_STRSIGNAL_DECL', have)
435 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
436 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
438 have = cc.has_type('loff_t', prefix : '#include <sys/types.h>')
439 conf.set('HAVE_LOFF_T', have ? 1 : false)
441 have = cc.compiles('''
442 #define _GNU_SOURCE 1
443 #include <langinfo.h>
446 str = nl_langinfo (ALTMON_1);
447 str = nl_langinfo (ALTMON_2);
448 str = nl_langinfo (ALTMON_3);
449 str = nl_langinfo (ALTMON_4);
450 str = nl_langinfo (ALTMON_5);
451 str = nl_langinfo (ALTMON_6);
452 str = nl_langinfo (ALTMON_7);
453 str = nl_langinfo (ALTMON_8);
454 str = nl_langinfo (ALTMON_9);
455 str = nl_langinfo (ALTMON_10);
456 str = nl_langinfo (ALTMON_11);
457 str = nl_langinfo (ALTMON_12);
461 name : 'langinfo.h defines ALTMON_x constants')
462 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
464 have = cc.compiles('''
465 #define _GNU_SOURCE 1
466 #include <langinfo.h>
469 str = nl_langinfo (_NL_ABALTMON_1);
470 str = nl_langinfo (_NL_ABALTMON_2);
471 str = nl_langinfo (_NL_ABALTMON_3);
472 str = nl_langinfo (_NL_ABALTMON_4);
473 str = nl_langinfo (_NL_ABALTMON_5);
474 str = nl_langinfo (_NL_ABALTMON_6);
475 str = nl_langinfo (_NL_ABALTMON_7);
476 str = nl_langinfo (_NL_ABALTMON_8);
477 str = nl_langinfo (_NL_ABALTMON_9);
478 str = nl_langinfo (_NL_ABALTMON_10);
479 str = nl_langinfo (_NL_ABALTMON_11);
480 str = nl_langinfo (_NL_ABALTMON_12);
484 name : 'langinfo.h defines _NL_ABALTMON_x constants')
485 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
578 have = cc.has_function(func)
579 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
580 # This makes little sense, but is necessary to avoid warnings about
581 # redefined macros from Python.h, which uses this convention.
582 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
585 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
586 conf.set('AGETTY_RELOAD', have ? 1 : false)
588 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
591 have_dirfd = (cc.has_function('dirfd') or
592 cc.has_header_symbol('dirent.h', 'dirfd',
593 prefix : '#include <sys/types.h>'))
594 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
596 have_ddfd = cc.has_member('DIR', 'dd_fd',
598 #include <sys/types.h>
601 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
603 have = cc.has_member('struct tm', 'tm_gmtoff',
608 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
612 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
613 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
615 have = cc.has_member('struct termios', 'c_line',
616 prefix : '#include <termios.h>')
617 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
619 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
620 prefix : '#include <sys/stat.h>')
621 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
623 # replacement for AC_STRUCT_TIMEZONE
624 have = cc.has_member('struct tm', 'tm_zone',
625 prefix : '#include <time.h>')
626 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
628 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
629 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
631 have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY')
632 conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false)
634 have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY')
635 conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false)
640 extern char *tzname[];
643 return tzname ? 0 : 1;
645 '''.format(have ? 1 : 0)
646 have = cc.compiles(code, name : 'using tzname[]')
647 conf.set('HAVE_TZNAME', have ? 1 : false)
650 if not cc.has_function('socket')
651 socket_libs += cc.find_library('socket', required : true)
652 have = cc.has_function('socket',
653 dependencies : socket_libs)
655 error('socket() function not available')
660 have = cc.has_function('clock_gettime')
662 realtime_libs += cc.find_library('rt', required : true)
663 have = cc.has_function('clock_gettime',
664 dependencies : realtime_libs)
666 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
668 thread_libs = dependency('threads')
670 have = cc.has_function('timer_create')
672 realtime_libs = [cc.find_library('rt', required : true)]
673 have = cc.has_function('timer_create',
674 dependencies : realtime_libs)
676 realtime_libs += thread_libs
677 have = cc.has_function('timer_create',
678 dependencies : realtime_libs)
681 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
683 have = cc.has_function('setitimer')
684 conf.set('HAVE_SETITIMER', have ? 1 : false)
687 rtas_libs = cc.find_library('rtas', required : false)
688 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
691 if not cc.has_header_symbol('math.h', 'isnan')
692 lib = cc.find_library('m', required : true)
693 if (cc.has_function('isnan', dependencies : lib) and
694 cc.has_function('__isnan', dependencies : lib))
699 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
700 args : '-D_GNU_SOURCE')
701 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
704 extern char *__progname;
706 return (*__progname != 0);
709 have = cc.compiles(code, name : 'using __progname')
710 conf.set('HAVE___PROGNAME', have ? 1 : false)
712 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
713 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
715 build_plymouth_support = get_option('build-plymouth-support')
716 have_tiocglcktrmios = cc.has_header_symbol(
717 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
718 required : build_plymouth_support.enabled())
719 have_sock_cloexec = cc.has_header_symbol(
720 'sys/socket.h', 'SOCK_CLOEXEC',
721 prefix : '#include <sys/types.h>',
722 required : build_plymouth_support.enabled())
723 have_sock_nonblock = cc.has_header_symbol(
724 'sys/socket.h', 'SOCK_NONBLOCK',
725 prefix : '#include <sys/types.h>',
726 required : build_plymouth_support.enabled())
727 have_so_passcred = cc.has_header_symbol(
728 'sys/socket.h', 'SO_PASSCRED',
729 prefix : '#include <sys/types.h>',
730 required : build_plymouth_support.enabled())
732 build_plymouth_support = (not build_plymouth_support.disabled() and
733 have_tiocglcktrmios and
734 have_sock_cloexec and
735 have_sock_nonblock and
737 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
738 summary('plymouth support',
739 build_plymouth_support ? 'enabled' : 'disabled',
740 section : 'components')
742 # check for valid fallocate() function
743 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
744 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
745 # and program can't be linked.
753 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
754 return ret == 0 ? 0 : 1;
757 have = cc.links(code, name : 'fallocate() function')
758 conf.set('HAVE_FALLOCATE', have ? 1 : false)
766 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
767 return ret == 0 ? 0 : 1;
770 have = cc.links(code, name : 'posix_fallocate() function')
771 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
773 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
774 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
775 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
777 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
778 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
779 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
781 ############################################################
784 fs_search_path = get_option('fs-search-path')
785 fs_search_path_extra = get_option('fs-search-path-extra')
786 if fs_search_path_extra != ''
787 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
789 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
791 systemdsystemunitdir = ''
793 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
796 sysvinit = get_option('sysvinit').enabled()
797 sysvinitrcdir = sysconfdir + '/init.d'
799 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
800 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
802 have = get_option('chsh-only-listed')
803 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
805 have = get_option('use-tty-group')
806 conf.set('USE_TTY_GROUP', have ? 1 : false)
808 build_hwclock = not get_option('build-hwclock').disabled()
809 bison = find_program('bison', required: build_hwclock)
810 bison_gen = generator(
812 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
813 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
817 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
818 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
822 configuration : conf)
824 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
829 '-Waddress-of-packed-member',
830 '-Wdiscarded-qualifiers',
831 '-Wembedded-directive',
834 '-Wimplicit-function-declaration',
835 '-Wmissing-declarations',
836 '-Wmissing-parameter-type',
837 '-Wmissing-prototypes',
839 '-Wno-missing-field-initializers',
840 '-Wold-style-definition',
844 '-Wstrict-prototypes',
847 '-Wunused-but-set-parameter',
848 '-Wunused-but-set-variable',
849 '-Wunused-parameter',
853 foreach compiler_flag : compiler_flags
854 if cc.has_argument(compiler_flag)
855 add_project_arguments(compiler_flag, language : 'c')
863 bashcompletionslinks = {}
869 subdir('libsmartcols')
872 subdir('login-utils')
880 includes = [dir_include,
890 opt = not get_option('build-chfn-chsh').disabled()
895 include_directories : includes,
896 link_with : [lib_common, logindefs_c],
897 dependencies : chfn_chsh_deps,
898 install_dir : usrbin_exec_dir,
899 install_mode : 'rwsr-xr-x',
901 build_by_default : opt)
905 'login-utils/chsh.c',
908 include_directories : includes,
909 link_with : lib_common,
910 dependencies : chfn_chsh_deps,
911 install_dir : usrbin_exec_dir,
912 install_mode : 'rwsr-xr-x',
914 build_by_default : opt)
915 if opt and not is_disabler(exe)
917 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
918 bashcompletions += ['chfn', 'chsh']
923 test_islocal_sources,
924 include_directories : includes,
925 c_args : '-DTEST_PROGRAM')
930 test_consoles_sources,
931 c_args : ['-DTEST_PROGRAM'],
932 include_directories : includes,
933 link_with : lib_common)
936 opt = not get_option('build-last').disabled()
940 include_directories : includes,
941 link_with : [lib_common],
942 install_dir : usrbin_exec_dir,
944 build_by_default : opt)
945 if opt and not is_disabler(exe)
947 meson.add_install_script(meson_make_symlink,
949 join_paths(usrbin_exec_dir, 'lastb'))
950 manadocs += ['login-utils/last.1.adoc']
951 manlinks += {'lastb.1': 'last.1'}
952 bashcompletions += ['last']
953 bashcompletionslinks += {'lastb': 'last'}
956 opt = not get_option('build-nologin').disabled()
959 'login-utils/nologin.c',
960 include_directories : includes,
961 install_dir : sbindir,
962 link_with : [lib_common],
964 build_by_default : opt)
965 if opt and not is_disabler(exe)
967 manadocs += ['login-utils/nologin.8.adoc']
970 opt = not get_option('build-utmpdump').disabled()
973 'login-utils/utmpdump.c',
974 include_directories : includes,
975 link_with : [lib_common],
976 install_dir : usrbin_exec_dir,
978 build_by_default : opt)
979 if opt and not is_disabler(exe)
981 manadocs += ['login-utils/utmpdump.1.adoc']
982 bashcompletions += ['utmpdump']
985 opt = not get_option('build-su').disabled()
989 'login-utils/su-common.c',
990 'login-utils/su-common.h',
994 include_directories : includes,
995 link_with : [lib_common, logindefs_c],
996 dependencies : [lib_pam,
1000 install_mode : 'rwsr-xr-x',
1002 build_by_default : opt)
1003 if opt and not is_disabler(exe)
1005 manadocs += ['login-utils/su.1.adoc']
1006 bashcompletions += ['su']
1009 opt = not get_option('build-newgrp').disabled()
1012 'login-utils/newgrp.c',
1013 include_directories : includes,
1014 dependencies : [lib_crypt],
1015 install_dir : usrbin_exec_dir,
1017 build_by_default : opt)
1018 if opt and not is_disabler(exe)
1020 manadocs += ['login-utils/newgrp.1.adoc']
1021 bashcompletions += ['newgrp']
1024 opt = not get_option('build-lslogins').disabled()
1027 'login-utils/lslogins.c',
1028 include_directories : includes,
1029 link_with : [lib_common,
1032 dependencies : [lib_selinux,
1034 install_dir : usrbin_exec_dir,
1036 build_by_default : opt)
1037 if opt and not is_disabler(exe)
1039 manadocs += ['login-utils/lslogins.1.adoc']
1040 bashcompletions += ['lslogins']
1043 opt = not get_option('build-vipw').disabled()
1046 'login-utils/vipw.c',
1047 'login-utils/setpwnam.h',
1048 include_directories : includes,
1049 link_with : [lib_common],
1050 dependencies : [lib_selinux],
1051 install_dir : usrbin_exec_dir,
1053 build_by_default : opt)
1054 if opt and not is_disabler(exe)
1056 meson.add_install_script(meson_make_symlink,
1058 join_paths(usrbin_exec_dir, 'vigr'))
1059 manadocs += ['login-utils/vipw.8.adoc']
1060 meson.add_install_script(meson_make_symlink,
1062 join_paths(mandir, 'man8/vigr.8'))
1065 opt = not get_option('build-runuser').disabled()
1068 'login-utils/runuser.c',
1069 'login-utils/su-common.c',
1070 'login-utils/su-common.h',
1074 include_directories : includes,
1075 link_with : [lib_common, logindefs_c],
1076 dependencies : [lib_pam,
1080 install_dir : sbindir,
1082 build_by_default : opt)
1083 if opt and not is_disabler(exe)
1085 manadocs += ['login-utils/runuser.1.adoc']
1086 bashcompletionslinks += {'runuser': 'su'}
1089 ############################################################
1094 include_directories : includes,
1095 link_with : lib_common,
1096 install_dir : usrbin_exec_dir,
1099 manadocs += ['text-utils/col.1.adoc']
1100 bashcompletions += ['col']
1105 include_directories : includes,
1106 install_dir : usrbin_exec_dir,
1109 manadocs += ['text-utils/colcrt.1.adoc']
1110 bashcompletions += ['colcrt']
1115 include_directories : includes,
1116 link_with : lib_common,
1117 install_dir : usrbin_exec_dir,
1120 manadocs += ['text-utils/colrm.1.adoc']
1121 bashcompletions += ['colrm']
1126 include_directories : includes,
1127 install_dir : usrbin_exec_dir,
1130 manadocs += ['text-utils/rev.1.adoc']
1131 bashcompletions += ['rev']
1136 include_directories : includes,
1137 link_with : [lib_common,
1139 install_dir : usrbin_exec_dir,
1141 if not is_disabler(exe)
1143 manadocs += ['text-utils/column.1.adoc']
1144 bashcompletions += ['column']
1147 opt = not get_option('build-line').disabled()
1151 include_directories : includes,
1152 install_dir : usrbin_exec_dir,
1154 build_by_default : opt)
1155 if opt and not is_disabler(exe)
1157 manadocs += ['text-utils/line.1.adoc']
1160 opt = not get_option('build-pg').disabled()
1164 link_with : lib_common,
1165 include_directories : includes,
1166 dependencies : [lib_tinfo,
1168 install_dir : usrbin_exec_dir,
1170 build_by_default : opt)
1171 if opt and not is_disabler(exe)
1173 manadocs += ['text-utils/pg.1.adoc']
1174 bashcompletions += ['pg']
1177 opt = not get_option('build-ul').disabled()
1181 include_directories : includes,
1182 dependencies : [lib_tinfo,
1184 install_dir : usrbin_exec_dir,
1186 build_by_default : opt)
1187 if opt and not is_disabler(exe)
1189 manadocs += ['text-utils/ul.1.adoc']
1190 bashcompletions += ['ul']
1193 opt = not get_option('build-more').disabled()
1197 link_with : [lib_common],
1198 include_directories : includes,
1199 dependencies : [lib_tinfo,
1203 build_by_default : opt)
1207 link_with : [lib_common],
1208 include_directories : includes,
1209 c_args : '-DTEST_PROGRAM',
1210 dependencies : [lib_tinfo,
1213 build_by_default : opt)
1215 if opt and not is_disabler(exe)
1217 manadocs += ['text-utils/more.1.adoc']
1218 bashcompletions += ['more']
1224 include_directories : includes,
1225 link_with : [lib_common,
1227 install_dir : usrbin_exec_dir,
1229 if not is_disabler(exe)
1231 manadocs += ['text-utils/hexdump.1.adoc']
1232 bashcompletions += ['hexdump']
1235 opt = not get_option('build-lsmem').disabled()
1239 include_directories : includes,
1240 link_with : [lib_common,
1242 install_dir : usrbin_exec_dir,
1244 build_by_default : opt)
1245 if opt and not is_disabler(exe)
1247 manadocs += ['sys-utils/lsmem.1.adoc']
1248 bashcompletions += ['lsmem']
1251 opt = not get_option('build-chmem').disabled()
1255 include_directories : includes,
1256 link_with : [lib_common],
1257 install_dir : usrbin_exec_dir,
1259 build_by_default : opt)
1260 if opt and not is_disabler(exe)
1262 manadocs += ['sys-utils/chmem.8.adoc']
1263 bashcompletions += ['chmem']
1269 include_directories : includes,
1270 link_with : [lib_common],
1271 install_dir : usrbin_exec_dir,
1274 manadocs += ['sys-utils/choom.1.adoc']
1279 include_directories : includes,
1280 link_with : [lib_common],
1281 install_dir : usrbin_exec_dir,
1284 manadocs += ['sys-utils/ipcmk.1.adoc']
1285 bashcompletions += ['ipcmk']
1290 include_directories : includes,
1291 link_with : [lib_common],
1292 install_dir : usrbin_exec_dir,
1295 manadocs += ['sys-utils/ipcrm.1.adoc']
1296 bashcompletions += ['ipcrm']
1298 opt = not get_option('build-ipcs').disabled()
1302 include_directories : includes,
1303 link_with : [lib_common],
1304 install_dir : usrbin_exec_dir,
1306 build_by_default : opt)
1307 if opt and not is_disabler(exe)
1309 manadocs += ['sys-utils/ipcs.1.adoc']
1310 bashcompletions += ['ipcs']
1313 opt = not get_option('build-rfkill').disabled()
1317 include_directories : includes,
1318 link_with : [lib_common,
1320 install_dir : usrsbin_exec_dir,
1322 build_by_default : opt)
1323 if opt and not is_disabler(exe)
1325 manadocs += ['sys-utils/rfkill.8.adoc']
1326 bashcompletions += ['rfkill']
1332 include_directories : includes,
1333 link_with : [lib_common,
1335 install_dir : usrbin_exec_dir,
1337 if not is_disabler(exe)
1339 manadocs += ['sys-utils/renice.1.adoc']
1340 bashcompletions += ['renice']
1346 include_directories : includes,
1347 link_with : [lib_common,
1349 install_dir : usrbin_exec_dir,
1351 if opt and not is_disabler(exe)
1353 manadocs += ['sys-utils/setsid.1.adoc']
1354 bashcompletions += ['setsid']
1359 readprofile_sources,
1360 include_directories : includes,
1361 link_with : [lib_common,
1363 install_dir : usrsbin_exec_dir,
1365 if not is_disabler(exe)
1367 manadocs += ['sys-utils/readprofile.8.adoc']
1368 bashcompletions += ['readprofile']
1371 opt = not get_option('build-tunelp').disabled()
1375 include_directories : includes,
1376 link_with : [lib_common],
1377 install_dir : usrsbin_exec_dir,
1379 build_by_default : opt)
1380 if opt and not is_disabler(exe)
1382 manadocs += ['sys-utils/tunelp.8.adoc']
1383 bashcompletions += ['tunelp']
1389 include_directories : includes,
1390 link_with : [lib_common,
1392 install_dir : sbindir,
1394 if not is_disabler(exe)
1396 manadocs += ['sys-utils/fstrim.8.adoc']
1397 bashcompletions += ['fstrim']
1403 include_directories : includes,
1404 link_with : [lib_common,
1407 if not is_disabler(exe)
1409 manadocs += ['sys-utils/dmesg.1.adoc']
1410 bashcompletions += ['dmesg']
1416 include_directories : dir_include,
1417 c_args : '-DTEST_DMESG',
1418 link_with : [lib_common,
1420 if not is_disabler(exe)
1427 include_directories : includes,
1428 link_with : [lib_common],
1429 install_dir : sbindir,
1432 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1433 bashcompletions += ['ctrlaltdel']
1438 include_directories : includes,
1439 install_dir : sbindir,
1442 manadocs += ['sys-utils/fsfreeze.8.adoc']
1443 bashcompletions += ['fsfreeze']
1448 include_directories : includes,
1449 link_with : [lib_common,
1451 install_dir : sbindir,
1454 manadocs += ['sys-utils/blkdiscard.8.adoc']
1455 bashcompletions += ['blkdiscard']
1460 include_directories : includes,
1461 link_with : [lib_common],
1462 install_dir : sbindir,
1465 manadocs += ['sys-utils/blkzone.8.adoc']
1466 bashcompletions += ['blkzone']
1471 include_directories : includes,
1472 link_with : [lib_common],
1473 install_dir : sbindir,
1476 manadocs += ['sys-utils/blkpr.8.adoc']
1481 include_directories : includes,
1482 link_with : [lib_common],
1483 install_dir : usrsbin_exec_dir,
1486 manadocs += ['sys-utils/ldattach.8.adoc']
1487 bashcompletions += ['ldattach']
1492 include_directories : includes,
1493 link_with : [lib_common],
1494 install_dir : usrsbin_exec_dir,
1497 manadocs += ['sys-utils/rtcwake.8.adoc']
1498 bashcompletions += ['rtcwake']
1503 include_directories : includes,
1504 link_with : [lib_common],
1505 install_dir : usrbin_exec_dir,
1508 manadocs += ['sys-utils/setarch.8.adoc']
1509 bashcompletions += ['setarch']
1511 setarch_links = ['uname26', 'linux32', 'linux64']
1512 setarch_links_arch = {
1513 's390x' : ['s390', 's390x'],
1515 'x86_64' : ['i386', 'x86_64'],
1516 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1517 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1518 'mips64' : ['mips', 'mips64', 'mips32'],
1519 'ia64' : ['i386', 'ia64'],
1520 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1522 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1524 foreach link: setarch_links
1525 meson.add_install_script(meson_make_symlink,
1527 join_paths(usrbin_exec_dir, link))
1528 manlinks += {link + '.8': 'setarch.8'}
1531 opt = not get_option('build-eject').disabled()
1535 include_directories : includes,
1536 link_with : [lib_common,
1538 install_dir : usrbin_exec_dir,
1540 build_by_default : opt)
1541 if opt and not is_disabler(exe)
1543 manadocs += ['sys-utils/eject.1.adoc']
1544 bashcompletions += ['eject']
1547 opt = not get_option('build-losetup').disabled()
1551 include_directories : includes,
1552 link_with : [lib_common,
1554 install_dir : sbindir,
1556 build_by_default : opt)
1557 if opt and not is_disabler(exe)
1558 manadocs += ['sys-utils/losetup.8.adoc']
1560 bashcompletions += ['losetup']
1563 opt = opt and 'losetup' in static_programs
1567 include_directories : includes,
1568 link_args : ['--static'],
1569 link_with : [lib_common,
1570 lib_smartcols.get_static_lib()],
1571 install_dir : sbindir,
1573 build_by_default : opt)
1574 if opt and not is_disabler(exe)
1578 opt = not get_option('build-zramctl').disabled()
1582 include_directories : includes,
1583 link_with : [lib_common,
1585 install_dir : sbindir,
1587 build_by_default : opt)
1588 if opt and not is_disabler(exe)
1590 manadocs += ['sys-utils/zramctl.8.adoc']
1591 bashcompletions += ['zramctl']
1597 include_directories : includes,
1598 link_with : [lib_common,
1600 install_dir : usrbin_exec_dir,
1602 if not is_disabler(exe)
1604 manadocs += ['sys-utils/prlimit.1.adoc']
1605 bashcompletions += ['prlimit']
1611 include_directories : includes,
1612 link_with : [lib_common,
1615 install_dir : usrbin_exec_dir,
1617 if not is_disabler(exe)
1619 manadocs += ['sys-utils/lsns.8.adoc']
1620 bashcompletions += ['lsns']
1623 opt = not get_option('build-mount').disabled()
1627 include_directories : includes,
1628 link_with : [lib_common,
1631 dependencies : lib_selinux,
1633 build_by_default : opt)
1637 include_directories : includes,
1638 link_with : [lib_common,
1641 build_by_default : opt)
1642 if opt and not is_disabler(exe)
1644 manadocs += ['sys-utils/fstab.5.adoc',
1645 'sys-utils/mount.8.adoc',
1646 'sys-utils/umount.8.adoc']
1647 bashcompletions += ['mount', 'umount']
1650 opt2 = opt and 'mount' in static_programs
1654 include_directories : includes,
1655 link_args : ['--static'],
1656 link_with : [lib_common,
1657 lib_smartcols_static,
1660 build_by_default : opt2)
1661 if opt2 and not is_disabler(exe)
1665 opt2 = opt and 'umount' in static_programs
1669 include_directories : includes,
1670 link_args : ['--static'],
1671 link_with : [lib_common,
1674 build_by_default : opt2)
1675 if opt2 and not is_disabler(exe)
1684 include_directories : includes,
1685 link_with : [lib_common,
1689 install_dir : sbindir,
1691 if not is_disabler(exe)
1693 manadocs += ['sys-utils/swapon.8.adoc']
1694 bashcompletions += ['swapon']
1700 include_directories : includes,
1701 link_with : [lib_common,
1704 install_dir : sbindir,
1706 if not is_disabler(exe)
1708 manlinks += {'swapoff.8': 'swapon.8'}
1709 bashcompletions += ['swapoff']
1715 include_directories : includes,
1716 link_with : [lib_common,
1718 dependencies : [rtas_libs],
1719 install_dir : usrbin_exec_dir,
1721 if not is_disabler(exe)
1723 manadocs += ['sys-utils/lscpu.1.adoc']
1724 bashcompletions += ['lscpu']
1730 include_directories : includes,
1731 link_with : [lib_common],
1732 install_dir : sbindir,
1735 manadocs += ['sys-utils/chcpu.8.adoc']
1736 bashcompletions += ['chcpu']
1741 include_directories : includes,
1742 link_with : [lib_common,
1745 if not is_disabler(exe)
1747 manadocs += ['sys-utils/wdctl.8.adoc']
1748 bashcompletions += ['wdctl']
1751 opt = not get_option('build-mountpoint').disabled()
1755 include_directories : includes,
1756 link_with : [lib_mount],
1758 build_by_default : opt)
1759 if opt and not is_disabler(exe)
1761 manadocs += ['sys-utils/mountpoint.1.adoc']
1762 bashcompletions += ['mountpoint']
1765 opt = not get_option('build-fallocate').disabled()
1769 include_directories : includes,
1770 link_with : [lib_common],
1771 install_dir : usrbin_exec_dir,
1773 build_by_default : opt)
1774 if opt and not is_disabler(exe)
1776 manadocs += ['sys-utils/fallocate.1.adoc']
1777 bashcompletions += ['fallocate']
1780 opt = not get_option('build-pivot_root').disabled()
1784 include_directories : includes,
1785 install_dir : sbindir,
1787 build_by_default : opt)
1788 if opt and not is_disabler(exe)
1790 manadocs += ['sys-utils/pivot_root.8.adoc']
1791 bashcompletions += ['pivot_root']
1794 opt = not get_option('build-switch_root').disabled()
1795 if opt and not have_dirfd and not have_ddfd
1796 error('neither dirfd nor ddfd are available')
1800 switch_root_sources,
1801 include_directories : includes,
1802 install_dir : sbindir,
1804 build_by_default : opt)
1805 if opt and not is_disabler(exe)
1807 manadocs += ['sys-utils/switch_root.8.adoc']
1810 opt = not get_option('build-unshare').disabled()
1814 include_directories : includes,
1815 link_with : [lib_common],
1816 install_dir : usrbin_exec_dir,
1818 build_by_default : opt)
1819 if opt and not is_disabler(exe)
1821 manadocs += ['sys-utils/unshare.1.adoc']
1822 bashcompletions += ['unshare']
1825 opt = opt and 'unshare' in static_programs
1829 include_directories : includes,
1830 link_with : [lib_common],
1831 install_dir : usrbin_exec_dir,
1833 build_by_default : opt)
1834 if opt and not is_disabler(exe)
1838 opt = not get_option('build-nsenter').disabled()
1842 include_directories : includes,
1843 link_with : [lib_common],
1844 dependencies : [lib_selinux],
1845 install_dir : usrbin_exec_dir,
1847 build_by_default : opt)
1848 if opt and not is_disabler(exe)
1850 manadocs += ['sys-utils/nsenter.1.adoc']
1851 bashcompletions += ['nsenter']
1854 opt = opt and 'nsenter' in static_programs
1858 include_directories : includes,
1859 link_with : [lib_common],
1860 dependencies : [lib_selinux],
1861 install_dir : usrbin_exec_dir,
1863 build_by_default : opt)
1864 if opt and not is_disabler(exe)
1868 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1872 include_directories : includes,
1873 link_with : [lib_common],
1874 dependencies : [lib_cap_ng],
1875 install_dir : usrbin_exec_dir,
1877 build_by_default : opt)
1878 if opt and not is_disabler(exe)
1880 manadocs += ['sys-utils/setpriv.1.adoc']
1881 bashcompletions += ['setpriv']
1887 include_directories : includes,
1888 link_with : [lib_common],
1889 dependencies : realtime_libs,
1890 install_dir : usrbin_exec_dir,
1893 manadocs += ['sys-utils/flock.1.adoc']
1894 bashcompletions += ['flock']
1896 opt = not get_option('build-lsirq').disabled()
1900 include_directories : includes,
1901 link_with : [lib_common,
1903 install_dir : usrbin_exec_dir,
1905 build_by_default : opt)
1906 if opt and not is_disabler(exe)
1908 manadocs += ['sys-utils/lsirq.1.adoc']
1909 bashcompletions += ['lsirq']
1912 opt = not get_option('build-irqtop').disabled()
1916 include_directories : includes,
1917 dependencies : [realtime_libs, curses_libs],
1918 link_with : [lib_common,
1921 install_dir : usrbin_exec_dir,
1923 build_by_default : opt)
1924 if opt and not is_disabler(exe)
1926 manadocs += ['sys-utils/irqtop.1.adoc']
1927 bashcompletions += ['irqtop']
1930 opt = not get_option('build-ipcs').disabled()
1934 include_directories : includes,
1935 link_with : [lib_common,
1937 install_dir : usrbin_exec_dir,
1939 build_by_default : opt)
1940 if opt and not is_disabler(exe)
1942 manadocs += ['sys-utils/lsipc.1.adoc']
1943 bashcompletions += ['lsipc']
1950 include_directories : includes,
1951 link_with : [lib_common],
1952 dependencies : [lib_m,
1954 install_dir : sbindir,
1956 build_by_default : opt)
1957 if opt and not is_disabler(exe)
1959 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1960 bashcompletions += ['hwclock']
1966 include_directories : includes,
1967 install_dir : sbindir,
1970 manadocs += ['disk-utils/mkfs.8.adoc']
1971 bashcompletions += ['mkfs']
1973 opt = not get_option('build-bfs').disabled()
1977 include_directories : includes,
1978 link_with : [lib_common],
1979 install_dir : sbindir,
1981 build_by_default : opt)
1982 if opt and not is_disabler(exe)
1984 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1985 bashcompletions += ['mkfs.bfs']
1991 include_directories : includes,
1992 link_with : [lib_common],
1993 install_dir : usrbin_exec_dir,
1996 manadocs += ['disk-utils/isosize.8.adoc']
1997 bashcompletions += ['isosize']
2002 include_directories : includes,
2003 link_with : [lib_common,
2006 dependencies: [lib_selinux],
2007 install_dir : sbindir,
2009 if opt and not is_disabler(exe)
2011 manadocs += ['disk-utils/mkswap.8.adoc']
2012 bashcompletions += ['mkswap']
2018 include_directories : includes,
2019 link_with : [lib_common,
2022 install_dir : sbindir,
2024 if opt and not is_disabler(exe)
2026 manadocs += ['disk-utils/swaplabel.8.adoc']
2027 bashcompletions += ['swaplabel']
2030 opt = not get_option('build-fsck').disabled()
2034 include_directories : includes,
2035 link_with : [lib_common,
2038 dependencies : realtime_libs,
2039 install_dir : sbindir,
2041 build_by_default : opt)
2042 if opt and not is_disabler(exe)
2044 manadocs += ['disk-utils/fsck.8.adoc']
2045 bashcompletions += ['fsck']
2048 opt = not get_option('build-minix').disabled()
2052 include_directories : includes,
2053 link_with : [lib_common],
2054 install_dir : sbindir,
2056 build_by_default : opt)
2060 include_directories : includes,
2061 c_args : '-DTEST_SCRIPT',
2062 link_with : [lib_common],
2063 build_by_default : opt)
2067 include_directories : includes,
2068 link_with : [lib_common],
2069 install_dir : sbindir,
2071 build_by_default : opt)
2072 if opt and not is_disabler(exe)
2073 exes += [exe, exe2, exe3]
2074 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2075 bashcompletions += ['mkfs.minix', 'fsck.minix']
2078 opt = not get_option('build-cramfs').disabled()
2081 mkfs_cramfs_sources,
2082 include_directories : includes,
2083 link_with : [lib_common],
2084 dependencies : [lib_z],
2085 install_dir : sbindir,
2087 build_by_default : opt)
2090 fsck_cramfs_sources,
2091 include_directories : includes,
2092 link_with : [lib_common],
2093 dependencies : [lib_z],
2094 install_dir : sbindir,
2096 build_by_default : opt)
2097 if not is_disabler(exe)
2099 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2100 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2103 opt = not get_option('build-raw').disabled()
2105 cc.has_header('linux/raw.h', required: opt)
2110 include_directories : includes,
2111 install_dir : sbindir,
2113 build_by_default : opt)
2114 if opt and not is_disabler(exe)
2116 manadocs += ['disk-utils/raw.8.adoc']
2117 bashcompletions += ['raw']
2120 opt = not get_option('build-fdformat').disabled()
2124 include_directories : includes,
2125 link_with : [lib_common],
2126 install_dir : usrsbin_exec_dir,
2128 build_by_default : opt)
2129 if opt and not is_disabler(exe)
2131 manadocs += ['disk-utils/fdformat.8.adoc']
2137 include_directories : includes,
2138 link_with : [lib_common],
2139 install_dir : sbindir,
2141 manadocs += ['disk-utils/blockdev.8.adoc']
2142 bashcompletions += ['blockdev']
2144 opt = not get_option('build-fdisks').disabled()
2145 if opt and not have_dirfd and not have_ddfd
2146 error('neither dirfd nor ddfd are available')
2151 include_directories : includes,
2152 link_with : [lib_common,
2156 dependencies : [lib_readline],
2157 install_dir : sbindir,
2159 build_by_default : opt)
2160 if opt and not is_disabler(exe)
2162 bashcompletions += ['fdisk']
2165 opt2 = opt and 'fdisk' in static_programs
2169 link_args : ['--static'],
2170 include_directories : includes,
2171 link_with : [lib_common,
2174 lib_smartcols.get_static_lib()],
2175 dependencies : [lib_readline_static],
2176 install_dir : sbindir,
2178 build_by_default : opt2)
2179 if opt2 and not is_disabler(exe)
2186 include_directories : includes,
2187 link_with : [lib_common,
2191 dependencies : [lib_readline],
2192 install_dir : sbindir,
2194 build_by_default : opt)
2195 if opt and not is_disabler(exe)
2197 bashcompletions += ['sfdisk']
2200 opt2 = opt and 'sfdisk' in static_programs
2204 include_directories : includes,
2205 link_with : [lib_common,
2208 lib_smartcols.get_static_lib()],
2209 dependencies : [lib_readline_static],
2210 install_dir : sbindir,
2212 build_by_default : opt2)
2213 if opt2 and not is_disabler(exe)
2220 include_directories : includes,
2221 link_with : [lib_common,
2226 dependencies : [curses_libs],
2227 install_dir : sbindir,
2229 build_by_default : opt)
2230 if opt and not is_disabler(exe)
2232 manadocs += ['disk-utils/fdisk.8.adoc',
2233 'disk-utils/sfdisk.8.adoc',
2234 'disk-utils/cfdisk.8.adoc']
2235 bashcompletions += ['cfdisk']
2238 opt = not get_option('build-partx').disabled()
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],
2260 install_dir : usrsbin_exec_dir,
2262 build_by_default : opt)
2266 include_directories : includes,
2267 link_with : [lib_common,
2270 install_dir : usrsbin_exec_dir,
2272 build_by_default : opt)
2274 exes += [exe, exe2, exe3, exe4]
2275 manadocs += ['disk-utils/addpart.8.adoc',
2276 'disk-utils/delpart.8.adoc',
2277 'disk-utils/resizepart.8.adoc',
2278 'disk-utils/partx.8.adoc']
2279 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2282 ############################################################
2287 include_directories : includes,
2288 link_with : [lib_common],
2289 dependencies : [lib_util,
2293 install_dir : usrbin_exec_dir,
2296 manadocs += ['term-utils/script.1.adoc']
2297 bashcompletions += ['script']
2302 include_directories : includes,
2303 c_args : '-DTEST_SCRIPT',
2304 link_with : [lib_common],
2305 dependencies : [lib_util,
2314 include_directories : includes,
2315 link_with : [lib_common],
2316 dependencies : [lib_util,
2319 install_dir : usrbin_exec_dir,
2322 manadocs += ['term-utils/scriptlive.1.adoc']
2323 bashcompletions += ['scriptlive']
2327 scriptreplay_sources,
2328 include_directories : includes,
2329 link_with : [lib_common],
2330 dependencies : [math_libs],
2331 install_dir : usrbin_exec_dir,
2334 manadocs += ['term-utils/scriptreplay.1.adoc']
2335 bashcompletions += ['scriptreplay']
2337 opt = not get_option('build-agetty').disabled()
2341 include_directories : includes,
2342 link_with : [lib_common, logindefs_c],
2343 dependencies : BSD ? lib_util : [],
2344 install_dir : sbindir,
2346 build_by_default : opt)
2349 manadocs += ['term-utils/agetty.8.adoc']
2352 opt = not get_option('build-setterm').disabled()
2356 include_directories : includes,
2357 link_with : [lib_common],
2358 dependencies : [curses_libs],
2359 install_dir : usrbin_exec_dir,
2361 build_by_default : opt)
2364 manadocs += ['term-utils/setterm.1.adoc']
2365 bashcompletions += ['setterm']
2368 opt = not get_option('build-mesg').disabled()
2372 include_directories : includes,
2373 link_with : [lib_common],
2374 install_dir : usrbin_exec_dir,
2376 build_by_default : opt)
2379 manadocs += ['term-utils/mesg.1.adoc']
2380 bashcompletions += ['mesg']
2383 opt = not get_option('build-wall').disabled()
2387 include_directories : includes,
2388 link_with : [lib_common],
2389 install_dir : usrbin_exec_dir,
2391 build_by_default : opt)
2394 manadocs += ['term-utils/wall.1.adoc']
2395 bashcompletions += ['wall']
2398 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2399 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2401 opt = not get_option('build-write').disabled()
2405 include_directories : includes,
2406 link_with : [lib_common],
2407 install_dir : usrbin_exec_dir,
2409 build_by_default : opt)
2412 manadocs += ['term-utils/write.1.adoc']
2413 bashcompletions += ['write']
2416 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2417 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2419 opt = not get_option('build-login').disabled()
2423 include_directories : includes,
2424 link_with : [lib_common, logindefs_c],
2425 dependencies : [lib_pam,
2429 build_by_default : opt)
2430 if not is_disabler(exe)
2432 manadocs += ['login-utils/login.1.adoc']
2435 opt = not get_option('build-sulogin').disabled()
2439 include_directories : includes,
2440 link_with : [lib_common],
2441 dependencies : [lib_crypt,
2443 install_dir : sbindir,
2445 build_by_default : opt)
2446 if not is_disabler(exe)
2448 manadocs += ['login-utils/sulogin.8.adoc']
2454 include_directories : includes,
2455 link_with : [lib_common,
2457 dependencies : [curses_libs],
2458 install_dir : usrbin_exec_dir,
2461 manadocs += ['misc-utils/cal.1.adoc']
2462 bashcompletions += ['cal']
2464 opt = not get_option('build-logger').disabled()
2468 include_directories : includes,
2469 link_with : [lib_common],
2470 dependencies : [lib_systemd],
2471 install_dir : usrbin_exec_dir,
2473 build_by_default : opt)
2474 if opt and not is_disabler(exe)
2476 manadocs += ['misc-utils/logger.1.adoc']
2477 bashcompletions += ['logger']
2483 include_directories : includes,
2484 c_args : '-DTEST_LOGGER',
2485 link_with : [lib_common],
2486 dependencies : [lib_systemd])
2487 if not is_disabler(exe)
2494 include_directories : includes,
2495 install_dir : usrbin_exec_dir,
2498 manadocs += ['misc-utils/look.1.adoc']
2499 bashcompletions += ['look']
2504 include_directories : includes,
2505 link_with : [lib_common],
2506 install_dir : usrbin_exec_dir,
2509 manadocs += ['misc-utils/mcookie.1.adoc']
2510 bashcompletions += ['mcookie']
2515 include_directories : includes,
2516 dependencies : [lib_selinux],
2517 install_dir : usrbin_exec_dir,
2520 manadocs += ['misc-utils/namei.1.adoc']
2521 bashcompletions += ['namei']
2526 include_directories : includes,
2527 link_with : [lib_common],
2528 install_dir : usrbin_exec_dir,
2531 manadocs += ['misc-utils/whereis.1.adoc']
2532 bashcompletions += ['whereis']
2537 include_directories : includes,
2538 link_with : [lib_common,
2541 install_dir : usrbin_exec_dir,
2543 if not is_disabler(exe)
2545 manadocs += ['misc-utils/lslocks.8.adoc']
2546 bashcompletions += ['lslocks']
2552 include_directories : includes,
2553 link_with : [lib_common,
2557 dependencies : lib_udev,
2559 if not is_disabler(exe)
2561 manadocs += ['misc-utils/lsblk.8.adoc']
2562 bashcompletions += ['lsblk']
2568 include_directories : includes,
2569 link_with : [lib_common,
2571 install_dir : usrbin_exec_dir,
2573 if not is_disabler(exe)
2575 manadocs += ['misc-utils/lsfd.1.adoc']
2581 include_directories : includes,
2582 link_with : [lib_uuid],
2583 install_dir : usrbin_exec_dir,
2585 if not is_disabler(exe)
2587 manadocs += ['misc-utils/uuidgen.1.adoc']
2588 bashcompletions += ['uuidgen']
2594 include_directories : includes,
2595 link_with : [lib_common,
2598 install_dir : usrbin_exec_dir,
2600 if not is_disabler(exe)
2602 manadocs += ['misc-utils/uuidparse.1.adoc']
2603 bashcompletions += ['uuidparse']
2610 include_directories : includes,
2611 link_with : [lib_common,
2613 dependencies : [realtime_libs,
2615 install_dir : usrsbin_exec_dir,
2617 build_by_default : opt)
2621 include_directories : includes,
2622 link_with : [lib_common,
2624 dependencies : thread_libs,
2625 build_by_default : opt)
2626 if not is_disabler(exe)
2628 manadocs += ['misc-utils/uuidd.8.adoc']
2629 bashcompletions += ['uuidd']
2632 opt = build_libblkid
2636 include_directories : includes,
2637 link_with : [lib_common,
2639 install_dir : sbindir,
2641 build_by_default : opt)
2642 if opt and not is_disabler(exe)
2644 manadocs += ['misc-utils/blkid.8.adoc']
2645 bashcompletions += ['blkid']
2648 opt = opt and 'blkid' in static_programs
2652 include_directories : includes,
2653 link_with : [lib_common,
2655 install_dir : sbindir,
2657 build_by_default : opt)
2658 if opt and not is_disabler(exe)
2664 'libblkid/samples/mkfs.c',
2665 include_directories : includes,
2666 link_with : lib_blkid)
2667 if not is_disabler(exe)
2672 'sample-partitions',
2673 'libblkid/samples/partitions.c',
2674 include_directories : includes,
2675 link_with : lib_blkid)
2676 if not is_disabler(exe)
2681 'sample-superblocks',
2682 'libblkid/samples/superblocks.c',
2683 include_directories : includes,
2684 link_with : lib_blkid)
2685 if not is_disabler(exe)
2691 'libblkid/samples/topology.c',
2692 include_directories : includes,
2693 link_with : lib_blkid)
2694 if not is_disabler(exe)
2699 'test_blkid_fuzz_sample',
2700 'libblkid/src/fuzz.c',
2701 include_directories: includes,
2702 link_with: lib_blkid)
2703 if not is_disabler(exe)
2707 ############################################################
2712 include_directories : includes,
2713 link_with : [lib_blkid],
2714 install_dir : sbindir,
2716 if not is_disabler(exe)
2718 manadocs += ['misc-utils/findfs.8.adoc']
2719 bashcompletions += ['findfs']
2725 include_directories : includes,
2726 link_with : [lib_common,
2729 install_dir : sbindir,
2731 if not is_disabler(exe)
2733 manadocs += ['misc-utils/wipefs.8.adoc']
2734 bashcompletions += ['wipefs']
2740 include_directories : includes,
2741 link_with : [lib_common,
2745 dependencies : [lib_udev],
2747 if not is_disabler(exe)
2749 manadocs += ['misc-utils/findmnt.8.adoc']
2750 bashcompletions += ['findmnt']
2756 include_directories : includes,
2757 link_with : [lib_common],
2759 if not is_disabler(exe)
2761 manadocs += ['misc-utils/kill.1.adoc']
2764 opt = not get_option('build-rename').disabled()
2768 include_directories : includes,
2769 install_dir : usrbin_exec_dir,
2771 build_by_default : opt)
2772 if opt and not is_disabler(exe)
2774 manadocs += ['misc-utils/rename.1.adoc']
2775 bashcompletions += ['rename']
2781 include_directories : includes,
2782 link_with : [lib_common],
2783 install_dir : usrbin_exec_dir,
2786 manadocs += ['misc-utils/getopt.1.adoc']
2787 bashcompletions += ['getopt']
2792 include_directories : includes,
2793 link_with : [lib_common,
2795 install_dir : usrbin_exec_dir,
2797 if not is_disabler(exe)
2799 manadocs += ['misc-utils/fincore.1.adoc']
2800 bashcompletions += ['fincore']
2806 include_directories : includes,
2807 link_with : [lib_common],
2808 install_dir : usrbin_exec_dir,
2810 if not is_disabler(exe)
2812 manadocs += ['misc-utils/hardlink.1.adoc']
2813 bashcompletions += ['hardlink']
2816 opt = not get_option('build-pipesz').disabled()
2820 include_directories : includes,
2821 link_with : [lib_common],
2822 install_dir : usrbin_exec_dir,
2824 if opt and not is_disabler(exe)
2826 manadocs += ['misc-utils/pipesz.1.adoc']
2827 bashcompletions += ['pipesz']
2833 include_directories : includes,
2834 c_args : '-DTEST_CAL',
2835 link_with : [lib_common,
2837 dependencies : [curses_libs])
2838 if not is_disabler(exe)
2845 include_directories : includes,
2846 link_with : [lib_common],
2847 install_dir : usrbin_exec_dir,
2849 if not is_disabler(exe)
2851 manadocs += ['misc-utils/fadvise.1.adoc']
2852 bashcompletions += ['fadvise']
2855 # XXX: HAVE_PIDFD_OPEN
2859 include_directories : includes,
2860 link_with : [lib_common],
2861 install_dir : usrbin_exec_dir,
2863 if not is_disabler(exe)
2865 manadocs += ['misc-utils/waitpid.1.adoc']
2866 bashcompletions += ['waitpid']
2869 syscalls_h = custom_target('syscalls.h',
2870 input : 'tools/all_syscalls',
2871 output : 'syscalls.h',
2872 command : ['bash', '@INPUT@', cc.cmd_array()],
2875 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
2878 'misc-utils/enosys.c', syscalls_h,
2879 include_directories : includes,
2880 link_with : [lib_common],
2881 install_dir : usrbin_exec_dir,
2883 if not is_disabler(exe)
2885 manadocs += ['misc-utils/enosys.1.adoc']
2886 bashcompletions += ['enosys']
2890 ############################################################
2892 opt = not get_option('build-schedutils').disabled()
2895 'schedutils/chrt.c',
2896 include_directories : includes,
2897 link_with : lib_common,
2898 install_dir : usrbin_exec_dir,
2900 build_by_default : opt)
2904 'schedutils/ionice.c',
2905 include_directories : includes,
2906 link_with : lib_common,
2907 install_dir : usrbin_exec_dir,
2909 build_by_default : opt)
2913 'schedutils/taskset.c',
2914 include_directories : includes,
2915 link_with : lib_common,
2916 install_dir : usrbin_exec_dir,
2918 build_by_default : opt)
2922 'schedutils/uclampset.c',
2923 include_directories : includes,
2924 link_with : lib_common,
2925 install_dir : usrbin_exec_dir,
2927 build_by_default : opt)
2929 if opt and not is_disabler(exe)
2930 exes += [exe, exe2, exe3, exe4]
2931 manadocs += ['schedutils/chrt.1.adoc',
2932 'schedutils/ionice.1.adoc',
2933 'schedutils/taskset.1.adoc',
2934 'schedutils/uclampset.1.adoc']
2935 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2938 ############################################################
2940 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2945 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2946 include_directories : dir_include,
2947 link_with : lib_common)
2953 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2954 include_directories : dir_include,
2955 link_with : lib_common)
2961 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2962 include_directories : dir_include,
2963 link_with : lib_common)
2969 c_args : ['-DTEST_PROGRAM_MANGLE'],
2970 include_directories : dir_include)
2976 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2977 include_directories : dir_include)
2983 'lib/color-names.c',
2984 c_args : ['-DTEST_PROGRAM_COLORS'],
2985 include_directories : dir_include,
2986 link_with : [lib_common, lib_tcolors])
2992 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2993 include_directories : dir_include)
2996 # XXX: HAVE_OPENAT && HAVE_DIRFD
3000 c_args : ['-DTEST_PROGRAM_PROCFS'],
3001 include_directories : dir_include,
3002 link_with : lib_common)
3005 # XXX: HAVE_OPENAT && HAVE_DIRFD
3010 have_cpu_set_t ? 'lib/cpuset.c' : [],
3011 c_args : ['-DTEST_PROGRAM_PATH'],
3012 include_directories : dir_include,
3013 link_with : lib_common)
3021 c_args : ['-DTEST_PROGRAM_PTY'],
3022 include_directories : dir_include,
3023 link_with : [lib_common],
3024 dependencies : [lib_m,
3033 c_args : ['-DTEST_PROGRAM_CPUSET'],
3034 include_directories : dir_include)
3044 have_cpu_set_t ? 'lib/cpuset.c' : [],
3045 c_args : ['-DTEST_PROGRAM_SYSFS'],
3046 include_directories : dir_include)
3052 c_args : ['-DTEST_PROGRAM_PAGER'],
3053 include_directories : dir_include)
3057 'test_linux_version',
3058 'lib/linux_version.c',
3059 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3060 include_directories : dir_include)
3066 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3067 include_directories : dir_include)
3071 'test_canonicalize',
3072 'lib/canonicalize.c',
3073 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3074 include_directories : dir_include)
3081 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3082 include_directories : dir_include)
3088 c_args : ['-DTEST_PROGRAM'],
3089 include_directories : dir_include,
3090 link_with : lib_common)
3096 c_args : ['-DTEST_PROGRAM'],
3097 include_directories : dir_include,
3098 link_with : [lib_common, logindefs_c])
3102 ############################################################
3106 'libuuid/src/test_uuid.c',
3107 include_directories : [dir_include, dir_libuuid],
3108 link_with : lib_uuid,
3109 dependencies : socket_libs)
3110 if not is_disabler(exe)
3114 ############################################################
3116 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3118 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3122 'libfdisk/src/ask.c',
3123 c_args : libfdisk_tests_cflags,
3124 include_directories : lib_fdisk_includes,
3125 link_with : libfdisk_tests_ldadd)
3126 if not is_disabler(exe)
3132 'libfdisk/src/gpt.c',
3133 c_args : libfdisk_tests_cflags,
3134 include_directories : lib_fdisk_includes,
3135 link_with : libfdisk_tests_ldadd)
3136 if not is_disabler(exe)
3142 'libfdisk/src/utils.c',
3143 c_args : libfdisk_tests_cflags,
3144 include_directories : lib_fdisk_includes,
3145 link_with : libfdisk_tests_ldadd)
3146 if not is_disabler(exe)
3151 'test_fdisk_script',
3152 'libfdisk/src/script.c',
3153 c_args : libfdisk_tests_cflags,
3154 include_directories : lib_fdisk_includes,
3155 link_with : libfdisk_tests_ldadd)
3156 if not is_disabler(exe)
3161 'test_fdisk_version',
3162 'libfdisk/src/version.c',
3163 c_args : libfdisk_tests_cflags,
3164 include_directories : lib_fdisk_includes,
3165 link_with : libfdisk_tests_ldadd)
3166 if not is_disabler(exe)
3172 'libfdisk/src/item.c',
3173 c_args : libfdisk_tests_cflags,
3174 include_directories : lib_fdisk_includes,
3175 link_with : libfdisk_tests_ldadd)
3176 if not is_disabler(exe)
3180 sample_fdisk_cflags = ['-Wno-unused']
3181 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3184 'sample-fdisk-mkpart',
3185 'libfdisk/samples/mkpart.c',
3186 c_args : sample_fdisk_cflags,
3187 include_directories : lib_fdisk_includes,
3188 link_with : sample_fdisk_ldadd)
3189 if not is_disabler(exe)
3194 'sample-fdisk-mkpart-fullspec',
3195 'libfdisk/samples/mkpart-fullspec.c',
3196 c_args : sample_fdisk_cflags,
3197 include_directories : lib_fdisk_includes,
3198 link_with : sample_fdisk_ldadd)
3199 if not is_disabler(exe)
3203 ############################################################
3207 'tests/helpers/test_mbsencode.c',
3208 include_directories : includes,
3209 link_with : lib_common)
3214 'tests/helpers/test_byteswap.c',
3215 include_directories : includes)
3220 'tests/helpers/test_md5.c',
3222 include_directories : includes)
3227 'tests/helpers/test_sha1.c',
3229 include_directories : includes)
3234 'tests/helpers/test_pathnames.c',
3235 include_directories : includes)
3240 'tests/helpers/test_strerror.c',
3241 include_directories : includes)
3246 'tests/helpers/test_sysinfo.c',
3247 include_directories : includes)
3252 'tests/helpers/test_sigreceive.c',
3253 include_directories : includes,
3254 link_with : lib_common)
3259 'tests/helpers/test_tiocsti.c',
3260 include_directories : includes)
3264 'test_uuid_namespace',
3265 'tests/helpers/test_uuid_namespace.c',
3269 include_directories : includes)
3273 mq_libs += cc.find_library('rt', required : true)
3277 'tests/helpers/test_mkfds.c',
3278 include_directories : includes,
3279 dependencies : mq_libs)
3284 'tests/helpers/test_enosys.c',
3285 include_directories : includes)
3288 ############################################################
3292 'sample-scols-tree',
3293 'libsmartcols/samples/tree.c',
3294 include_directories : includes,
3295 link_with : [lib_smartcols, lib_common])
3296 if not is_disabler(exe)
3301 'sample-scols-title',
3302 'libsmartcols/samples/title.c',
3303 include_directories : includes,
3304 link_with : [lib_smartcols, lib_common])
3305 if not is_disabler(exe)
3310 'sample-scols-wrap',
3311 'libsmartcols/samples/wrap.c',
3312 include_directories : includes,
3313 link_with : [lib_smartcols, lib_common])
3314 if not is_disabler(exe)
3319 'sample-scols-continuous',
3320 'libsmartcols/samples/continuous.c',
3321 include_directories : includes,
3322 link_with : [lib_smartcols, lib_common])
3323 if not is_disabler(exe)
3328 'sample-scols-maxout',
3329 'libsmartcols/samples/maxout.c',
3330 include_directories : includes,
3331 link_with : [lib_smartcols, lib_common])
3332 if not is_disabler(exe)
3337 'sample-scols-fromfile',
3338 'libsmartcols/samples/fromfile.c',
3339 include_directories : includes,
3340 link_with : [lib_smartcols, lib_common])
3341 if not is_disabler(exe)
3346 'sample-scols-grouping-simple',
3347 'libsmartcols/samples/grouping-simple.c',
3348 include_directories : includes,
3349 link_with : [lib_smartcols, lib_common])
3350 if not is_disabler(exe)
3355 'sample-scols-grouping-overlay',
3356 'libsmartcols/samples/grouping-overlay.c',
3357 include_directories : includes,
3358 link_with : [lib_smartcols, lib_common])
3359 if not is_disabler(exe)
3363 ############################################################
3365 # Let the test runner know whether we're running under asan and export
3366 # some paths. We use a file on disk so that it is possible to run the
3367 # test scripts from commandline without setting any variables.
3368 configure_file(output : 'meson.conf',
3373 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3374 python.full_path())])
3376 run_sh = find_program('tests/run.sh')
3380 '--srcdir=' + meson.current_source_dir(),
3381 '--builddir=' + meson.current_build_dir(),
3387 manadocs += ['lib/terminal-colors.d.5.adoc']
3388 manadocs += ['libblkid/libblkid.3.adoc']
3392 'libuuid/man/uuid.3.adoc',
3393 'libuuid/man/uuid_clear.3.adoc',
3394 'libuuid/man/uuid_compare.3.adoc',
3395 'libuuid/man/uuid_copy.3.adoc',
3396 'libuuid/man/uuid_generate.3.adoc',
3397 'libuuid/man/uuid_is_null.3.adoc',
3398 'libuuid/man/uuid_parse.3.adoc',
3399 'libuuid/man/uuid_time.3.adoc',
3400 'libuuid/man/uuid_unparse.3.adoc']
3402 'uuid_generate_random.3': 'uuid_generate.3',
3403 'uuid_generate_time.3': 'uuid_generate.3',
3404 'uuid_generate_time_safe.3': 'uuid_generate.3',
3408 asciidoctor = find_program('asciidoctor', required : false)
3409 if asciidoctor.found()
3410 foreach adoc : manadocs
3411 name = adoc.split('/')[-1]
3412 page = name.split('.adoc')[0]
3413 section = page.split('.')[-1]
3414 mandirn = join_paths(mandir, 'man' + section)
3419 command : [ asciidoctor,
3421 '-a', 'VERSION=' + meson.project_version(),
3422 '-a', 'release-version=' + meson.project_version(),
3423 '-a', 'ADJTIME_PATH=/etc/adjtime',
3424 '-a', 'package-docdir=' + docdir,
3425 '--base-dir=' + meson.current_source_dir(),
3426 '--destination-dir=' + meson.current_build_dir(),
3427 '--load-path', '@SOURCE_ROOT@/tools',
3428 '--require', 'asciidoctor-includetracker',
3432 depfile : page + '.deps',
3434 install_dir : mandirn)
3437 foreach link_name, target : manlinks
3438 link_section = link_name.split('.')[-1]
3439 target_section = target.split('.')[-1]
3440 meson.add_install_script(meson_make_manpage_stub,
3441 join_paths('man' + target_section, target),
3442 join_paths(mandir, 'man' + link_section, link_name))
3446 if bash_completion.found()
3447 foreach completion : bashcompletions
3449 join_paths('bash-completion', completion),
3450 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3453 foreach link_name, target : bashcompletionslinks
3454 meson.add_install_script(meson_make_symlink,
3456 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))