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,
1016 install_mode : 'rwsr-xr-x',
1018 build_by_default : opt)
1019 if opt and not is_disabler(exe)
1021 manadocs += ['login-utils/newgrp.1.adoc']
1022 bashcompletions += ['newgrp']
1025 opt = not get_option('build-lslogins').disabled()
1028 'login-utils/lslogins.c',
1029 include_directories : includes,
1030 link_with : [lib_common,
1033 dependencies : [lib_selinux,
1035 install_dir : usrbin_exec_dir,
1037 build_by_default : opt)
1038 if opt and not is_disabler(exe)
1040 manadocs += ['login-utils/lslogins.1.adoc']
1041 bashcompletions += ['lslogins']
1044 opt = not get_option('build-vipw').disabled()
1047 'login-utils/vipw.c',
1048 'login-utils/setpwnam.h',
1049 include_directories : includes,
1050 link_with : [lib_common],
1051 dependencies : [lib_selinux],
1052 install_dir : usrbin_exec_dir,
1054 build_by_default : opt)
1055 if opt and not is_disabler(exe)
1057 meson.add_install_script(meson_make_symlink,
1059 join_paths(usrbin_exec_dir, 'vigr'))
1060 manadocs += ['login-utils/vipw.8.adoc']
1061 meson.add_install_script(meson_make_symlink,
1063 join_paths(mandir, 'man8/vigr.8'))
1066 opt = not get_option('build-runuser').disabled()
1069 'login-utils/runuser.c',
1070 'login-utils/su-common.c',
1071 'login-utils/su-common.h',
1075 include_directories : includes,
1076 link_with : [lib_common, logindefs_c],
1077 dependencies : [lib_pam,
1081 install_dir : sbindir,
1083 build_by_default : opt)
1084 if opt and not is_disabler(exe)
1086 manadocs += ['login-utils/runuser.1.adoc']
1087 bashcompletionslinks += {'runuser': 'su'}
1090 ############################################################
1095 include_directories : includes,
1096 link_with : lib_common,
1097 install_dir : usrbin_exec_dir,
1100 manadocs += ['text-utils/col.1.adoc']
1101 bashcompletions += ['col']
1106 include_directories : includes,
1107 install_dir : usrbin_exec_dir,
1110 manadocs += ['text-utils/colcrt.1.adoc']
1111 bashcompletions += ['colcrt']
1116 include_directories : includes,
1117 link_with : lib_common,
1118 install_dir : usrbin_exec_dir,
1121 manadocs += ['text-utils/colrm.1.adoc']
1122 bashcompletions += ['colrm']
1127 include_directories : includes,
1128 install_dir : usrbin_exec_dir,
1131 manadocs += ['text-utils/rev.1.adoc']
1132 bashcompletions += ['rev']
1137 include_directories : includes,
1138 link_with : [lib_common,
1140 install_dir : usrbin_exec_dir,
1142 if not is_disabler(exe)
1144 manadocs += ['text-utils/column.1.adoc']
1145 bashcompletions += ['column']
1148 opt = not get_option('build-line').disabled()
1152 include_directories : includes,
1153 install_dir : usrbin_exec_dir,
1155 build_by_default : opt)
1156 if opt and not is_disabler(exe)
1158 manadocs += ['text-utils/line.1.adoc']
1161 opt = not get_option('build-pg').disabled()
1165 link_with : lib_common,
1166 include_directories : includes,
1167 dependencies : [lib_tinfo,
1169 install_dir : usrbin_exec_dir,
1171 build_by_default : opt)
1172 if opt and not is_disabler(exe)
1174 manadocs += ['text-utils/pg.1.adoc']
1175 bashcompletions += ['pg']
1178 opt = not get_option('build-ul').disabled()
1182 include_directories : includes,
1183 dependencies : [lib_tinfo,
1185 install_dir : usrbin_exec_dir,
1187 build_by_default : opt)
1188 if opt and not is_disabler(exe)
1190 manadocs += ['text-utils/ul.1.adoc']
1191 bashcompletions += ['ul']
1194 opt = not get_option('build-more').disabled()
1198 link_with : [lib_common],
1199 include_directories : includes,
1200 dependencies : [lib_tinfo,
1204 build_by_default : opt)
1208 link_with : [lib_common],
1209 include_directories : includes,
1210 c_args : '-DTEST_PROGRAM',
1211 dependencies : [lib_tinfo,
1214 build_by_default : opt)
1216 if opt and not is_disabler(exe)
1218 manadocs += ['text-utils/more.1.adoc']
1219 bashcompletions += ['more']
1225 include_directories : includes,
1226 link_with : [lib_common,
1228 install_dir : usrbin_exec_dir,
1230 if not is_disabler(exe)
1232 manadocs += ['text-utils/hexdump.1.adoc']
1233 bashcompletions += ['hexdump']
1236 opt = not get_option('build-lsmem').disabled()
1240 include_directories : includes,
1241 link_with : [lib_common,
1243 install_dir : usrbin_exec_dir,
1245 build_by_default : opt)
1246 if opt and not is_disabler(exe)
1248 manadocs += ['sys-utils/lsmem.1.adoc']
1249 bashcompletions += ['lsmem']
1252 opt = not get_option('build-chmem').disabled()
1256 include_directories : includes,
1257 link_with : [lib_common],
1258 install_dir : usrbin_exec_dir,
1260 build_by_default : opt)
1261 if opt and not is_disabler(exe)
1263 manadocs += ['sys-utils/chmem.8.adoc']
1264 bashcompletions += ['chmem']
1270 include_directories : includes,
1271 link_with : [lib_common],
1272 install_dir : usrbin_exec_dir,
1275 manadocs += ['sys-utils/choom.1.adoc']
1280 include_directories : includes,
1281 link_with : [lib_common],
1282 install_dir : usrbin_exec_dir,
1285 manadocs += ['sys-utils/ipcmk.1.adoc']
1286 bashcompletions += ['ipcmk']
1291 include_directories : includes,
1292 link_with : [lib_common],
1293 install_dir : usrbin_exec_dir,
1296 manadocs += ['sys-utils/ipcrm.1.adoc']
1297 bashcompletions += ['ipcrm']
1299 opt = not get_option('build-ipcs').disabled()
1303 include_directories : includes,
1304 link_with : [lib_common],
1305 install_dir : usrbin_exec_dir,
1307 build_by_default : opt)
1308 if opt and not is_disabler(exe)
1310 manadocs += ['sys-utils/ipcs.1.adoc']
1311 bashcompletions += ['ipcs']
1314 opt = not get_option('build-rfkill').disabled()
1318 include_directories : includes,
1319 link_with : [lib_common,
1321 install_dir : usrsbin_exec_dir,
1323 build_by_default : opt)
1324 if opt and not is_disabler(exe)
1326 manadocs += ['sys-utils/rfkill.8.adoc']
1327 bashcompletions += ['rfkill']
1333 include_directories : includes,
1334 link_with : [lib_common,
1336 install_dir : usrbin_exec_dir,
1338 if not is_disabler(exe)
1340 manadocs += ['sys-utils/renice.1.adoc']
1341 bashcompletions += ['renice']
1347 include_directories : includes,
1348 link_with : [lib_common,
1350 install_dir : usrbin_exec_dir,
1352 if opt and not is_disabler(exe)
1354 manadocs += ['sys-utils/setsid.1.adoc']
1355 bashcompletions += ['setsid']
1360 readprofile_sources,
1361 include_directories : includes,
1362 link_with : [lib_common,
1364 install_dir : usrsbin_exec_dir,
1366 if not is_disabler(exe)
1368 manadocs += ['sys-utils/readprofile.8.adoc']
1369 bashcompletions += ['readprofile']
1372 opt = not get_option('build-tunelp').disabled()
1376 include_directories : includes,
1377 link_with : [lib_common],
1378 install_dir : usrsbin_exec_dir,
1380 build_by_default : opt)
1381 if opt and not is_disabler(exe)
1383 manadocs += ['sys-utils/tunelp.8.adoc']
1384 bashcompletions += ['tunelp']
1390 include_directories : includes,
1391 link_with : [lib_common,
1393 install_dir : sbindir,
1395 if not is_disabler(exe)
1397 manadocs += ['sys-utils/fstrim.8.adoc']
1398 bashcompletions += ['fstrim']
1404 include_directories : includes,
1405 link_with : [lib_common,
1408 if not is_disabler(exe)
1410 manadocs += ['sys-utils/dmesg.1.adoc']
1411 bashcompletions += ['dmesg']
1417 include_directories : dir_include,
1418 c_args : '-DTEST_DMESG',
1419 link_with : [lib_common,
1421 if not is_disabler(exe)
1428 include_directories : includes,
1429 link_with : [lib_common],
1430 install_dir : sbindir,
1433 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1434 bashcompletions += ['ctrlaltdel']
1439 include_directories : includes,
1440 install_dir : sbindir,
1443 manadocs += ['sys-utils/fsfreeze.8.adoc']
1444 bashcompletions += ['fsfreeze']
1449 include_directories : includes,
1450 link_with : [lib_common,
1452 install_dir : sbindir,
1455 manadocs += ['sys-utils/blkdiscard.8.adoc']
1456 bashcompletions += ['blkdiscard']
1461 include_directories : includes,
1462 link_with : [lib_common],
1463 install_dir : sbindir,
1466 manadocs += ['sys-utils/blkzone.8.adoc']
1467 bashcompletions += ['blkzone']
1472 include_directories : includes,
1473 link_with : [lib_common],
1474 install_dir : sbindir,
1477 manadocs += ['sys-utils/blkpr.8.adoc']
1482 include_directories : includes,
1483 link_with : [lib_common],
1484 install_dir : usrsbin_exec_dir,
1487 manadocs += ['sys-utils/ldattach.8.adoc']
1488 bashcompletions += ['ldattach']
1493 include_directories : includes,
1494 link_with : [lib_common],
1495 install_dir : usrsbin_exec_dir,
1498 manadocs += ['sys-utils/rtcwake.8.adoc']
1499 bashcompletions += ['rtcwake']
1504 include_directories : includes,
1505 link_with : [lib_common],
1506 install_dir : usrbin_exec_dir,
1509 manadocs += ['sys-utils/setarch.8.adoc']
1510 bashcompletions += ['setarch']
1512 setarch_links = ['uname26', 'linux32', 'linux64']
1513 setarch_links_arch = {
1514 's390x' : ['s390', 's390x'],
1516 'x86_64' : ['i386', 'x86_64'],
1517 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1518 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1519 'mips64' : ['mips', 'mips64', 'mips32'],
1520 'ia64' : ['i386', 'ia64'],
1521 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1523 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1525 foreach link: setarch_links
1526 meson.add_install_script(meson_make_symlink,
1528 join_paths(usrbin_exec_dir, link))
1529 manlinks += {link + '.8': 'setarch.8'}
1532 opt = not get_option('build-eject').disabled()
1536 include_directories : includes,
1537 link_with : [lib_common,
1539 install_dir : usrbin_exec_dir,
1541 build_by_default : opt)
1542 if opt and not is_disabler(exe)
1544 manadocs += ['sys-utils/eject.1.adoc']
1545 bashcompletions += ['eject']
1548 opt = not get_option('build-losetup').disabled()
1552 include_directories : includes,
1553 link_with : [lib_common,
1555 install_dir : sbindir,
1557 build_by_default : opt)
1558 if opt and not is_disabler(exe)
1559 manadocs += ['sys-utils/losetup.8.adoc']
1561 bashcompletions += ['losetup']
1564 opt = opt and 'losetup' in static_programs
1568 include_directories : includes,
1569 link_args : ['--static'],
1570 link_with : [lib_common,
1571 lib_smartcols.get_static_lib()],
1572 install_dir : sbindir,
1574 build_by_default : opt)
1575 if opt and not is_disabler(exe)
1579 opt = not get_option('build-zramctl').disabled()
1583 include_directories : includes,
1584 link_with : [lib_common,
1586 install_dir : sbindir,
1588 build_by_default : opt)
1589 if opt and not is_disabler(exe)
1591 manadocs += ['sys-utils/zramctl.8.adoc']
1592 bashcompletions += ['zramctl']
1598 include_directories : includes,
1599 link_with : [lib_common,
1601 install_dir : usrbin_exec_dir,
1603 if not is_disabler(exe)
1605 manadocs += ['sys-utils/prlimit.1.adoc']
1606 bashcompletions += ['prlimit']
1612 include_directories : includes,
1613 link_with : [lib_common,
1616 install_dir : usrbin_exec_dir,
1618 if not is_disabler(exe)
1620 manadocs += ['sys-utils/lsns.8.adoc']
1621 bashcompletions += ['lsns']
1624 opt = not get_option('build-mount').disabled()
1628 include_directories : includes,
1629 link_with : [lib_common,
1632 dependencies : lib_selinux,
1634 build_by_default : opt)
1638 include_directories : includes,
1639 link_with : [lib_common,
1642 build_by_default : opt)
1643 if opt and not is_disabler(exe)
1645 manadocs += ['sys-utils/fstab.5.adoc',
1646 'sys-utils/mount.8.adoc',
1647 'sys-utils/umount.8.adoc']
1648 bashcompletions += ['mount', 'umount']
1651 opt2 = opt and 'mount' in static_programs
1655 include_directories : includes,
1656 link_args : ['--static'],
1657 link_with : [lib_common,
1658 lib_smartcols_static,
1661 build_by_default : opt2)
1662 if opt2 and not is_disabler(exe)
1666 opt2 = opt and 'umount' in static_programs
1670 include_directories : includes,
1671 link_args : ['--static'],
1672 link_with : [lib_common,
1675 build_by_default : opt2)
1676 if opt2 and not is_disabler(exe)
1685 include_directories : includes,
1686 link_with : [lib_common,
1690 install_dir : sbindir,
1692 if not is_disabler(exe)
1694 manadocs += ['sys-utils/swapon.8.adoc']
1695 bashcompletions += ['swapon']
1701 include_directories : includes,
1702 link_with : [lib_common,
1705 install_dir : sbindir,
1707 if not is_disabler(exe)
1709 manlinks += {'swapoff.8': 'swapon.8'}
1710 bashcompletions += ['swapoff']
1716 include_directories : includes,
1717 link_with : [lib_common,
1719 dependencies : [rtas_libs],
1720 install_dir : usrbin_exec_dir,
1722 if not is_disabler(exe)
1724 manadocs += ['sys-utils/lscpu.1.adoc']
1725 bashcompletions += ['lscpu']
1731 include_directories : includes,
1732 link_with : [lib_common],
1733 install_dir : sbindir,
1736 manadocs += ['sys-utils/chcpu.8.adoc']
1737 bashcompletions += ['chcpu']
1742 include_directories : includes,
1743 link_with : [lib_common,
1746 if not is_disabler(exe)
1748 manadocs += ['sys-utils/wdctl.8.adoc']
1749 bashcompletions += ['wdctl']
1752 opt = not get_option('build-mountpoint').disabled()
1756 include_directories : includes,
1757 link_with : [lib_mount],
1759 build_by_default : opt)
1760 if opt and not is_disabler(exe)
1762 manadocs += ['sys-utils/mountpoint.1.adoc']
1763 bashcompletions += ['mountpoint']
1766 opt = not get_option('build-fallocate').disabled()
1770 include_directories : includes,
1771 link_with : [lib_common],
1772 install_dir : usrbin_exec_dir,
1774 build_by_default : opt)
1775 if opt and not is_disabler(exe)
1777 manadocs += ['sys-utils/fallocate.1.adoc']
1778 bashcompletions += ['fallocate']
1781 opt = not get_option('build-pivot_root').disabled()
1785 include_directories : includes,
1786 install_dir : sbindir,
1788 build_by_default : opt)
1789 if opt and not is_disabler(exe)
1791 manadocs += ['sys-utils/pivot_root.8.adoc']
1792 bashcompletions += ['pivot_root']
1795 opt = not get_option('build-switch_root').disabled()
1796 if opt and not have_dirfd and not have_ddfd
1797 error('neither dirfd nor ddfd are available')
1801 switch_root_sources,
1802 include_directories : includes,
1803 install_dir : sbindir,
1805 build_by_default : opt)
1806 if opt and not is_disabler(exe)
1808 manadocs += ['sys-utils/switch_root.8.adoc']
1811 opt = not get_option('build-unshare').disabled()
1815 include_directories : includes,
1816 link_with : [lib_common],
1817 install_dir : usrbin_exec_dir,
1819 build_by_default : opt)
1820 if opt and not is_disabler(exe)
1822 manadocs += ['sys-utils/unshare.1.adoc']
1823 bashcompletions += ['unshare']
1826 opt = opt and 'unshare' in static_programs
1830 include_directories : includes,
1831 link_with : [lib_common],
1832 install_dir : usrbin_exec_dir,
1834 build_by_default : opt)
1835 if opt and not is_disabler(exe)
1839 opt = not get_option('build-nsenter').disabled()
1843 include_directories : includes,
1844 link_with : [lib_common],
1845 dependencies : [lib_selinux],
1846 install_dir : usrbin_exec_dir,
1848 build_by_default : opt)
1849 if opt and not is_disabler(exe)
1851 manadocs += ['sys-utils/nsenter.1.adoc']
1852 bashcompletions += ['nsenter']
1855 opt = opt and 'nsenter' in static_programs
1859 include_directories : includes,
1860 link_with : [lib_common],
1861 dependencies : [lib_selinux],
1862 install_dir : usrbin_exec_dir,
1864 build_by_default : opt)
1865 if opt and not is_disabler(exe)
1869 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1873 include_directories : includes,
1874 link_with : [lib_common],
1875 dependencies : [lib_cap_ng],
1876 install_dir : usrbin_exec_dir,
1878 build_by_default : opt)
1879 if opt and not is_disabler(exe)
1881 manadocs += ['sys-utils/setpriv.1.adoc']
1882 bashcompletions += ['setpriv']
1888 include_directories : includes,
1889 link_with : [lib_common],
1890 dependencies : realtime_libs,
1891 install_dir : usrbin_exec_dir,
1894 manadocs += ['sys-utils/flock.1.adoc']
1895 bashcompletions += ['flock']
1897 opt = not get_option('build-lsirq').disabled()
1901 include_directories : includes,
1902 link_with : [lib_common,
1904 install_dir : usrbin_exec_dir,
1906 build_by_default : opt)
1907 if opt and not is_disabler(exe)
1909 manadocs += ['sys-utils/lsirq.1.adoc']
1910 bashcompletions += ['lsirq']
1913 opt = not get_option('build-irqtop').disabled()
1917 include_directories : includes,
1918 dependencies : [realtime_libs, curses_libs],
1919 link_with : [lib_common,
1922 install_dir : usrbin_exec_dir,
1924 build_by_default : opt)
1925 if opt and not is_disabler(exe)
1927 manadocs += ['sys-utils/irqtop.1.adoc']
1928 bashcompletions += ['irqtop']
1931 opt = not get_option('build-ipcs').disabled()
1935 include_directories : includes,
1936 link_with : [lib_common,
1938 install_dir : usrbin_exec_dir,
1940 build_by_default : opt)
1941 if opt and not is_disabler(exe)
1943 manadocs += ['sys-utils/lsipc.1.adoc']
1944 bashcompletions += ['lsipc']
1951 include_directories : includes,
1952 link_with : [lib_common],
1953 dependencies : [lib_m,
1955 install_dir : sbindir,
1957 build_by_default : opt)
1958 if opt and not is_disabler(exe)
1960 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1961 bashcompletions += ['hwclock']
1967 include_directories : includes,
1968 install_dir : sbindir,
1971 manadocs += ['disk-utils/mkfs.8.adoc']
1972 bashcompletions += ['mkfs']
1974 opt = not get_option('build-bfs').disabled()
1978 include_directories : includes,
1979 link_with : [lib_common],
1980 install_dir : sbindir,
1982 build_by_default : opt)
1983 if opt and not is_disabler(exe)
1985 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1986 bashcompletions += ['mkfs.bfs']
1992 include_directories : includes,
1993 link_with : [lib_common],
1994 install_dir : usrbin_exec_dir,
1997 manadocs += ['disk-utils/isosize.8.adoc']
1998 bashcompletions += ['isosize']
2003 include_directories : includes,
2004 link_with : [lib_common,
2007 dependencies: [lib_selinux],
2008 install_dir : sbindir,
2010 if opt and not is_disabler(exe)
2012 manadocs += ['disk-utils/mkswap.8.adoc']
2013 bashcompletions += ['mkswap']
2019 include_directories : includes,
2020 link_with : [lib_common,
2023 install_dir : sbindir,
2025 if opt and not is_disabler(exe)
2027 manadocs += ['disk-utils/swaplabel.8.adoc']
2028 bashcompletions += ['swaplabel']
2031 opt = not get_option('build-fsck').disabled()
2035 include_directories : includes,
2036 link_with : [lib_common,
2039 dependencies : realtime_libs,
2040 install_dir : sbindir,
2042 build_by_default : opt)
2043 if opt and not is_disabler(exe)
2045 manadocs += ['disk-utils/fsck.8.adoc']
2046 bashcompletions += ['fsck']
2049 opt = not get_option('build-minix').disabled()
2053 include_directories : includes,
2054 link_with : [lib_common],
2055 install_dir : sbindir,
2057 build_by_default : opt)
2061 include_directories : includes,
2062 c_args : '-DTEST_SCRIPT',
2063 link_with : [lib_common],
2064 build_by_default : opt)
2068 include_directories : includes,
2069 link_with : [lib_common],
2070 install_dir : sbindir,
2072 build_by_default : opt)
2073 if opt and not is_disabler(exe)
2074 exes += [exe, exe2, exe3]
2075 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2076 bashcompletions += ['mkfs.minix', 'fsck.minix']
2079 opt = not get_option('build-cramfs').disabled()
2082 mkfs_cramfs_sources,
2083 include_directories : includes,
2084 link_with : [lib_common],
2085 dependencies : [lib_z],
2086 install_dir : sbindir,
2088 build_by_default : opt)
2091 fsck_cramfs_sources,
2092 include_directories : includes,
2093 link_with : [lib_common],
2094 dependencies : [lib_z],
2095 install_dir : sbindir,
2097 build_by_default : opt)
2098 if not is_disabler(exe)
2100 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2101 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2104 opt = not get_option('build-raw').disabled()
2106 cc.has_header('linux/raw.h', required: opt)
2111 include_directories : includes,
2112 install_dir : sbindir,
2114 build_by_default : opt)
2115 if opt and not is_disabler(exe)
2117 manadocs += ['disk-utils/raw.8.adoc']
2118 bashcompletions += ['raw']
2121 opt = not get_option('build-fdformat').disabled()
2125 include_directories : includes,
2126 link_with : [lib_common],
2127 install_dir : usrsbin_exec_dir,
2129 build_by_default : opt)
2130 if opt and not is_disabler(exe)
2132 manadocs += ['disk-utils/fdformat.8.adoc']
2138 include_directories : includes,
2139 link_with : [lib_common],
2140 install_dir : sbindir,
2142 manadocs += ['disk-utils/blockdev.8.adoc']
2143 bashcompletions += ['blockdev']
2145 opt = not get_option('build-fdisks').disabled()
2146 if opt and not have_dirfd and not have_ddfd
2147 error('neither dirfd nor ddfd are available')
2152 include_directories : includes,
2153 link_with : [lib_common,
2157 dependencies : [lib_readline],
2158 install_dir : sbindir,
2160 build_by_default : opt)
2161 if opt and not is_disabler(exe)
2163 bashcompletions += ['fdisk']
2166 opt2 = opt and 'fdisk' in static_programs
2170 link_args : ['--static'],
2171 include_directories : includes,
2172 link_with : [lib_common,
2175 lib_smartcols.get_static_lib()],
2176 dependencies : [lib_readline_static],
2177 install_dir : sbindir,
2179 build_by_default : opt2)
2180 if opt2 and not is_disabler(exe)
2187 include_directories : includes,
2188 link_with : [lib_common,
2192 dependencies : [lib_readline],
2193 install_dir : sbindir,
2195 build_by_default : opt)
2196 if opt and not is_disabler(exe)
2198 bashcompletions += ['sfdisk']
2201 opt2 = opt and 'sfdisk' in static_programs
2205 include_directories : includes,
2206 link_with : [lib_common,
2209 lib_smartcols.get_static_lib()],
2210 dependencies : [lib_readline_static],
2211 install_dir : sbindir,
2213 build_by_default : opt2)
2214 if opt2 and not is_disabler(exe)
2221 include_directories : includes,
2222 link_with : [lib_common,
2227 dependencies : [curses_libs],
2228 install_dir : sbindir,
2230 build_by_default : opt)
2231 if opt and not is_disabler(exe)
2233 manadocs += ['disk-utils/fdisk.8.adoc',
2234 'disk-utils/sfdisk.8.adoc',
2235 'disk-utils/cfdisk.8.adoc']
2236 bashcompletions += ['cfdisk']
2239 opt = not get_option('build-partx').disabled()
2243 include_directories : includes,
2244 link_with : [lib_common],
2245 install_dir : usrsbin_exec_dir,
2247 build_by_default : opt)
2251 include_directories : includes,
2252 link_with : [lib_common],
2253 install_dir : usrsbin_exec_dir,
2255 build_by_default : opt)
2259 include_directories : includes,
2260 link_with : [lib_common],
2261 install_dir : usrsbin_exec_dir,
2263 build_by_default : opt)
2267 include_directories : includes,
2268 link_with : [lib_common,
2271 install_dir : usrsbin_exec_dir,
2273 build_by_default : opt)
2275 exes += [exe, exe2, exe3, exe4]
2276 manadocs += ['disk-utils/addpart.8.adoc',
2277 'disk-utils/delpart.8.adoc',
2278 'disk-utils/resizepart.8.adoc',
2279 'disk-utils/partx.8.adoc']
2280 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2283 ############################################################
2288 include_directories : includes,
2289 link_with : [lib_common],
2290 dependencies : [lib_util,
2294 install_dir : usrbin_exec_dir,
2297 manadocs += ['term-utils/script.1.adoc']
2298 bashcompletions += ['script']
2303 include_directories : includes,
2304 c_args : '-DTEST_SCRIPT',
2305 link_with : [lib_common],
2306 dependencies : [lib_util,
2315 include_directories : includes,
2316 link_with : [lib_common],
2317 dependencies : [lib_util,
2320 install_dir : usrbin_exec_dir,
2323 manadocs += ['term-utils/scriptlive.1.adoc']
2324 bashcompletions += ['scriptlive']
2328 scriptreplay_sources,
2329 include_directories : includes,
2330 link_with : [lib_common],
2331 dependencies : [math_libs],
2332 install_dir : usrbin_exec_dir,
2335 manadocs += ['term-utils/scriptreplay.1.adoc']
2336 bashcompletions += ['scriptreplay']
2338 opt = not get_option('build-agetty').disabled()
2342 include_directories : includes,
2343 link_with : [lib_common, logindefs_c],
2344 dependencies : BSD ? lib_util : [],
2345 install_dir : sbindir,
2347 build_by_default : opt)
2350 manadocs += ['term-utils/agetty.8.adoc']
2353 opt = not get_option('build-setterm').disabled()
2357 include_directories : includes,
2358 link_with : [lib_common],
2359 dependencies : [curses_libs],
2360 install_dir : usrbin_exec_dir,
2362 build_by_default : opt)
2365 manadocs += ['term-utils/setterm.1.adoc']
2366 bashcompletions += ['setterm']
2369 opt = not get_option('build-mesg').disabled()
2373 include_directories : includes,
2374 link_with : [lib_common],
2375 install_dir : usrbin_exec_dir,
2377 build_by_default : opt)
2380 manadocs += ['term-utils/mesg.1.adoc']
2381 bashcompletions += ['mesg']
2384 opt = not get_option('build-wall').disabled()
2388 include_directories : includes,
2389 link_with : [lib_common],
2390 install_dir : usrbin_exec_dir,
2392 build_by_default : opt)
2395 manadocs += ['term-utils/wall.1.adoc']
2396 bashcompletions += ['wall']
2399 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2400 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2402 opt = not get_option('build-write').disabled()
2406 include_directories : includes,
2407 link_with : [lib_common],
2408 install_dir : usrbin_exec_dir,
2410 build_by_default : opt)
2413 manadocs += ['term-utils/write.1.adoc']
2414 bashcompletions += ['write']
2417 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2418 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2420 opt = not get_option('build-login').disabled()
2424 include_directories : includes,
2425 link_with : [lib_common, logindefs_c],
2426 dependencies : [lib_pam,
2430 build_by_default : opt)
2431 if not is_disabler(exe)
2433 manadocs += ['login-utils/login.1.adoc']
2436 opt = not get_option('build-sulogin').disabled()
2440 include_directories : includes,
2441 link_with : [lib_common],
2442 dependencies : [lib_crypt,
2444 install_dir : sbindir,
2446 build_by_default : opt)
2447 if not is_disabler(exe)
2449 manadocs += ['login-utils/sulogin.8.adoc']
2455 include_directories : includes,
2456 link_with : [lib_common,
2458 dependencies : [curses_libs],
2459 install_dir : usrbin_exec_dir,
2462 manadocs += ['misc-utils/cal.1.adoc']
2463 bashcompletions += ['cal']
2465 opt = not get_option('build-logger').disabled()
2469 include_directories : includes,
2470 link_with : [lib_common],
2471 dependencies : [lib_systemd],
2472 install_dir : usrbin_exec_dir,
2474 build_by_default : opt)
2475 if opt and not is_disabler(exe)
2477 manadocs += ['misc-utils/logger.1.adoc']
2478 bashcompletions += ['logger']
2484 include_directories : includes,
2485 c_args : '-DTEST_LOGGER',
2486 link_with : [lib_common],
2487 dependencies : [lib_systemd])
2488 if not is_disabler(exe)
2495 include_directories : includes,
2496 install_dir : usrbin_exec_dir,
2499 manadocs += ['misc-utils/look.1.adoc']
2500 bashcompletions += ['look']
2505 include_directories : includes,
2506 link_with : [lib_common],
2507 install_dir : usrbin_exec_dir,
2510 manadocs += ['misc-utils/mcookie.1.adoc']
2511 bashcompletions += ['mcookie']
2516 include_directories : includes,
2517 dependencies : [lib_selinux],
2518 install_dir : usrbin_exec_dir,
2521 manadocs += ['misc-utils/namei.1.adoc']
2522 bashcompletions += ['namei']
2527 include_directories : includes,
2528 link_with : [lib_common],
2529 install_dir : usrbin_exec_dir,
2532 manadocs += ['misc-utils/whereis.1.adoc']
2533 bashcompletions += ['whereis']
2538 include_directories : includes,
2539 link_with : [lib_common,
2542 install_dir : usrbin_exec_dir,
2544 if not is_disabler(exe)
2546 manadocs += ['misc-utils/lslocks.8.adoc']
2547 bashcompletions += ['lslocks']
2553 include_directories : includes,
2554 link_with : [lib_common,
2558 dependencies : lib_udev,
2560 if not is_disabler(exe)
2562 manadocs += ['misc-utils/lsblk.8.adoc']
2563 bashcompletions += ['lsblk']
2569 include_directories : includes,
2570 link_with : [lib_common,
2572 install_dir : usrbin_exec_dir,
2574 if not is_disabler(exe)
2576 manadocs += ['misc-utils/lsfd.1.adoc']
2582 include_directories : includes,
2583 link_with : [lib_uuid],
2584 install_dir : usrbin_exec_dir,
2586 if not is_disabler(exe)
2588 manadocs += ['misc-utils/uuidgen.1.adoc']
2589 bashcompletions += ['uuidgen']
2595 include_directories : includes,
2596 link_with : [lib_common,
2599 install_dir : usrbin_exec_dir,
2601 if not is_disabler(exe)
2603 manadocs += ['misc-utils/uuidparse.1.adoc']
2604 bashcompletions += ['uuidparse']
2611 include_directories : includes,
2612 link_with : [lib_common,
2614 dependencies : [realtime_libs,
2616 install_dir : usrsbin_exec_dir,
2618 build_by_default : opt)
2622 include_directories : includes,
2623 link_with : [lib_common,
2625 dependencies : thread_libs,
2626 build_by_default : opt)
2627 if not is_disabler(exe)
2629 manadocs += ['misc-utils/uuidd.8.adoc']
2630 bashcompletions += ['uuidd']
2633 opt = build_libblkid
2637 include_directories : includes,
2638 link_with : [lib_common,
2640 install_dir : sbindir,
2642 build_by_default : opt)
2643 if opt and not is_disabler(exe)
2645 manadocs += ['misc-utils/blkid.8.adoc']
2646 bashcompletions += ['blkid']
2649 opt = opt and 'blkid' in static_programs
2653 include_directories : includes,
2654 link_with : [lib_common,
2656 install_dir : sbindir,
2658 build_by_default : opt)
2659 if opt and not is_disabler(exe)
2665 'libblkid/samples/mkfs.c',
2666 include_directories : includes,
2667 link_with : lib_blkid)
2668 if not is_disabler(exe)
2673 'sample-partitions',
2674 'libblkid/samples/partitions.c',
2675 include_directories : includes,
2676 link_with : lib_blkid)
2677 if not is_disabler(exe)
2682 'sample-superblocks',
2683 'libblkid/samples/superblocks.c',
2684 include_directories : includes,
2685 link_with : lib_blkid)
2686 if not is_disabler(exe)
2692 'libblkid/samples/topology.c',
2693 include_directories : includes,
2694 link_with : lib_blkid)
2695 if not is_disabler(exe)
2700 'test_blkid_fuzz_sample',
2701 'libblkid/src/fuzz.c',
2702 include_directories: includes,
2703 link_with: lib_blkid)
2704 if not is_disabler(exe)
2708 ############################################################
2713 include_directories : includes,
2714 link_with : [lib_blkid],
2715 install_dir : sbindir,
2717 if not is_disabler(exe)
2719 manadocs += ['misc-utils/findfs.8.adoc']
2720 bashcompletions += ['findfs']
2726 include_directories : includes,
2727 link_with : [lib_common,
2730 install_dir : sbindir,
2732 if not is_disabler(exe)
2734 manadocs += ['misc-utils/wipefs.8.adoc']
2735 bashcompletions += ['wipefs']
2741 include_directories : includes,
2742 link_with : [lib_common,
2746 dependencies : [lib_udev],
2748 if not is_disabler(exe)
2750 manadocs += ['misc-utils/findmnt.8.adoc']
2751 bashcompletions += ['findmnt']
2757 include_directories : includes,
2758 link_with : [lib_common],
2760 if not is_disabler(exe)
2762 manadocs += ['misc-utils/kill.1.adoc']
2765 opt = not get_option('build-rename').disabled()
2769 include_directories : includes,
2770 install_dir : usrbin_exec_dir,
2772 build_by_default : opt)
2773 if opt and not is_disabler(exe)
2775 manadocs += ['misc-utils/rename.1.adoc']
2776 bashcompletions += ['rename']
2782 include_directories : includes,
2783 link_with : [lib_common],
2784 install_dir : usrbin_exec_dir,
2787 manadocs += ['misc-utils/getopt.1.adoc']
2788 bashcompletions += ['getopt']
2793 include_directories : includes,
2794 link_with : [lib_common,
2796 install_dir : usrbin_exec_dir,
2798 if not is_disabler(exe)
2800 manadocs += ['misc-utils/fincore.1.adoc']
2801 bashcompletions += ['fincore']
2807 include_directories : includes,
2808 link_with : [lib_common],
2809 install_dir : usrbin_exec_dir,
2811 if not is_disabler(exe)
2813 manadocs += ['misc-utils/hardlink.1.adoc']
2814 bashcompletions += ['hardlink']
2817 opt = not get_option('build-pipesz').disabled()
2821 include_directories : includes,
2822 link_with : [lib_common],
2823 install_dir : usrbin_exec_dir,
2825 if opt and not is_disabler(exe)
2827 manadocs += ['misc-utils/pipesz.1.adoc']
2828 bashcompletions += ['pipesz']
2834 include_directories : includes,
2835 c_args : '-DTEST_CAL',
2836 link_with : [lib_common,
2838 dependencies : [curses_libs])
2839 if not is_disabler(exe)
2846 include_directories : includes,
2847 link_with : [lib_common],
2848 install_dir : usrbin_exec_dir,
2850 if not is_disabler(exe)
2852 manadocs += ['misc-utils/fadvise.1.adoc']
2853 bashcompletions += ['fadvise']
2856 # XXX: HAVE_PIDFD_OPEN
2860 include_directories : includes,
2861 link_with : [lib_common],
2862 install_dir : usrbin_exec_dir,
2864 if not is_disabler(exe)
2866 manadocs += ['misc-utils/waitpid.1.adoc']
2867 bashcompletions += ['waitpid']
2870 syscalls_h = custom_target('syscalls.h',
2871 input : 'tools/all_syscalls',
2872 output : 'syscalls.h',
2873 command : ['bash', '@INPUT@', cc.cmd_array()],
2876 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
2879 'misc-utils/enosys.c', syscalls_h,
2880 include_directories : includes,
2881 link_with : [lib_common],
2882 install_dir : usrbin_exec_dir,
2884 if not is_disabler(exe)
2886 manadocs += ['misc-utils/enosys.1.adoc']
2887 bashcompletions += ['enosys']
2891 ############################################################
2893 opt = not get_option('build-schedutils').disabled()
2896 'schedutils/chrt.c',
2897 include_directories : includes,
2898 link_with : lib_common,
2899 install_dir : usrbin_exec_dir,
2901 build_by_default : opt)
2905 'schedutils/ionice.c',
2906 include_directories : includes,
2907 link_with : lib_common,
2908 install_dir : usrbin_exec_dir,
2910 build_by_default : opt)
2914 'schedutils/taskset.c',
2915 include_directories : includes,
2916 link_with : lib_common,
2917 install_dir : usrbin_exec_dir,
2919 build_by_default : opt)
2923 'schedutils/uclampset.c',
2924 include_directories : includes,
2925 link_with : lib_common,
2926 install_dir : usrbin_exec_dir,
2928 build_by_default : opt)
2930 if opt and not is_disabler(exe)
2931 exes += [exe, exe2, exe3, exe4]
2932 manadocs += ['schedutils/chrt.1.adoc',
2933 'schedutils/ionice.1.adoc',
2934 'schedutils/taskset.1.adoc',
2935 'schedutils/uclampset.1.adoc']
2936 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2939 ############################################################
2941 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2946 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2947 include_directories : dir_include,
2948 link_with : lib_common)
2954 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2955 include_directories : dir_include,
2956 link_with : lib_common)
2962 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2963 include_directories : dir_include,
2964 link_with : lib_common)
2970 c_args : ['-DTEST_PROGRAM_MANGLE'],
2971 include_directories : dir_include)
2977 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2978 include_directories : dir_include)
2984 'lib/color-names.c',
2985 c_args : ['-DTEST_PROGRAM_COLORS'],
2986 include_directories : dir_include,
2987 link_with : [lib_common, lib_tcolors])
2993 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2994 include_directories : dir_include)
2997 # XXX: HAVE_OPENAT && HAVE_DIRFD
3001 c_args : ['-DTEST_PROGRAM_PROCFS'],
3002 include_directories : dir_include,
3003 link_with : lib_common)
3006 # XXX: HAVE_OPENAT && HAVE_DIRFD
3011 have_cpu_set_t ? 'lib/cpuset.c' : [],
3012 c_args : ['-DTEST_PROGRAM_PATH'],
3013 include_directories : dir_include,
3014 link_with : lib_common)
3022 c_args : ['-DTEST_PROGRAM_PTY'],
3023 include_directories : dir_include,
3024 link_with : [lib_common],
3025 dependencies : [lib_m,
3034 c_args : ['-DTEST_PROGRAM_CPUSET'],
3035 include_directories : dir_include)
3045 have_cpu_set_t ? 'lib/cpuset.c' : [],
3046 c_args : ['-DTEST_PROGRAM_SYSFS'],
3047 include_directories : dir_include)
3053 c_args : ['-DTEST_PROGRAM_PAGER'],
3054 include_directories : dir_include)
3058 'test_linux_version',
3059 'lib/linux_version.c',
3060 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3061 include_directories : dir_include)
3067 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3068 include_directories : dir_include)
3072 'test_canonicalize',
3073 'lib/canonicalize.c',
3074 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3075 include_directories : dir_include)
3082 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3083 include_directories : dir_include)
3089 c_args : ['-DTEST_PROGRAM'],
3090 include_directories : dir_include,
3091 link_with : lib_common)
3097 c_args : ['-DTEST_PROGRAM'],
3098 include_directories : dir_include,
3099 link_with : [lib_common, logindefs_c])
3103 ############################################################
3107 'libuuid/src/test_uuid.c',
3108 include_directories : [dir_include, dir_libuuid],
3109 link_with : lib_uuid,
3110 dependencies : socket_libs)
3111 if not is_disabler(exe)
3115 ############################################################
3117 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3119 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3123 'libfdisk/src/ask.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)
3133 'libfdisk/src/gpt.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)
3143 'libfdisk/src/utils.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)
3152 'test_fdisk_script',
3153 'libfdisk/src/script.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)
3162 'test_fdisk_version',
3163 'libfdisk/src/version.c',
3164 c_args : libfdisk_tests_cflags,
3165 include_directories : lib_fdisk_includes,
3166 link_with : libfdisk_tests_ldadd)
3167 if not is_disabler(exe)
3173 'libfdisk/src/item.c',
3174 c_args : libfdisk_tests_cflags,
3175 include_directories : lib_fdisk_includes,
3176 link_with : libfdisk_tests_ldadd)
3177 if not is_disabler(exe)
3181 sample_fdisk_cflags = ['-Wno-unused']
3182 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3185 'sample-fdisk-mkpart',
3186 'libfdisk/samples/mkpart.c',
3187 c_args : sample_fdisk_cflags,
3188 include_directories : lib_fdisk_includes,
3189 link_with : sample_fdisk_ldadd)
3190 if not is_disabler(exe)
3195 'sample-fdisk-mkpart-fullspec',
3196 'libfdisk/samples/mkpart-fullspec.c',
3197 c_args : sample_fdisk_cflags,
3198 include_directories : lib_fdisk_includes,
3199 link_with : sample_fdisk_ldadd)
3200 if not is_disabler(exe)
3204 ############################################################
3208 'tests/helpers/test_mbsencode.c',
3209 include_directories : includes,
3210 link_with : lib_common)
3215 'tests/helpers/test_byteswap.c',
3216 include_directories : includes)
3221 'tests/helpers/test_md5.c',
3223 include_directories : includes)
3228 'tests/helpers/test_sha1.c',
3230 include_directories : includes)
3235 'tests/helpers/test_pathnames.c',
3236 include_directories : includes)
3241 'tests/helpers/test_strerror.c',
3242 include_directories : includes)
3247 'tests/helpers/test_sysinfo.c',
3248 include_directories : includes)
3253 'tests/helpers/test_sigreceive.c',
3254 include_directories : includes,
3255 link_with : lib_common)
3260 'tests/helpers/test_tiocsti.c',
3261 include_directories : includes)
3265 'test_uuid_namespace',
3266 'tests/helpers/test_uuid_namespace.c',
3270 include_directories : includes)
3274 mq_libs += cc.find_library('rt', required : true)
3278 'tests/helpers/test_mkfds.c',
3279 include_directories : includes,
3280 dependencies : mq_libs)
3285 'tests/helpers/test_enosys.c',
3286 include_directories : includes)
3289 ############################################################
3293 'sample-scols-tree',
3294 'libsmartcols/samples/tree.c',
3295 include_directories : includes,
3296 link_with : [lib_smartcols, lib_common])
3297 if not is_disabler(exe)
3302 'sample-scols-title',
3303 'libsmartcols/samples/title.c',
3304 include_directories : includes,
3305 link_with : [lib_smartcols, lib_common])
3306 if not is_disabler(exe)
3311 'sample-scols-wrap',
3312 'libsmartcols/samples/wrap.c',
3313 include_directories : includes,
3314 link_with : [lib_smartcols, lib_common])
3315 if not is_disabler(exe)
3320 'sample-scols-continuous',
3321 'libsmartcols/samples/continuous.c',
3322 include_directories : includes,
3323 link_with : [lib_smartcols, lib_common])
3324 if not is_disabler(exe)
3329 'sample-scols-maxout',
3330 'libsmartcols/samples/maxout.c',
3331 include_directories : includes,
3332 link_with : [lib_smartcols, lib_common])
3333 if not is_disabler(exe)
3338 'sample-scols-fromfile',
3339 'libsmartcols/samples/fromfile.c',
3340 include_directories : includes,
3341 link_with : [lib_smartcols, lib_common])
3342 if not is_disabler(exe)
3347 'sample-scols-grouping-simple',
3348 'libsmartcols/samples/grouping-simple.c',
3349 include_directories : includes,
3350 link_with : [lib_smartcols, lib_common])
3351 if not is_disabler(exe)
3356 'sample-scols-grouping-overlay',
3357 'libsmartcols/samples/grouping-overlay.c',
3358 include_directories : includes,
3359 link_with : [lib_smartcols, lib_common])
3360 if not is_disabler(exe)
3364 ############################################################
3366 # Let the test runner know whether we're running under asan and export
3367 # some paths. We use a file on disk so that it is possible to run the
3368 # test scripts from commandline without setting any variables.
3369 configure_file(output : 'meson.conf',
3374 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3375 python.full_path())])
3377 run_sh = find_program('tests/run.sh')
3381 '--srcdir=' + meson.current_source_dir(),
3382 '--builddir=' + meson.current_build_dir(),
3388 manadocs += ['lib/terminal-colors.d.5.adoc']
3389 manadocs += ['libblkid/libblkid.3.adoc']
3393 'libuuid/man/uuid.3.adoc',
3394 'libuuid/man/uuid_clear.3.adoc',
3395 'libuuid/man/uuid_compare.3.adoc',
3396 'libuuid/man/uuid_copy.3.adoc',
3397 'libuuid/man/uuid_generate.3.adoc',
3398 'libuuid/man/uuid_is_null.3.adoc',
3399 'libuuid/man/uuid_parse.3.adoc',
3400 'libuuid/man/uuid_time.3.adoc',
3401 'libuuid/man/uuid_unparse.3.adoc']
3403 'uuid_generate_random.3': 'uuid_generate.3',
3404 'uuid_generate_time.3': 'uuid_generate.3',
3405 'uuid_generate_time_safe.3': 'uuid_generate.3',
3409 asciidoctor = find_program('asciidoctor', required : false)
3410 if asciidoctor.found()
3411 foreach adoc : manadocs
3412 name = adoc.split('/')[-1]
3413 page = name.split('.adoc')[0]
3414 section = page.split('.')[-1]
3415 mandirn = join_paths(mandir, 'man' + section)
3420 command : [ asciidoctor,
3422 '-a', 'VERSION=' + meson.project_version(),
3423 '-a', 'release-version=' + meson.project_version(),
3424 '-a', 'ADJTIME_PATH=/etc/adjtime',
3425 '-a', 'package-docdir=' + docdir,
3426 '--base-dir=' + meson.current_source_dir(),
3427 '--destination-dir=' + meson.current_build_dir(),
3428 '--load-path', '@SOURCE_ROOT@/tools',
3429 '--require', 'asciidoctor-includetracker',
3433 depfile : page + '.deps',
3435 install_dir : mandirn)
3438 foreach link_name, target : manlinks
3439 link_section = link_name.split('.')[-1]
3440 target_section = target.split('.')[-1]
3441 meson.add_install_script(meson_make_manpage_stub,
3442 join_paths('man' + target_section, target),
3443 join_paths(mandir, 'man' + link_section, link_name))
3447 if bash_completion.found()
3448 foreach completion : bashcompletions
3450 join_paths('bash-completion', completion),
3451 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3454 foreach link_name, target : bashcompletionslinks
3455 meson.add_install_script(meson_make_symlink,
3457 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))