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)
45 pc_version = meson.project_version().split('-')[0].split('.')
47 if pc_version.length() < 3
51 pc_version = '.'.join(pc_version)
53 conf.set_quoted('LIBBLKID_VERSION', libblkid_version)
54 conf.set_quoted('LIBBLKID_DATE', libblkid_date)
56 conf.set('bindir', bindir)
57 conf.set('sbindir', sbindir)
58 conf.set('runstatedir', runstatedir)
59 conf.set('sysconfdir', sysconfdir)
60 conf.set('usrsbin_execdir', usrsbin_exec_dir)
61 conf.set('docdir', docdir)
62 conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir)
63 conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir)
64 conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime')
65 conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :(
67 conf.set_quoted('_PATH_VENDORDIR', vendordir)
68 conf.set('USE_VENDORDIR', vendordir == '' ? false : 1)
70 build_libblkid = not get_option('build-libblkid').disabled()
71 conf.set('HAVE_LIBBLKID', build_libblkid ? 1 : false)
72 summary('libblkid', build_libblkid ? 'enabled' : 'disabled', section : 'components')
74 build_libuuid = not get_option('build-libuuid').disabled()
75 conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false)
76 summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components')
78 have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
79 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
80 conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
82 have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0
83 conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 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 have = cc.has_function(
323 'sd_session_get_username',
324 dependencies : lib_systemd)
325 conf.set('HAVE_DECL_SD_SESSION_GET_USERNAME', have ? 1 : false)
327 lib_udev = dependency(
329 required : get_option('systemd'))
330 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
332 lib_crypt = cc.find_library('crypt')
334 lib_pam = cc.find_library('pam', required : get_option('build-login'))
335 if not lib_pam.found()
336 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
338 if not lib_pam.found()
339 lib_pam = cc.find_library('pam', required : get_option('build-su'))
341 if not lib_pam.found()
342 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
345 lib_pam_misc = cc.find_library('pam_misc')
346 lib_pam = [lib_pam, lib_pam_misc]
348 lib_pam_misc = declare_dependency()
351 lib_cryptsetup = dependency(
353 required : get_option('cryptsetup'))
354 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
356 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
357 if meson.version().version_compare('>= 0.62.0')
358 lib_dl = dependency('dl')
360 lib_dl = cc.find_library('dl')
362 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
363 summary('cryptsetup support (dlopen)',
365 section : 'components')
367 summary('cryptsetup support',
368 lib_cryptsetup.found() ? 'enabled' : 'disabled',
369 section : 'components')
372 have = cc.has_function(
373 'crypt_activate_by_signed_key',
374 dependencies : lib_cryptsetup)
375 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
377 lib_cap_ng = dependency(
379 required : get_option('build-setpriv'))
381 lib_selinux = dependency(
384 required : get_option('selinux'))
385 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
387 lib_magic = dependency(
389 required : get_option('magic'))
390 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
392 lib_econf = dependency(
394 required : get_option('econf'))
395 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
397 lib_audit = dependency(
399 required : get_option('audit'))
400 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
402 conf.set('HAVE_SMACK', not get_option('smack').disabled())
404 foreach header : headers
405 have = cc.has_header(header)
406 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
409 header = 'linux/btrfs.h'
410 enable_btrfs = cc.has_header(header,
411 required : get_option('btrfs'))
412 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
413 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
415 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
420 have = cc.has_header(header,
422 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
425 have = cc.has_header('sched.h')
426 conf.set10('HAVE_DECL_CPU_ALLOC', have)
427 # We get -1 if the size cannot be determined
428 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
429 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
431 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
432 conf.set10('HAVE_ENVIRON_DECL', have)
434 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
435 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
437 have = cc.has_function('strsignal')
438 conf.set10('HAVE_STRSIGNAL_DECL', have)
440 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
441 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
443 have = cc.has_type('loff_t', prefix : '#include <sys/types.h>')
444 conf.set('HAVE_LOFF_T', have ? 1 : false)
446 have = cc.compiles('''
447 #define _GNU_SOURCE 1
448 #include <langinfo.h>
451 str = nl_langinfo (ALTMON_1);
452 str = nl_langinfo (ALTMON_2);
453 str = nl_langinfo (ALTMON_3);
454 str = nl_langinfo (ALTMON_4);
455 str = nl_langinfo (ALTMON_5);
456 str = nl_langinfo (ALTMON_6);
457 str = nl_langinfo (ALTMON_7);
458 str = nl_langinfo (ALTMON_8);
459 str = nl_langinfo (ALTMON_9);
460 str = nl_langinfo (ALTMON_10);
461 str = nl_langinfo (ALTMON_11);
462 str = nl_langinfo (ALTMON_12);
466 name : 'langinfo.h defines ALTMON_x constants')
467 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
469 have = cc.compiles('''
470 #define _GNU_SOURCE 1
471 #include <langinfo.h>
474 str = nl_langinfo (_NL_ABALTMON_1);
475 str = nl_langinfo (_NL_ABALTMON_2);
476 str = nl_langinfo (_NL_ABALTMON_3);
477 str = nl_langinfo (_NL_ABALTMON_4);
478 str = nl_langinfo (_NL_ABALTMON_5);
479 str = nl_langinfo (_NL_ABALTMON_6);
480 str = nl_langinfo (_NL_ABALTMON_7);
481 str = nl_langinfo (_NL_ABALTMON_8);
482 str = nl_langinfo (_NL_ABALTMON_9);
483 str = nl_langinfo (_NL_ABALTMON_10);
484 str = nl_langinfo (_NL_ABALTMON_11);
485 str = nl_langinfo (_NL_ABALTMON_12);
489 name : 'langinfo.h defines _NL_ABALTMON_x constants')
490 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
492 have = cc.compiles('''
493 #define _GNU_SOURCE 1
494 #include <langinfo.h>
497 str = nl_langinfo (_NL_TIME_WEEK_1STDAY);
501 name : 'langinfo.h defines _NL_TIME_WEEK_1STDAY constant')
502 conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false)
596 have = cc.has_function(func)
597 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
598 # This makes little sense, but is necessary to avoid warnings about
599 # redefined macros from Python.h, which uses this convention.
600 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
603 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
604 conf.set('AGETTY_RELOAD', have ? 1 : false)
606 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
609 have_dirfd = (cc.has_function('dirfd') or
610 cc.has_header_symbol('dirent.h', 'dirfd',
611 prefix : '#include <sys/types.h>'))
612 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
614 have_ddfd = cc.has_member('DIR', 'dd_fd',
616 #include <sys/types.h>
619 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
621 have = cc.has_member('struct tm', 'tm_gmtoff',
626 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
630 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
631 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
633 have = cc.has_member('struct termios', 'c_line',
634 prefix : '#include <termios.h>')
635 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
637 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
638 prefix : '#include <sys/stat.h>')
639 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
641 have = cc.has_member('struct statx', 'stx_mnt_id',
642 prefix : '#include <sys/stat.h>')
643 conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false)
645 # replacement for AC_STRUCT_TIMEZONE
646 have = cc.has_member('struct tm', 'tm_zone',
647 prefix : '#include <time.h>')
648 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
650 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
651 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
653 have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY')
654 conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false)
656 have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY')
657 conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false)
662 extern char *tzname[];
665 return tzname ? 0 : 1;
667 '''.format(have ? 1 : 0)
668 have = cc.compiles(code, name : 'using tzname[]')
669 conf.set('HAVE_TZNAME', have ? 1 : false)
672 if not cc.has_function('socket')
673 socket_libs += cc.find_library('socket', required : true)
674 have = cc.has_function('socket',
675 dependencies : socket_libs)
677 error('socket() function not available')
682 have = cc.has_function('clock_gettime')
684 realtime_libs += cc.find_library('rt', required : true)
685 have = cc.has_function('clock_gettime',
686 dependencies : realtime_libs)
688 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
690 thread_libs = dependency('threads')
692 have = cc.has_function('timer_create')
694 realtime_libs = [cc.find_library('rt', required : true)]
695 have = cc.has_function('timer_create',
696 dependencies : realtime_libs)
698 realtime_libs += thread_libs
699 have = cc.has_function('timer_create',
700 dependencies : realtime_libs)
703 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
705 have = cc.has_function('setitimer')
706 conf.set('HAVE_SETITIMER', have ? 1 : false)
709 rtas_libs = cc.find_library('rtas', required : false)
710 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
713 if not cc.has_header_symbol('math.h', 'isnan')
714 lib = cc.find_library('m', required : true)
715 if (cc.has_function('isnan', dependencies : lib) and
716 cc.has_function('__isnan', dependencies : lib))
721 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
722 args : '-D_GNU_SOURCE')
723 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
726 extern char *__progname;
728 return (*__progname != 0);
731 have = cc.compiles(code, name : 'using __progname')
732 conf.set('HAVE___PROGNAME', have ? 1 : false)
734 have = conf.get('HAVE_PTY_H') != false and conf.get('HAVE_SYS_SIGNALFD_H') != false
735 conf.set('HAVE_PTY', have ? 1 : false)
737 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
738 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
740 build_plymouth_support = get_option('build-plymouth-support')
741 have_tiocglcktrmios = cc.has_header_symbol(
742 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
743 required : build_plymouth_support.enabled())
744 have_sock_cloexec = cc.has_header_symbol(
745 'sys/socket.h', 'SOCK_CLOEXEC',
746 prefix : '#include <sys/types.h>',
747 required : build_plymouth_support.enabled())
748 have_sock_nonblock = cc.has_header_symbol(
749 'sys/socket.h', 'SOCK_NONBLOCK',
750 prefix : '#include <sys/types.h>',
751 required : build_plymouth_support.enabled())
752 have_so_passcred = cc.has_header_symbol(
753 'sys/socket.h', 'SO_PASSCRED',
754 prefix : '#include <sys/types.h>',
755 required : build_plymouth_support.enabled())
757 build_plymouth_support = (not build_plymouth_support.disabled() and
758 have_tiocglcktrmios and
759 have_sock_cloexec and
760 have_sock_nonblock and
762 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
763 summary('plymouth support',
764 build_plymouth_support ? 'enabled' : 'disabled',
765 section : 'components')
767 # check for valid fallocate() function
768 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
769 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
770 # and program can't be linked.
778 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
779 return ret == 0 ? 0 : 1;
782 have = cc.links(code, name : 'fallocate() function')
783 conf.set('HAVE_FALLOCATE', have ? 1 : false)
791 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
792 return ret == 0 ? 0 : 1;
795 have = cc.links(code, name : 'posix_fallocate() function')
796 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
798 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
799 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
800 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
802 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
803 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
804 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
806 is_glibc = cc.has_header_symbol('limits.h', '__GLIBC__')
808 ############################################################
811 fs_search_path = get_option('fs-search-path')
812 fs_search_path_extra = get_option('fs-search-path-extra')
813 if fs_search_path_extra != ''
814 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
816 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
818 systemdsystemunitdir = ''
820 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
823 sysvinit = get_option('sysvinit').enabled()
824 sysvinitrcdir = sysconfdir + '/init.d'
826 program_tests = get_option('program-tests')
828 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
829 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
831 have = get_option('chsh-only-listed')
832 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
834 have = get_option('use-tty-group')
835 conf.set('USE_TTY_GROUP', have ? 1 : false)
837 build_hwclock = not get_option('build-hwclock').disabled()
838 bison = find_program('bison', required: build_hwclock)
839 bison_gen = generator(
841 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
842 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
846 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
847 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
851 configuration : conf)
853 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
858 '-Waddress-of-packed-member',
859 '-Wdiscarded-qualifiers',
860 '-Wembedded-directive',
863 '-Wimplicit-function-declaration',
864 '-Wmissing-declarations',
865 '-Wmissing-parameter-type',
866 '-Wmissing-prototypes',
868 '-Wno-missing-field-initializers',
869 '-Wold-style-definition',
873 '-Wstrict-prototypes',
876 '-Wunused-but-set-parameter',
877 '-Wunused-but-set-variable',
878 '-Wunused-parameter',
884 foreach compiler_flag : compiler_flags
885 if cc.has_argument(compiler_flag)
886 add_project_arguments(compiler_flag, language : 'c')
894 bashcompletionslinks = {}
900 subdir('libsmartcols')
903 subdir('login-utils')
911 includes = [dir_include,
921 opt = not get_option('build-chfn-chsh').disabled()
926 include_directories : includes,
927 link_with : [lib_common, logindefs_c],
928 dependencies : chfn_chsh_deps,
929 install_dir : usrbin_exec_dir,
930 install_mode : 'rwsr-xr-x',
932 build_by_default : opt)
936 'login-utils/chsh.c',
939 include_directories : includes,
940 link_with : lib_common,
941 dependencies : chfn_chsh_deps,
942 install_dir : usrbin_exec_dir,
943 install_mode : 'rwsr-xr-x',
945 build_by_default : opt)
946 if opt and not is_disabler(exe)
948 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
949 bashcompletions += ['chfn', 'chsh']
954 test_islocal_sources,
955 include_directories : includes,
956 c_args : '-DTEST_PROGRAM',
957 build_by_default : program_tests)
962 test_consoles_sources,
963 c_args : ['-DTEST_PROGRAM'],
964 include_directories : includes,
965 link_with : lib_common,
966 build_by_default : program_tests)
969 opt = not get_option('build-last').disabled()
973 include_directories : includes,
974 link_with : [lib_common],
975 install_dir : usrbin_exec_dir,
977 build_by_default : opt)
978 if opt and not is_disabler(exe)
980 meson.add_install_script(meson_make_symlink,
982 join_paths(usrbin_exec_dir, 'lastb'))
983 manadocs += ['login-utils/last.1.adoc']
984 manlinks += {'lastb.1': 'last.1'}
985 bashcompletions += ['last']
986 bashcompletionslinks += {'lastb': 'last'}
989 opt = not get_option('build-nologin').disabled()
992 'login-utils/nologin.c',
993 include_directories : includes,
994 install_dir : sbindir,
995 link_with : [lib_common],
997 build_by_default : opt)
998 if opt and not is_disabler(exe)
1000 manadocs += ['login-utils/nologin.8.adoc']
1003 opt = not get_option('build-utmpdump').disabled()
1006 'login-utils/utmpdump.c',
1007 include_directories : includes,
1008 link_with : [lib_common],
1009 install_dir : usrbin_exec_dir,
1011 build_by_default : opt)
1012 if opt and not is_disabler(exe)
1014 manadocs += ['login-utils/utmpdump.1.adoc']
1015 bashcompletions += ['utmpdump']
1018 opt = not get_option('build-su').disabled()
1022 'login-utils/su-common.c',
1023 'login-utils/su-common.h',
1027 include_directories : includes,
1028 link_with : [lib_common, logindefs_c],
1029 dependencies : [lib_pam,
1033 install_mode : 'rwsr-xr-x',
1035 build_by_default : opt)
1036 if opt and not is_disabler(exe)
1038 manadocs += ['login-utils/su.1.adoc']
1039 bashcompletions += ['su']
1042 opt = not get_option('build-newgrp').disabled()
1045 'login-utils/newgrp.c',
1046 include_directories : includes,
1047 dependencies : [lib_crypt],
1048 install_dir : usrbin_exec_dir,
1049 install_mode : 'rwsr-xr-x',
1051 build_by_default : opt)
1052 if opt and not is_disabler(exe)
1054 manadocs += ['login-utils/newgrp.1.adoc']
1055 bashcompletions += ['newgrp']
1058 opt = not get_option('build-lslogins').disabled()
1061 'login-utils/lslogins.c',
1062 include_directories : includes,
1063 link_with : [lib_common,
1066 dependencies : [lib_selinux,
1068 install_dir : usrbin_exec_dir,
1070 build_by_default : opt)
1071 if opt and not is_disabler(exe)
1073 manadocs += ['login-utils/lslogins.1.adoc']
1074 bashcompletions += ['lslogins']
1077 opt = not get_option('build-vipw').disabled()
1080 'login-utils/vipw.c',
1081 'login-utils/setpwnam.h',
1082 include_directories : includes,
1083 link_with : [lib_common],
1084 dependencies : [lib_selinux],
1085 install_dir : usrbin_exec_dir,
1087 build_by_default : opt)
1088 if opt and not is_disabler(exe)
1090 meson.add_install_script(meson_make_symlink,
1092 join_paths(usrbin_exec_dir, 'vigr'))
1093 manadocs += ['login-utils/vipw.8.adoc']
1094 meson.add_install_script(meson_make_symlink,
1096 join_paths(mandir, 'man8/vigr.8'))
1099 opt = not get_option('build-runuser').disabled()
1102 'login-utils/runuser.c',
1103 'login-utils/su-common.c',
1104 'login-utils/su-common.h',
1108 include_directories : includes,
1109 link_with : [lib_common, logindefs_c],
1110 dependencies : [lib_pam,
1114 install_dir : sbindir,
1116 build_by_default : opt)
1117 if opt and not is_disabler(exe)
1119 manadocs += ['login-utils/runuser.1.adoc']
1120 bashcompletionslinks += {'runuser': 'su'}
1123 ############################################################
1129 include_directories : includes,
1130 link_with : lib_common,
1131 install_dir : usrbin_exec_dir,
1134 manadocs += ['text-utils/col.1.adoc']
1135 bashcompletions += ['col']
1141 include_directories : includes,
1142 install_dir : usrbin_exec_dir,
1145 manadocs += ['text-utils/colcrt.1.adoc']
1146 bashcompletions += ['colcrt']
1151 include_directories : includes,
1152 link_with : lib_common,
1153 install_dir : usrbin_exec_dir,
1156 manadocs += ['text-utils/colrm.1.adoc']
1157 bashcompletions += ['colrm']
1162 include_directories : includes,
1163 install_dir : usrbin_exec_dir,
1166 manadocs += ['text-utils/rev.1.adoc']
1167 bashcompletions += ['rev']
1172 include_directories : includes,
1173 link_with : [lib_common,
1175 install_dir : usrbin_exec_dir,
1177 if not is_disabler(exe)
1179 manadocs += ['text-utils/column.1.adoc']
1180 bashcompletions += ['column']
1183 opt = not get_option('build-line').disabled()
1187 include_directories : includes,
1188 install_dir : usrbin_exec_dir,
1190 build_by_default : opt)
1191 if opt and not is_disabler(exe)
1193 manadocs += ['text-utils/line.1.adoc']
1196 opt = not get_option('build-pg').disabled()
1200 link_with : lib_common,
1201 include_directories : includes,
1202 dependencies : [lib_tinfo,
1204 install_dir : usrbin_exec_dir,
1206 build_by_default : opt)
1207 if opt and not is_disabler(exe)
1209 manadocs += ['text-utils/pg.1.adoc']
1210 bashcompletions += ['pg']
1213 opt = not get_option('build-ul').disabled()
1217 include_directories : includes,
1218 dependencies : [lib_tinfo,
1220 install_dir : usrbin_exec_dir,
1222 build_by_default : opt)
1223 if opt and not is_disabler(exe)
1225 manadocs += ['text-utils/ul.1.adoc']
1226 bashcompletions += ['ul']
1229 opt = not get_option('build-more').disabled()
1233 link_with : [lib_common],
1234 include_directories : includes,
1235 dependencies : [lib_tinfo,
1239 build_by_default : opt)
1243 link_with : [lib_common],
1244 include_directories : includes,
1245 c_args : '-DTEST_PROGRAM',
1246 dependencies : [lib_tinfo,
1249 build_by_default : opt and program_tests)
1251 if opt and not is_disabler(exe)
1253 manadocs += ['text-utils/more.1.adoc']
1254 bashcompletions += ['more']
1260 include_directories : includes,
1261 link_with : [lib_common,
1263 install_dir : usrbin_exec_dir,
1265 if not is_disabler(exe)
1267 manadocs += ['text-utils/hexdump.1.adoc']
1268 bashcompletions += ['hexdump']
1271 opt = not get_option('build-lsmem').disabled()
1275 include_directories : includes,
1276 link_with : [lib_common,
1278 install_dir : usrbin_exec_dir,
1280 build_by_default : opt)
1281 if opt and not is_disabler(exe)
1283 manadocs += ['sys-utils/lsmem.1.adoc']
1284 bashcompletions += ['lsmem']
1287 opt = not get_option('build-chmem').disabled()
1291 include_directories : includes,
1292 link_with : [lib_common],
1293 install_dir : usrbin_exec_dir,
1295 build_by_default : opt)
1296 if opt and not is_disabler(exe)
1298 manadocs += ['sys-utils/chmem.8.adoc']
1299 bashcompletions += ['chmem']
1305 include_directories : includes,
1306 link_with : [lib_common],
1307 install_dir : usrbin_exec_dir,
1310 manadocs += ['sys-utils/choom.1.adoc']
1315 include_directories : includes,
1316 link_with : [lib_common],
1317 install_dir : usrbin_exec_dir,
1320 manadocs += ['sys-utils/ipcmk.1.adoc']
1321 bashcompletions += ['ipcmk']
1326 include_directories : includes,
1327 link_with : [lib_common],
1328 install_dir : usrbin_exec_dir,
1331 manadocs += ['sys-utils/ipcrm.1.adoc']
1332 bashcompletions += ['ipcrm']
1334 opt = not get_option('build-ipcs').disabled()
1338 include_directories : includes,
1339 link_with : [lib_common],
1340 install_dir : usrbin_exec_dir,
1342 build_by_default : opt)
1343 if opt and not is_disabler(exe)
1345 manadocs += ['sys-utils/ipcs.1.adoc']
1346 bashcompletions += ['ipcs']
1349 opt = not get_option('build-rfkill').disabled()
1353 include_directories : includes,
1354 link_with : [lib_common,
1356 install_dir : usrsbin_exec_dir,
1358 build_by_default : opt)
1359 if opt and not is_disabler(exe)
1361 manadocs += ['sys-utils/rfkill.8.adoc']
1362 bashcompletions += ['rfkill']
1368 include_directories : includes,
1369 link_with : [lib_common,
1371 install_dir : usrbin_exec_dir,
1373 if not is_disabler(exe)
1375 manadocs += ['sys-utils/renice.1.adoc']
1376 bashcompletions += ['renice']
1382 include_directories: includes,
1383 link_with : [lib_common,
1385 install_dir : usrbin_exec_dir,
1387 if opt and not is_disabler(exe)
1389 manadocs += ['sys-utils/setpgid.1.adoc']
1390 bashcompletions += ['setpgid']
1396 include_directories : includes,
1397 link_with : [lib_common,
1399 install_dir : usrbin_exec_dir,
1401 if opt and not is_disabler(exe)
1403 manadocs += ['sys-utils/setsid.1.adoc']
1404 bashcompletions += ['setsid']
1409 readprofile_sources,
1410 include_directories : includes,
1411 link_with : [lib_common,
1413 install_dir : usrsbin_exec_dir,
1415 if not is_disabler(exe)
1417 manadocs += ['sys-utils/readprofile.8.adoc']
1418 bashcompletions += ['readprofile']
1421 opt = not get_option('build-tunelp').disabled()
1425 include_directories : includes,
1426 link_with : [lib_common],
1427 install_dir : usrsbin_exec_dir,
1429 build_by_default : opt)
1430 if opt and not is_disabler(exe)
1432 manadocs += ['sys-utils/tunelp.8.adoc']
1433 bashcompletions += ['tunelp']
1439 include_directories : includes,
1440 link_with : [lib_common,
1442 install_dir : sbindir,
1444 if not is_disabler(exe)
1446 manadocs += ['sys-utils/fstrim.8.adoc']
1447 bashcompletions += ['fstrim']
1453 include_directories : includes,
1454 link_with : [lib_common,
1457 if not is_disabler(exe)
1459 manadocs += ['sys-utils/dmesg.1.adoc']
1460 bashcompletions += ['dmesg']
1466 include_directories : dir_include,
1467 c_args : '-DTEST_DMESG',
1468 link_with : [lib_common,
1470 build_by_default : program_tests)
1471 if not is_disabler(exe)
1478 include_directories : includes,
1479 link_with : [lib_common],
1480 install_dir : sbindir,
1483 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1484 bashcompletions += ['ctrlaltdel']
1489 include_directories : includes,
1490 install_dir : sbindir,
1493 manadocs += ['sys-utils/fsfreeze.8.adoc']
1494 bashcompletions += ['fsfreeze']
1499 include_directories : includes,
1500 link_with : [lib_common,
1502 install_dir : sbindir,
1505 manadocs += ['sys-utils/blkdiscard.8.adoc']
1506 bashcompletions += ['blkdiscard']
1511 include_directories : includes,
1512 link_with : [lib_common],
1513 install_dir : sbindir,
1516 manadocs += ['sys-utils/blkzone.8.adoc']
1517 bashcompletions += ['blkzone']
1522 include_directories : includes,
1523 link_with : [lib_common],
1524 install_dir : sbindir,
1527 manadocs += ['sys-utils/blkpr.8.adoc']
1532 include_directories : includes,
1533 link_with : [lib_common],
1534 install_dir : usrsbin_exec_dir,
1537 manadocs += ['sys-utils/ldattach.8.adoc']
1538 bashcompletions += ['ldattach']
1543 include_directories : includes,
1544 link_with : [lib_common],
1545 install_dir : usrsbin_exec_dir,
1548 manadocs += ['sys-utils/rtcwake.8.adoc']
1549 bashcompletions += ['rtcwake']
1554 include_directories : includes,
1555 link_with : [lib_common],
1556 install_dir : usrbin_exec_dir,
1559 manadocs += ['sys-utils/setarch.8.adoc']
1560 bashcompletions += ['setarch']
1562 setarch_links = ['uname26', 'linux32', 'linux64']
1563 setarch_links_arch = {
1564 's390x' : ['s390', 's390x'],
1566 'x86_64' : ['i386', 'x86_64'],
1567 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1568 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1569 'mips64' : ['mips', 'mips64', 'mips32'],
1570 'ia64' : ['i386', 'ia64'],
1571 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1573 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1575 foreach link: setarch_links
1576 meson.add_install_script(meson_make_symlink,
1578 join_paths(usrbin_exec_dir, link))
1579 manlinks += {link + '.8': 'setarch.8'}
1582 opt = not get_option('build-eject').disabled()
1586 include_directories : includes,
1587 link_with : [lib_common,
1589 install_dir : usrbin_exec_dir,
1591 build_by_default : opt)
1592 if opt and not is_disabler(exe)
1594 manadocs += ['sys-utils/eject.1.adoc']
1595 bashcompletions += ['eject']
1598 opt = not get_option('build-losetup').disabled()
1602 include_directories : includes,
1603 link_with : [lib_common,
1605 install_dir : sbindir,
1607 build_by_default : opt)
1608 if opt and not is_disabler(exe)
1609 manadocs += ['sys-utils/losetup.8.adoc']
1611 bashcompletions += ['losetup']
1614 opt = opt and 'losetup' in static_programs
1618 include_directories : includes,
1619 link_args : ['--static'],
1620 link_with : [lib_common,
1621 lib_smartcols.get_static_lib()],
1622 install_dir : sbindir,
1624 build_by_default : opt)
1625 if opt and not is_disabler(exe)
1629 opt = not get_option('build-zramctl').disabled()
1633 include_directories : includes,
1634 link_with : [lib_common,
1636 install_dir : sbindir,
1638 build_by_default : opt)
1639 if opt and not is_disabler(exe)
1641 manadocs += ['sys-utils/zramctl.8.adoc']
1642 bashcompletions += ['zramctl']
1648 include_directories : includes,
1649 link_with : [lib_common,
1651 install_dir : usrbin_exec_dir,
1653 if not is_disabler(exe)
1655 manadocs += ['sys-utils/prlimit.1.adoc']
1656 bashcompletions += ['prlimit']
1662 include_directories : includes,
1663 link_with : [lib_common,
1666 install_dir : usrbin_exec_dir,
1668 if not is_disabler(exe)
1670 manadocs += ['sys-utils/lsns.8.adoc']
1671 bashcompletions += ['lsns']
1674 opt = not get_option('build-mount').disabled()
1678 include_directories : includes,
1679 link_with : [lib_common,
1682 dependencies : lib_selinux,
1683 install_mode : 'rwsr-xr-x',
1685 build_by_default : opt)
1689 include_directories : includes,
1690 link_with : [lib_common,
1692 install_mode : 'rwsr-xr-x',
1694 build_by_default : opt)
1695 if opt and not is_disabler(exe)
1697 manadocs += ['sys-utils/fstab.5.adoc',
1698 'sys-utils/mount.8.adoc',
1699 'sys-utils/umount.8.adoc']
1700 bashcompletions += ['mount', 'umount']
1703 opt2 = opt and 'mount' in static_programs
1707 include_directories : includes,
1708 link_args : ['--static'],
1709 link_with : [lib_common,
1710 lib_smartcols_static,
1713 build_by_default : opt2)
1714 if opt2 and not is_disabler(exe)
1718 opt2 = opt and 'umount' in static_programs
1722 include_directories : includes,
1723 link_args : ['--static'],
1724 link_with : [lib_common,
1727 build_by_default : opt2)
1728 if opt2 and not is_disabler(exe)
1737 include_directories : includes,
1738 link_with : [lib_common,
1742 install_dir : sbindir,
1744 if not is_disabler(exe)
1746 manadocs += ['sys-utils/swapon.8.adoc']
1747 bashcompletions += ['swapon']
1753 include_directories : includes,
1754 link_with : [lib_common,
1757 install_dir : sbindir,
1759 if not is_disabler(exe)
1761 manlinks += {'swapoff.8': 'swapon.8'}
1762 bashcompletions += ['swapoff']
1768 include_directories : includes,
1769 link_with : [lib_common,
1771 dependencies : [rtas_libs],
1772 install_dir : usrbin_exec_dir,
1774 if not is_disabler(exe)
1776 manadocs += ['sys-utils/lscpu.1.adoc']
1777 bashcompletions += ['lscpu']
1783 include_directories : includes,
1784 link_with : [lib_common],
1785 install_dir : sbindir,
1788 manadocs += ['sys-utils/chcpu.8.adoc']
1789 bashcompletions += ['chcpu']
1794 include_directories : includes,
1795 link_with : [lib_common,
1798 if not is_disabler(exe)
1800 manadocs += ['sys-utils/wdctl.8.adoc']
1801 bashcompletions += ['wdctl']
1804 opt = not get_option('build-mountpoint').disabled()
1808 include_directories : includes,
1809 link_with : [lib_mount],
1811 build_by_default : opt)
1812 if opt and not is_disabler(exe)
1814 manadocs += ['sys-utils/mountpoint.1.adoc']
1815 bashcompletions += ['mountpoint']
1818 opt = not get_option('build-fallocate').disabled()
1822 include_directories : includes,
1823 link_with : [lib_common],
1824 install_dir : usrbin_exec_dir,
1826 build_by_default : opt)
1827 if opt and not is_disabler(exe)
1829 manadocs += ['sys-utils/fallocate.1.adoc']
1830 bashcompletions += ['fallocate']
1833 opt = not get_option('build-pivot_root').disabled()
1837 include_directories : includes,
1838 install_dir : sbindir,
1840 build_by_default : opt)
1841 if opt and not is_disabler(exe)
1843 manadocs += ['sys-utils/pivot_root.8.adoc']
1844 bashcompletions += ['pivot_root']
1847 opt = not get_option('build-switch_root').disabled()
1848 if opt and not have_dirfd and not have_ddfd
1849 error('neither dirfd nor ddfd are available')
1853 switch_root_sources,
1854 include_directories : includes,
1855 install_dir : sbindir,
1857 build_by_default : opt)
1858 if opt and not is_disabler(exe)
1860 manadocs += ['sys-utils/switch_root.8.adoc']
1863 opt = not get_option('build-unshare').disabled()
1867 include_directories : includes,
1868 link_with : [lib_common],
1869 install_dir : usrbin_exec_dir,
1871 build_by_default : opt)
1872 if opt and not is_disabler(exe)
1874 manadocs += ['sys-utils/unshare.1.adoc']
1875 bashcompletions += ['unshare']
1878 opt = opt and 'unshare' in static_programs
1882 include_directories : includes,
1883 link_with : [lib_common],
1884 install_dir : usrbin_exec_dir,
1886 build_by_default : opt)
1887 if opt and not is_disabler(exe)
1891 opt = not get_option('build-nsenter').disabled()
1895 include_directories : includes,
1896 link_with : [lib_common],
1897 dependencies : [lib_selinux],
1898 install_dir : usrbin_exec_dir,
1900 build_by_default : opt)
1901 if opt and not is_disabler(exe)
1903 manadocs += ['sys-utils/nsenter.1.adoc']
1904 bashcompletions += ['nsenter']
1907 opt = opt and 'nsenter' in static_programs
1911 include_directories : includes,
1912 link_with : [lib_common],
1913 dependencies : [lib_selinux],
1914 install_dir : usrbin_exec_dir,
1916 build_by_default : opt)
1917 if opt and not is_disabler(exe)
1921 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1925 include_directories : includes,
1926 link_with : [lib_common],
1927 dependencies : [lib_cap_ng],
1928 install_dir : usrbin_exec_dir,
1930 build_by_default : opt)
1931 if opt and not is_disabler(exe)
1933 manadocs += ['sys-utils/setpriv.1.adoc']
1934 bashcompletions += ['setpriv']
1940 include_directories : includes,
1941 link_with : [lib_common],
1942 dependencies : realtime_libs,
1943 install_dir : usrbin_exec_dir,
1946 manadocs += ['sys-utils/flock.1.adoc']
1947 bashcompletions += ['flock']
1949 opt = not get_option('build-lsirq').disabled()
1953 include_directories : includes,
1954 link_with : [lib_common,
1956 install_dir : usrbin_exec_dir,
1958 build_by_default : opt)
1959 if opt and not is_disabler(exe)
1961 manadocs += ['sys-utils/lsirq.1.adoc']
1962 bashcompletions += ['lsirq']
1965 opt = not get_option('build-irqtop').disabled()
1969 include_directories : includes,
1970 dependencies : [realtime_libs, curses_libs],
1971 link_with : [lib_common,
1974 install_dir : usrbin_exec_dir,
1976 build_by_default : opt)
1977 if opt and not is_disabler(exe)
1979 manadocs += ['sys-utils/irqtop.1.adoc']
1980 bashcompletions += ['irqtop']
1983 opt = not get_option('build-ipcs').disabled()
1987 include_directories : includes,
1988 link_with : [lib_common,
1990 install_dir : usrbin_exec_dir,
1992 build_by_default : opt)
1993 if opt and not is_disabler(exe)
1995 manadocs += ['sys-utils/lsipc.1.adoc']
1996 bashcompletions += ['lsipc']
2003 include_directories : includes,
2004 link_with : [lib_common],
2005 dependencies : [lib_m,
2007 install_dir : sbindir,
2009 build_by_default : opt)
2010 if opt and not is_disabler(exe)
2012 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
2013 bashcompletions += ['hwclock']
2019 include_directories : includes,
2020 install_dir : sbindir,
2023 manadocs += ['disk-utils/mkfs.8.adoc']
2024 bashcompletions += ['mkfs']
2026 opt = not get_option('build-bfs').disabled()
2030 include_directories : includes,
2031 link_with : [lib_common],
2032 install_dir : sbindir,
2034 build_by_default : opt)
2035 if opt and not is_disabler(exe)
2037 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
2038 bashcompletions += ['mkfs.bfs']
2044 include_directories : includes,
2045 link_with : [lib_common],
2046 install_dir : usrbin_exec_dir,
2049 manadocs += ['disk-utils/isosize.8.adoc']
2050 bashcompletions += ['isosize']
2055 include_directories : includes,
2056 link_with : [lib_common,
2059 dependencies: [lib_selinux],
2060 install_dir : sbindir,
2062 if opt and not is_disabler(exe)
2064 manadocs += ['disk-utils/mkswap.8.adoc']
2065 bashcompletions += ['mkswap']
2071 include_directories : includes,
2072 link_with : [lib_common,
2075 install_dir : sbindir,
2077 if opt and not is_disabler(exe)
2079 manadocs += ['disk-utils/swaplabel.8.adoc']
2080 bashcompletions += ['swaplabel']
2083 opt = not get_option('build-fsck').disabled()
2087 include_directories : includes,
2088 link_with : [lib_common,
2091 dependencies : realtime_libs,
2092 install_dir : sbindir,
2094 build_by_default : opt)
2095 if opt and not is_disabler(exe)
2097 manadocs += ['disk-utils/fsck.8.adoc']
2098 bashcompletions += ['fsck']
2101 opt = not get_option('build-minix').disabled()
2105 include_directories : includes,
2106 link_with : [lib_common],
2107 install_dir : sbindir,
2109 build_by_default : opt)
2113 include_directories : includes,
2114 c_args : '-DTEST_SCRIPT',
2115 link_with : [lib_common],
2116 build_by_default : opt and program_tests)
2120 include_directories : includes,
2121 link_with : [lib_common],
2122 install_dir : sbindir,
2124 build_by_default : opt)
2125 if opt and not is_disabler(exe)
2126 exes += [exe, exe2, exe3]
2127 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2128 bashcompletions += ['mkfs.minix', 'fsck.minix']
2131 opt = not get_option('build-cramfs').disabled()
2134 mkfs_cramfs_sources,
2135 include_directories : includes,
2136 link_with : [lib_common],
2137 dependencies : [lib_z],
2138 install_dir : sbindir,
2140 build_by_default : opt)
2143 fsck_cramfs_sources,
2144 include_directories : includes,
2145 link_with : [lib_common],
2146 dependencies : [lib_z],
2147 install_dir : sbindir,
2149 build_by_default : opt)
2150 if not is_disabler(exe)
2152 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2153 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2156 opt = not get_option('build-raw').disabled()
2158 cc.has_header('linux/raw.h', required: opt)
2163 include_directories : includes,
2164 install_dir : sbindir,
2166 build_by_default : opt)
2167 if opt and not is_disabler(exe)
2169 manadocs += ['disk-utils/raw.8.adoc']
2170 bashcompletions += ['raw']
2173 opt = not get_option('build-fdformat').disabled()
2177 include_directories : includes,
2178 link_with : [lib_common],
2179 install_dir : usrsbin_exec_dir,
2181 build_by_default : opt)
2182 if opt and not is_disabler(exe)
2184 manadocs += ['disk-utils/fdformat.8.adoc']
2190 include_directories : includes,
2191 link_with : [lib_common],
2192 install_dir : sbindir,
2194 manadocs += ['disk-utils/blockdev.8.adoc']
2195 bashcompletions += ['blockdev']
2197 opt = not get_option('build-fdisks').disabled()
2198 if opt and not have_dirfd and not have_ddfd
2199 error('neither dirfd nor ddfd are available')
2204 include_directories : includes,
2205 link_with : [lib_common,
2209 dependencies : [lib_readline],
2210 install_dir : sbindir,
2212 build_by_default : opt)
2213 if opt and not is_disabler(exe)
2215 bashcompletions += ['fdisk']
2218 opt2 = opt and 'fdisk' in static_programs
2222 link_args : ['--static'],
2223 include_directories : includes,
2224 link_with : [lib_common,
2227 lib_smartcols.get_static_lib()],
2228 dependencies : [lib_readline_static],
2229 install_dir : sbindir,
2231 build_by_default : opt2)
2232 if opt2 and not is_disabler(exe)
2239 include_directories : includes,
2240 link_with : [lib_common,
2244 dependencies : [lib_readline],
2245 install_dir : sbindir,
2247 build_by_default : opt)
2248 if opt and not is_disabler(exe)
2250 bashcompletions += ['sfdisk']
2253 opt2 = opt and 'sfdisk' in static_programs
2257 include_directories : includes,
2258 link_with : [lib_common,
2261 lib_smartcols.get_static_lib()],
2262 dependencies : [lib_readline_static],
2263 install_dir : sbindir,
2265 build_by_default : opt2)
2266 if opt2 and not is_disabler(exe)
2273 include_directories : includes,
2274 link_with : [lib_common,
2279 dependencies : [curses_libs],
2280 install_dir : sbindir,
2282 build_by_default : opt)
2283 if opt and not is_disabler(exe)
2285 manadocs += ['disk-utils/fdisk.8.adoc',
2286 'disk-utils/sfdisk.8.adoc',
2287 'disk-utils/cfdisk.8.adoc']
2288 bashcompletions += ['cfdisk']
2291 opt = not get_option('build-partx').disabled()
2295 include_directories : includes,
2296 link_with : [lib_common],
2297 install_dir : usrsbin_exec_dir,
2299 build_by_default : opt)
2303 include_directories : includes,
2304 link_with : [lib_common],
2305 install_dir : usrsbin_exec_dir,
2307 build_by_default : opt)
2311 include_directories : includes,
2312 link_with : [lib_common],
2313 install_dir : usrsbin_exec_dir,
2315 build_by_default : opt)
2319 include_directories : includes,
2320 link_with : [lib_common,
2323 install_dir : usrsbin_exec_dir,
2325 build_by_default : opt)
2327 exes += [exe, exe2, exe3, exe4]
2328 manadocs += ['disk-utils/addpart.8.adoc',
2329 'disk-utils/delpart.8.adoc',
2330 'disk-utils/resizepart.8.adoc',
2331 'disk-utils/partx.8.adoc']
2332 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2335 ############################################################
2340 include_directories : includes,
2341 link_with : [lib_common],
2342 dependencies : [lib_util,
2346 install_dir : usrbin_exec_dir,
2349 manadocs += ['term-utils/script.1.adoc']
2350 bashcompletions += ['script']
2355 include_directories : includes,
2356 c_args : '-DTEST_SCRIPT',
2357 link_with : [lib_common],
2358 dependencies : [lib_util,
2362 build_by_default : program_tests)
2368 include_directories : includes,
2369 link_with : [lib_common],
2370 dependencies : [lib_util,
2373 install_dir : usrbin_exec_dir,
2376 manadocs += ['term-utils/scriptlive.1.adoc']
2377 bashcompletions += ['scriptlive']
2381 scriptreplay_sources,
2382 include_directories : includes,
2383 link_with : [lib_common],
2384 dependencies : [math_libs],
2385 install_dir : usrbin_exec_dir,
2388 manadocs += ['term-utils/scriptreplay.1.adoc']
2389 bashcompletions += ['scriptreplay']
2391 opt = not get_option('build-agetty').disabled()
2395 include_directories : includes,
2396 link_with : [lib_common, logindefs_c],
2397 dependencies : [BSD ? lib_util : [], lib_systemd],
2398 install_dir : sbindir,
2400 build_by_default : opt)
2403 manadocs += ['term-utils/agetty.8.adoc']
2406 opt = not get_option('build-setterm').disabled()
2410 include_directories : includes,
2411 link_with : [lib_common],
2412 dependencies : [curses_libs],
2413 install_dir : usrbin_exec_dir,
2415 build_by_default : opt)
2418 manadocs += ['term-utils/setterm.1.adoc']
2419 bashcompletions += ['setterm']
2422 opt = not get_option('build-mesg').disabled()
2426 include_directories : includes,
2427 link_with : [lib_common],
2428 install_dir : usrbin_exec_dir,
2430 build_by_default : opt)
2433 manadocs += ['term-utils/mesg.1.adoc']
2434 bashcompletions += ['mesg']
2437 opt = not get_option('build-wall').disabled()
2441 include_directories : includes,
2442 link_with : [lib_common],
2443 dependencies : [lib_systemd],
2444 install_dir : usrbin_exec_dir,
2445 install_mode : 'rwxr-sr-x',
2447 build_by_default : opt)
2450 manadocs += ['term-utils/wall.1.adoc']
2451 bashcompletions += ['wall']
2454 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2455 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2457 opt = not get_option('build-write').disabled()
2461 include_directories : includes,
2462 link_with : [lib_common],
2463 dependencies : [lib_systemd],
2464 install_dir : usrbin_exec_dir,
2465 install_mode : 'rwxr-sr-x',
2467 build_by_default : opt)
2470 manadocs += ['term-utils/write.1.adoc']
2471 bashcompletions += ['write']
2474 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2475 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2477 opt = not get_option('build-login').disabled()
2481 include_directories : includes,
2482 link_with : [lib_common, logindefs_c],
2483 dependencies : [lib_pam,
2487 build_by_default : opt)
2488 if not is_disabler(exe)
2490 manadocs += ['login-utils/login.1.adoc']
2493 opt = not get_option('build-sulogin').disabled()
2497 include_directories : includes,
2498 link_with : [lib_common],
2499 dependencies : [lib_crypt,
2501 install_dir : sbindir,
2503 build_by_default : opt)
2504 if not is_disabler(exe)
2506 manadocs += ['login-utils/sulogin.8.adoc']
2512 include_directories : includes,
2513 link_with : [lib_common,
2515 dependencies : [curses_libs],
2516 install_dir : usrbin_exec_dir,
2519 manadocs += ['misc-utils/cal.1.adoc']
2520 bashcompletions += ['cal']
2522 opt = not get_option('build-logger').disabled()
2526 include_directories : includes,
2527 link_with : [lib_common],
2528 dependencies : [lib_systemd],
2529 install_dir : usrbin_exec_dir,
2531 build_by_default : opt)
2532 if opt and not is_disabler(exe)
2534 manadocs += ['misc-utils/logger.1.adoc']
2535 bashcompletions += ['logger']
2541 include_directories : includes,
2542 c_args : '-DTEST_LOGGER',
2543 link_with : [lib_common],
2544 dependencies : [lib_systemd],
2545 build_by_default: program_tests)
2546 if not is_disabler(exe)
2553 include_directories : includes,
2554 install_dir : usrbin_exec_dir,
2557 manadocs += ['misc-utils/look.1.adoc']
2558 bashcompletions += ['look']
2563 include_directories : includes,
2564 link_with : [lib_common],
2565 install_dir : usrbin_exec_dir,
2568 manadocs += ['misc-utils/mcookie.1.adoc']
2569 bashcompletions += ['mcookie']
2574 include_directories : includes,
2575 dependencies : [lib_selinux],
2576 install_dir : usrbin_exec_dir,
2579 manadocs += ['misc-utils/namei.1.adoc']
2580 bashcompletions += ['namei']
2585 include_directories : includes,
2586 link_with : [lib_common],
2587 install_dir : usrbin_exec_dir,
2590 manadocs += ['misc-utils/whereis.1.adoc']
2591 bashcompletions += ['whereis']
2596 include_directories : includes,
2597 link_with : [lib_common,
2600 install_dir : usrbin_exec_dir,
2602 if not is_disabler(exe)
2604 manadocs += ['misc-utils/lslocks.8.adoc']
2605 bashcompletions += ['lslocks']
2611 include_directories : includes,
2612 link_with : [lib_common,
2616 dependencies : lib_udev,
2618 if not is_disabler(exe)
2620 manadocs += ['misc-utils/lsblk.8.adoc']
2621 bashcompletions += ['lsblk']
2625 mq_libs += cc.find_library('rt', required : true)
2630 include_directories : includes,
2631 link_with : [lib_common,
2633 dependencies : mq_libs,
2634 install_dir : usrbin_exec_dir,
2636 if not is_disabler(exe)
2638 manadocs += ['misc-utils/lsfd.1.adoc']
2644 include_directories : includes,
2645 link_with : [lib_common,
2647 install_dir : usrbin_exec_dir,
2649 if not is_disabler(exe)
2651 manadocs += ['misc-utils/uuidgen.1.adoc']
2652 bashcompletions += ['uuidgen']
2658 include_directories : includes,
2659 link_with : [lib_common,
2662 install_dir : usrbin_exec_dir,
2664 if not is_disabler(exe)
2666 manadocs += ['misc-utils/uuidparse.1.adoc']
2667 bashcompletions += ['uuidparse']
2674 include_directories : includes,
2675 link_with : [lib_common,
2677 dependencies : [realtime_libs,
2679 install_dir : usrsbin_exec_dir,
2681 build_by_default : opt)
2685 include_directories : includes,
2686 link_with : [lib_common,
2688 dependencies : thread_libs,
2689 build_by_default : opt and program_tests)
2690 if not is_disabler(exe)
2692 manadocs += ['misc-utils/uuidd.8.adoc']
2693 bashcompletions += ['uuidd']
2696 opt = build_libblkid
2700 include_directories : includes,
2701 link_with : [lib_common,
2703 install_dir : sbindir,
2705 build_by_default : opt)
2706 if opt and not is_disabler(exe)
2708 manadocs += ['misc-utils/blkid.8.adoc']
2709 bashcompletions += ['blkid']
2712 opt = opt and 'blkid' in static_programs
2716 include_directories : includes,
2717 link_with : [lib_common,
2719 install_dir : sbindir,
2721 build_by_default : opt)
2722 if opt and not is_disabler(exe)
2728 'libblkid/samples/mkfs.c',
2729 include_directories : includes,
2730 link_with : lib_blkid)
2731 if not is_disabler(exe)
2736 'sample-partitions',
2737 'libblkid/samples/partitions.c',
2738 include_directories : includes,
2739 link_with : lib_blkid)
2740 if not is_disabler(exe)
2745 'sample-superblocks',
2746 'libblkid/samples/superblocks.c',
2747 include_directories : includes,
2748 link_with : lib_blkid)
2749 if not is_disabler(exe)
2755 'libblkid/samples/topology.c',
2756 include_directories : includes,
2757 link_with : lib_blkid)
2758 if not is_disabler(exe)
2763 'test_blkid_fuzz_sample',
2764 'libblkid/src/fuzz.c',
2765 include_directories: includes,
2766 link_with: lib_blkid,
2767 build_by_default: program_tests)
2768 if not is_disabler(exe)
2772 ############################################################
2777 include_directories : includes,
2778 link_with : [lib_blkid],
2779 install_dir : sbindir,
2781 if not is_disabler(exe)
2783 manadocs += ['misc-utils/findfs.8.adoc']
2784 bashcompletions += ['findfs']
2790 include_directories : includes,
2791 link_with : [lib_common,
2794 install_dir : sbindir,
2796 if not is_disabler(exe)
2798 manadocs += ['misc-utils/wipefs.8.adoc']
2799 bashcompletions += ['wipefs']
2805 include_directories : includes,
2806 link_with : [lib_common,
2810 dependencies : [lib_udev],
2812 if not is_disabler(exe)
2814 manadocs += ['misc-utils/findmnt.8.adoc']
2815 bashcompletions += ['findmnt']
2821 include_directories : includes,
2822 link_with : [lib_common],
2824 if not is_disabler(exe)
2826 manadocs += ['misc-utils/kill.1.adoc']
2829 opt = not get_option('build-rename').disabled()
2833 include_directories : includes,
2834 install_dir : usrbin_exec_dir,
2836 build_by_default : opt)
2837 if opt and not is_disabler(exe)
2839 manadocs += ['misc-utils/rename.1.adoc']
2840 bashcompletions += ['rename']
2846 include_directories : includes,
2847 link_with : [lib_common],
2848 install_dir : usrbin_exec_dir,
2851 manadocs += ['misc-utils/getopt.1.adoc']
2852 bashcompletions += ['getopt']
2857 include_directories : includes,
2858 link_with : [lib_common,
2860 install_dir : usrbin_exec_dir,
2862 if not is_disabler(exe)
2864 manadocs += ['misc-utils/fincore.1.adoc']
2865 bashcompletions += ['fincore']
2871 include_directories : includes,
2872 link_with : [lib_common],
2873 install_dir : usrbin_exec_dir,
2875 if not is_disabler(exe)
2877 manadocs += ['misc-utils/hardlink.1.adoc']
2878 bashcompletions += ['hardlink']
2881 opt = not get_option('build-pipesz').disabled()
2885 include_directories : includes,
2886 link_with : [lib_common],
2887 install_dir : usrbin_exec_dir,
2889 if opt and not is_disabler(exe)
2891 manadocs += ['misc-utils/pipesz.1.adoc']
2892 bashcompletions += ['pipesz']
2898 include_directories : includes,
2899 c_args : '-DTEST_CAL',
2900 link_with : [lib_common,
2902 dependencies : [curses_libs],
2903 build_by_default: program_tests)
2904 if not is_disabler(exe)
2911 include_directories : includes,
2912 link_with : [lib_common],
2913 install_dir : usrbin_exec_dir,
2915 if not is_disabler(exe)
2917 manadocs += ['misc-utils/fadvise.1.adoc']
2918 bashcompletions += ['fadvise']
2921 if LINUX and conf.get('HAVE_PIDFD_OPEN') != false
2925 include_directories : includes,
2926 link_with : [lib_common],
2927 install_dir : usrbin_exec_dir,
2929 if not is_disabler(exe)
2931 manadocs += ['misc-utils/waitpid.1.adoc']
2932 bashcompletions += ['waitpid']
2936 syscalls_h = custom_target('syscalls.h',
2937 input : 'tools/all_syscalls',
2938 output : 'syscalls.h',
2939 command : ['tools/all_syscalls', cc.cmd_array()]
2942 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
2945 'misc-utils/enosys.c', syscalls_h,
2946 include_directories : includes,
2947 link_with : [lib_common],
2948 install_dir : usrbin_exec_dir,
2950 if not is_disabler(exe)
2952 manadocs += ['misc-utils/enosys.1.adoc']
2953 bashcompletions += ['enosys']
2960 include_directories : includes,
2961 link_with : [lib_common, lib_smartcols],
2962 install_dir : usrbin_exec_dir,
2964 if not is_disabler(exe)
2966 manadocs += ['misc-utils/lsclocks.1.adoc']
2967 bashcompletions += ['lsclocks']
2970 ############################################################
2972 opt = not get_option('build-schedutils').disabled()
2975 'schedutils/chrt.c',
2976 include_directories : includes,
2977 link_with : lib_common,
2978 install_dir : usrbin_exec_dir,
2980 build_by_default : opt)
2984 'schedutils/ionice.c',
2985 include_directories : includes,
2986 link_with : lib_common,
2987 install_dir : usrbin_exec_dir,
2989 build_by_default : opt)
2993 'schedutils/taskset.c',
2994 include_directories : includes,
2995 link_with : lib_common,
2996 install_dir : usrbin_exec_dir,
2998 build_by_default : opt)
3002 'schedutils/uclampset.c',
3003 include_directories : includes,
3004 link_with : lib_common,
3005 install_dir : usrbin_exec_dir,
3007 build_by_default : opt)
3009 if opt and not is_disabler(exe)
3010 exes += [exe, exe2, exe3, exe4]
3011 manadocs += ['schedutils/chrt.1.adoc',
3012 'schedutils/ionice.1.adoc',
3013 'schedutils/taskset.1.adoc',
3014 'schedutils/uclampset.1.adoc']
3015 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
3018 ############################################################
3020 # TODO: when autotools compat is not needed, s/_/-/g in file names?
3025 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
3026 include_directories : dir_include,
3027 link_with : lib_common,
3028 build_by_default: program_tests)
3034 c_args : ['-DTEST_PROGRAM_BLKDEV'],
3035 include_directories : dir_include,
3036 link_with : lib_common,
3037 build_by_default: program_tests)
3043 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
3044 include_directories : dir_include,
3045 link_with : lib_common,
3046 build_by_default: program_tests)
3052 c_args : ['-DTEST_PROGRAM_MANGLE'],
3053 include_directories : dir_include,
3054 build_by_default: program_tests)
3060 c_args : ['-DTEST_PROGRAM_STRUTILS'],
3061 include_directories : dir_include,
3062 build_by_default: program_tests)
3068 'lib/color-names.c',
3069 c_args : ['-DTEST_PROGRAM_COLORS'],
3070 include_directories : dir_include,
3071 link_with : [lib_common, lib_tcolors],
3072 build_by_default: program_tests)
3078 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
3079 include_directories : dir_include,
3080 build_by_default: program_tests)
3083 if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false
3087 c_args : ['-DTEST_PROGRAM_PROCFS'],
3088 include_directories : dir_include,
3089 link_with : lib_common,
3090 build_by_default: program_tests)
3097 have_cpu_set_t ? 'lib/cpuset.c' : [],
3098 c_args : ['-DTEST_PROGRAM_PATH'],
3099 include_directories : dir_include,
3100 link_with : lib_common,
3101 build_by_default: program_tests)
3105 if conf.get('HAVE_PTY') != false
3110 c_args : ['-DTEST_PROGRAM_PTY'],
3111 include_directories : dir_include,
3112 link_with : [lib_common],
3113 dependencies : [lib_m,
3116 build_by_default: program_tests)
3124 c_args : ['-DTEST_PROGRAM_CPUSET'],
3125 include_directories : dir_include,
3126 build_by_default: program_tests)
3137 have_cpu_set_t ? 'lib/cpuset.c' : [],
3138 c_args : ['-DTEST_PROGRAM_SYSFS'],
3139 include_directories : dir_include,
3140 build_by_default: program_tests)
3146 c_args : ['-DTEST_PROGRAM_PAGER'],
3147 include_directories : dir_include,
3148 build_by_default: program_tests)
3152 'test_linux_version',
3153 'lib/linux_version.c',
3154 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3155 include_directories : dir_include,
3156 build_by_default: program_tests)
3162 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3163 include_directories : dir_include,
3164 build_by_default: program_tests)
3168 'test_canonicalize',
3169 'lib/canonicalize.c',
3170 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3171 include_directories : dir_include,
3172 build_by_default: program_tests)
3179 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3180 include_directories : dir_include,
3181 build_by_default: program_tests)
3187 c_args : ['-DTEST_PROGRAM'],
3188 include_directories : dir_include,
3189 link_with : lib_common,
3190 build_by_default: program_tests)
3196 c_args : ['-DTEST_PROGRAM'],
3197 include_directories : dir_include,
3198 link_with : [lib_common, logindefs_c],
3199 build_by_default: program_tests)
3203 ############################################################
3207 'libuuid/src/test_uuid.c',
3208 include_directories : [dir_include, dir_libuuid],
3209 link_with : lib_uuid,
3210 dependencies : socket_libs,
3211 build_by_default: program_tests)
3212 if not is_disabler(exe)
3216 ############################################################
3218 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3220 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3224 'libfdisk/src/ask.c',
3225 c_args : libfdisk_tests_cflags,
3226 include_directories : lib_fdisk_includes,
3227 link_with : libfdisk_tests_ldadd,
3228 build_by_default: program_tests)
3229 if not is_disabler(exe)
3235 'libfdisk/src/gpt.c',
3236 c_args : libfdisk_tests_cflags,
3237 include_directories : lib_fdisk_includes,
3238 link_with : libfdisk_tests_ldadd,
3239 build_by_default: program_tests)
3240 if not is_disabler(exe)
3246 'libfdisk/src/utils.c',
3247 c_args : libfdisk_tests_cflags,
3248 include_directories : lib_fdisk_includes,
3249 link_with : libfdisk_tests_ldadd,
3250 build_by_default: program_tests)
3251 if not is_disabler(exe)
3256 'test_fdisk_script',
3257 'libfdisk/src/script.c',
3258 c_args : libfdisk_tests_cflags,
3259 include_directories : lib_fdisk_includes,
3260 link_with : libfdisk_tests_ldadd,
3261 build_by_default: program_tests)
3262 if not is_disabler(exe)
3267 'test_fdisk_version',
3268 'libfdisk/src/version.c',
3269 c_args : libfdisk_tests_cflags,
3270 include_directories : lib_fdisk_includes,
3271 link_with : libfdisk_tests_ldadd,
3272 build_by_default: program_tests)
3273 if not is_disabler(exe)
3279 'libfdisk/src/item.c',
3280 c_args : libfdisk_tests_cflags,
3281 include_directories : lib_fdisk_includes,
3282 link_with : libfdisk_tests_ldadd,
3283 build_by_default: program_tests)
3284 if not is_disabler(exe)
3288 sample_fdisk_cflags = ['-Wno-unused']
3289 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3292 'sample-fdisk-mkpart',
3293 'libfdisk/samples/mkpart.c',
3294 c_args : sample_fdisk_cflags,
3295 include_directories : lib_fdisk_includes,
3296 link_with : sample_fdisk_ldadd)
3297 if not is_disabler(exe)
3302 'sample-fdisk-mkpart-fullspec',
3303 'libfdisk/samples/mkpart-fullspec.c',
3304 c_args : sample_fdisk_cflags,
3305 include_directories : lib_fdisk_includes,
3306 link_with : sample_fdisk_ldadd)
3307 if not is_disabler(exe)
3311 ############################################################
3315 'tests/helpers/test_cap.c',
3316 include_directories : includes,
3317 dependencies : [lib_cap_ng],
3318 build_by_default: program_tests)
3323 'tests/helpers/test_mbsencode.c',
3324 include_directories : includes,
3325 link_with : lib_common,
3326 build_by_default: program_tests)
3331 'tests/helpers/test_byteswap.c',
3332 include_directories : includes,
3333 build_by_default: program_tests)
3338 'tests/helpers/test_md5.c',
3340 include_directories : includes,
3341 build_by_default: program_tests)
3346 'tests/helpers/test_sha1.c',
3348 include_directories : includes,
3349 build_by_default: program_tests)
3354 'tests/helpers/test_pathnames.c',
3355 include_directories : includes,
3356 build_by_default: program_tests)
3361 'tests/helpers/test_strerror.c',
3362 include_directories : includes,
3363 build_by_default: program_tests)
3368 'tests/helpers/test_sysinfo.c',
3369 include_directories : includes,
3370 build_by_default: program_tests)
3375 'tests/helpers/test_sigreceive.c',
3376 include_directories : includes,
3377 link_with : lib_common,
3378 build_by_default: program_tests)
3383 'tests/helpers/test_tiocsti.c',
3384 include_directories : includes,
3385 build_by_default: program_tests)
3389 'test_uuid_namespace',
3390 'tests/helpers/test_uuid_namespace.c',
3394 include_directories : includes,
3395 build_by_default: program_tests)
3401 'tests/helpers/test_mkfds.c',
3402 'tests/helpers/test_mkfds.h',
3403 'tests/helpers/test_mkfds_ppoll.c',
3404 include_directories : includes,
3405 dependencies : mq_libs,
3406 build_by_default: program_tests)
3412 'tests/helpers/test_enosys.c',
3413 include_directories : includes,
3414 build_by_default: program_tests)
3417 ############################################################
3419 if conf.get('HAVE_OPENAT') != false
3421 'sample-scols-tree',
3422 'libsmartcols/samples/tree.c',
3423 include_directories : includes,
3424 link_with : [lib_smartcols, lib_common],
3425 build_by_default: program_tests)
3426 if not is_disabler(exe)
3432 'sample-scols-title',
3433 'libsmartcols/samples/title.c',
3434 include_directories : includes,
3435 link_with : [lib_smartcols, lib_common])
3436 if not is_disabler(exe)
3441 'sample-scols-wrap',
3442 'libsmartcols/samples/wrap.c',
3443 include_directories : includes,
3444 link_with : [lib_smartcols, lib_common])
3445 if not is_disabler(exe)
3450 'sample-scols-continuous',
3451 'libsmartcols/samples/continuous.c',
3452 include_directories : includes,
3453 link_with : [lib_smartcols, lib_common])
3454 if not is_disabler(exe)
3459 'sample-scols-maxout',
3460 'libsmartcols/samples/maxout.c',
3461 include_directories : includes,
3462 link_with : [lib_smartcols, lib_common])
3463 if not is_disabler(exe)
3468 'sample-scols-fromfile',
3469 'libsmartcols/samples/fromfile.c',
3470 include_directories : includes,
3471 link_with : [lib_smartcols, lib_common])
3472 if not is_disabler(exe)
3477 'sample-scols-grouping-simple',
3478 'libsmartcols/samples/grouping-simple.c',
3479 include_directories : includes,
3480 link_with : [lib_smartcols, lib_common])
3481 if not is_disabler(exe)
3486 'sample-scols-grouping-overlay',
3487 'libsmartcols/samples/grouping-overlay.c',
3488 include_directories : includes,
3489 link_with : [lib_smartcols, lib_common])
3490 if not is_disabler(exe)
3494 ############################################################
3496 # Let the test runner know whether we're running under asan and export
3497 # some paths. We use a file on disk so that it is possible to run the
3498 # test scripts from commandline without setting any variables.
3499 configure_file(output : 'meson.conf',
3504 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3505 python.full_path())])
3507 run_sh = find_program('tests/run.sh')
3511 '--srcdir=' + meson.current_source_dir(),
3512 '--builddir=' + meson.current_build_dir(),
3518 manadocs += ['lib/terminal-colors.d.5.adoc']
3519 manadocs += ['libblkid/libblkid.3.adoc']
3523 'libuuid/man/uuid.3.adoc',
3524 'libuuid/man/uuid_clear.3.adoc',
3525 'libuuid/man/uuid_compare.3.adoc',
3526 'libuuid/man/uuid_copy.3.adoc',
3527 'libuuid/man/uuid_generate.3.adoc',
3528 'libuuid/man/uuid_is_null.3.adoc',
3529 'libuuid/man/uuid_parse.3.adoc',
3530 'libuuid/man/uuid_time.3.adoc',
3531 'libuuid/man/uuid_unparse.3.adoc']
3533 'uuid_generate_random.3': 'uuid_generate.3',
3534 'uuid_generate_time.3': 'uuid_generate.3',
3535 'uuid_generate_time_safe.3': 'uuid_generate.3',
3539 asciidoctor = find_program('asciidoctor', required : false)
3540 if asciidoctor.found()
3541 foreach adoc : manadocs
3542 name = adoc.split('/')[-1]
3543 page = name.split('.adoc')[0]
3544 section = page.split('.')[-1]
3545 mandirn = join_paths(mandir, 'man' + section)
3550 command : [ asciidoctor,
3552 '-a', 'VERSION=' + meson.project_version(),
3553 '-a', 'release-version=' + meson.project_version(),
3554 '-a', 'ADJTIME_PATH=/etc/adjtime',
3555 '-a', 'package-docdir=' + docdir,
3556 '--base-dir=' + meson.current_source_dir(),
3557 '--destination-dir=' + meson.current_build_dir(),
3558 '--load-path', '@SOURCE_ROOT@/tools',
3559 '--require', 'asciidoctor-includetracker',
3563 depfile : page + '.deps',
3565 install_dir : mandirn)
3568 foreach link_name, target : manlinks
3569 link_section = link_name.split('.')[-1]
3570 target_section = target.split('.')[-1]
3571 meson.add_install_script(meson_make_manpage_stub,
3572 join_paths('man' + target_section, target),
3573 join_paths(mandir, 'man' + link_section, link_name))
3577 if bash_completion.found()
3578 foreach completion : bashcompletions
3580 join_paths('bash-completion', completion),
3581 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3584 foreach link_name, target : bashcompletionslinks
3585 meson.add_install_script(meson_make_symlink,
3587 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))