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 = conf.get('HAVE_PTY_H') != false and conf.get('HAVE_SYS_SIGNALFD_H') != false
713 conf.set('HAVE_PTY', have ? 1 : false)
715 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
716 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
718 build_plymouth_support = get_option('build-plymouth-support')
719 have_tiocglcktrmios = cc.has_header_symbol(
720 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
721 required : build_plymouth_support.enabled())
722 have_sock_cloexec = cc.has_header_symbol(
723 'sys/socket.h', 'SOCK_CLOEXEC',
724 prefix : '#include <sys/types.h>',
725 required : build_plymouth_support.enabled())
726 have_sock_nonblock = cc.has_header_symbol(
727 'sys/socket.h', 'SOCK_NONBLOCK',
728 prefix : '#include <sys/types.h>',
729 required : build_plymouth_support.enabled())
730 have_so_passcred = cc.has_header_symbol(
731 'sys/socket.h', 'SO_PASSCRED',
732 prefix : '#include <sys/types.h>',
733 required : build_plymouth_support.enabled())
735 build_plymouth_support = (not build_plymouth_support.disabled() and
736 have_tiocglcktrmios and
737 have_sock_cloexec and
738 have_sock_nonblock and
740 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
741 summary('plymouth support',
742 build_plymouth_support ? 'enabled' : 'disabled',
743 section : 'components')
745 # check for valid fallocate() function
746 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
747 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
748 # and program can't be linked.
756 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
757 return ret == 0 ? 0 : 1;
760 have = cc.links(code, name : 'fallocate() function')
761 conf.set('HAVE_FALLOCATE', have ? 1 : false)
769 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
770 return ret == 0 ? 0 : 1;
773 have = cc.links(code, name : 'posix_fallocate() function')
774 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
776 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
777 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
778 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
780 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
781 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
782 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
784 ############################################################
787 fs_search_path = get_option('fs-search-path')
788 fs_search_path_extra = get_option('fs-search-path-extra')
789 if fs_search_path_extra != ''
790 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
792 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
794 systemdsystemunitdir = ''
796 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
799 sysvinit = get_option('sysvinit').enabled()
800 sysvinitrcdir = sysconfdir + '/init.d'
802 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
803 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
805 have = get_option('chsh-only-listed')
806 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
808 have = get_option('use-tty-group')
809 conf.set('USE_TTY_GROUP', have ? 1 : false)
811 build_hwclock = not get_option('build-hwclock').disabled()
812 bison = find_program('bison', required: build_hwclock)
813 bison_gen = generator(
815 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
816 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
820 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
821 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
825 configuration : conf)
827 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
832 '-Waddress-of-packed-member',
833 '-Wdiscarded-qualifiers',
834 '-Wembedded-directive',
837 '-Wimplicit-function-declaration',
838 '-Wmissing-declarations',
839 '-Wmissing-parameter-type',
840 '-Wmissing-prototypes',
842 '-Wno-missing-field-initializers',
843 '-Wold-style-definition',
847 '-Wstrict-prototypes',
850 '-Wunused-but-set-parameter',
851 '-Wunused-but-set-variable',
852 '-Wunused-parameter',
856 foreach compiler_flag : compiler_flags
857 if cc.has_argument(compiler_flag)
858 add_project_arguments(compiler_flag, language : 'c')
866 bashcompletionslinks = {}
872 subdir('libsmartcols')
875 subdir('login-utils')
883 includes = [dir_include,
893 opt = not get_option('build-chfn-chsh').disabled()
898 include_directories : includes,
899 link_with : [lib_common, logindefs_c],
900 dependencies : chfn_chsh_deps,
901 install_dir : usrbin_exec_dir,
902 install_mode : 'rwsr-xr-x',
904 build_by_default : opt)
908 'login-utils/chsh.c',
911 include_directories : includes,
912 link_with : lib_common,
913 dependencies : chfn_chsh_deps,
914 install_dir : usrbin_exec_dir,
915 install_mode : 'rwsr-xr-x',
917 build_by_default : opt)
918 if opt and not is_disabler(exe)
920 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
921 bashcompletions += ['chfn', 'chsh']
926 test_islocal_sources,
927 include_directories : includes,
928 c_args : '-DTEST_PROGRAM')
933 test_consoles_sources,
934 c_args : ['-DTEST_PROGRAM'],
935 include_directories : includes,
936 link_with : lib_common)
939 opt = not get_option('build-last').disabled()
943 include_directories : includes,
944 link_with : [lib_common],
945 install_dir : usrbin_exec_dir,
947 build_by_default : opt)
948 if opt and not is_disabler(exe)
950 meson.add_install_script(meson_make_symlink,
952 join_paths(usrbin_exec_dir, 'lastb'))
953 manadocs += ['login-utils/last.1.adoc']
954 manlinks += {'lastb.1': 'last.1'}
955 bashcompletions += ['last']
956 bashcompletionslinks += {'lastb': 'last'}
959 opt = not get_option('build-nologin').disabled()
962 'login-utils/nologin.c',
963 include_directories : includes,
964 install_dir : sbindir,
965 link_with : [lib_common],
967 build_by_default : opt)
968 if opt and not is_disabler(exe)
970 manadocs += ['login-utils/nologin.8.adoc']
973 opt = not get_option('build-utmpdump').disabled()
976 'login-utils/utmpdump.c',
977 include_directories : includes,
978 link_with : [lib_common],
979 install_dir : usrbin_exec_dir,
981 build_by_default : opt)
982 if opt and not is_disabler(exe)
984 manadocs += ['login-utils/utmpdump.1.adoc']
985 bashcompletions += ['utmpdump']
988 opt = not get_option('build-su').disabled()
992 'login-utils/su-common.c',
993 'login-utils/su-common.h',
997 include_directories : includes,
998 link_with : [lib_common, logindefs_c],
999 dependencies : [lib_pam,
1003 install_mode : 'rwsr-xr-x',
1005 build_by_default : opt)
1006 if opt and not is_disabler(exe)
1008 manadocs += ['login-utils/su.1.adoc']
1009 bashcompletions += ['su']
1012 opt = not get_option('build-newgrp').disabled()
1015 'login-utils/newgrp.c',
1016 include_directories : includes,
1017 dependencies : [lib_crypt],
1018 install_dir : usrbin_exec_dir,
1019 install_mode : 'rwsr-xr-x',
1021 build_by_default : opt)
1022 if opt and not is_disabler(exe)
1024 manadocs += ['login-utils/newgrp.1.adoc']
1025 bashcompletions += ['newgrp']
1028 opt = not get_option('build-lslogins').disabled()
1031 'login-utils/lslogins.c',
1032 include_directories : includes,
1033 link_with : [lib_common,
1036 dependencies : [lib_selinux,
1038 install_dir : usrbin_exec_dir,
1040 build_by_default : opt)
1041 if opt and not is_disabler(exe)
1043 manadocs += ['login-utils/lslogins.1.adoc']
1044 bashcompletions += ['lslogins']
1047 opt = not get_option('build-vipw').disabled()
1050 'login-utils/vipw.c',
1051 'login-utils/setpwnam.h',
1052 include_directories : includes,
1053 link_with : [lib_common],
1054 dependencies : [lib_selinux],
1055 install_dir : usrbin_exec_dir,
1057 build_by_default : opt)
1058 if opt and not is_disabler(exe)
1060 meson.add_install_script(meson_make_symlink,
1062 join_paths(usrbin_exec_dir, 'vigr'))
1063 manadocs += ['login-utils/vipw.8.adoc']
1064 meson.add_install_script(meson_make_symlink,
1066 join_paths(mandir, 'man8/vigr.8'))
1069 opt = not get_option('build-runuser').disabled()
1072 'login-utils/runuser.c',
1073 'login-utils/su-common.c',
1074 'login-utils/su-common.h',
1078 include_directories : includes,
1079 link_with : [lib_common, logindefs_c],
1080 dependencies : [lib_pam,
1084 install_dir : sbindir,
1086 build_by_default : opt)
1087 if opt and not is_disabler(exe)
1089 manadocs += ['login-utils/runuser.1.adoc']
1090 bashcompletionslinks += {'runuser': 'su'}
1093 ############################################################
1098 include_directories : includes,
1099 link_with : lib_common,
1100 install_dir : usrbin_exec_dir,
1103 manadocs += ['text-utils/col.1.adoc']
1104 bashcompletions += ['col']
1109 include_directories : includes,
1110 install_dir : usrbin_exec_dir,
1113 manadocs += ['text-utils/colcrt.1.adoc']
1114 bashcompletions += ['colcrt']
1119 include_directories : includes,
1120 link_with : lib_common,
1121 install_dir : usrbin_exec_dir,
1124 manadocs += ['text-utils/colrm.1.adoc']
1125 bashcompletions += ['colrm']
1130 include_directories : includes,
1131 install_dir : usrbin_exec_dir,
1134 manadocs += ['text-utils/rev.1.adoc']
1135 bashcompletions += ['rev']
1140 include_directories : includes,
1141 link_with : [lib_common,
1143 install_dir : usrbin_exec_dir,
1145 if not is_disabler(exe)
1147 manadocs += ['text-utils/column.1.adoc']
1148 bashcompletions += ['column']
1151 opt = not get_option('build-line').disabled()
1155 include_directories : includes,
1156 install_dir : usrbin_exec_dir,
1158 build_by_default : opt)
1159 if opt and not is_disabler(exe)
1161 manadocs += ['text-utils/line.1.adoc']
1164 opt = not get_option('build-pg').disabled()
1168 link_with : lib_common,
1169 include_directories : includes,
1170 dependencies : [lib_tinfo,
1172 install_dir : usrbin_exec_dir,
1174 build_by_default : opt)
1175 if opt and not is_disabler(exe)
1177 manadocs += ['text-utils/pg.1.adoc']
1178 bashcompletions += ['pg']
1181 opt = not get_option('build-ul').disabled()
1185 include_directories : includes,
1186 dependencies : [lib_tinfo,
1188 install_dir : usrbin_exec_dir,
1190 build_by_default : opt)
1191 if opt and not is_disabler(exe)
1193 manadocs += ['text-utils/ul.1.adoc']
1194 bashcompletions += ['ul']
1197 opt = not get_option('build-more').disabled()
1201 link_with : [lib_common],
1202 include_directories : includes,
1203 dependencies : [lib_tinfo,
1207 build_by_default : opt)
1211 link_with : [lib_common],
1212 include_directories : includes,
1213 c_args : '-DTEST_PROGRAM',
1214 dependencies : [lib_tinfo,
1217 build_by_default : opt)
1219 if opt and not is_disabler(exe)
1221 manadocs += ['text-utils/more.1.adoc']
1222 bashcompletions += ['more']
1228 include_directories : includes,
1229 link_with : [lib_common,
1231 install_dir : usrbin_exec_dir,
1233 if not is_disabler(exe)
1235 manadocs += ['text-utils/hexdump.1.adoc']
1236 bashcompletions += ['hexdump']
1239 opt = not get_option('build-lsmem').disabled()
1243 include_directories : includes,
1244 link_with : [lib_common,
1246 install_dir : usrbin_exec_dir,
1248 build_by_default : opt)
1249 if opt and not is_disabler(exe)
1251 manadocs += ['sys-utils/lsmem.1.adoc']
1252 bashcompletions += ['lsmem']
1255 opt = not get_option('build-chmem').disabled()
1259 include_directories : includes,
1260 link_with : [lib_common],
1261 install_dir : usrbin_exec_dir,
1263 build_by_default : opt)
1264 if opt and not is_disabler(exe)
1266 manadocs += ['sys-utils/chmem.8.adoc']
1267 bashcompletions += ['chmem']
1273 include_directories : includes,
1274 link_with : [lib_common],
1275 install_dir : usrbin_exec_dir,
1278 manadocs += ['sys-utils/choom.1.adoc']
1283 include_directories : includes,
1284 link_with : [lib_common],
1285 install_dir : usrbin_exec_dir,
1288 manadocs += ['sys-utils/ipcmk.1.adoc']
1289 bashcompletions += ['ipcmk']
1294 include_directories : includes,
1295 link_with : [lib_common],
1296 install_dir : usrbin_exec_dir,
1299 manadocs += ['sys-utils/ipcrm.1.adoc']
1300 bashcompletions += ['ipcrm']
1302 opt = not get_option('build-ipcs').disabled()
1306 include_directories : includes,
1307 link_with : [lib_common],
1308 install_dir : usrbin_exec_dir,
1310 build_by_default : opt)
1311 if opt and not is_disabler(exe)
1313 manadocs += ['sys-utils/ipcs.1.adoc']
1314 bashcompletions += ['ipcs']
1317 opt = not get_option('build-rfkill').disabled()
1321 include_directories : includes,
1322 link_with : [lib_common,
1324 install_dir : usrsbin_exec_dir,
1326 build_by_default : opt)
1327 if opt and not is_disabler(exe)
1329 manadocs += ['sys-utils/rfkill.8.adoc']
1330 bashcompletions += ['rfkill']
1336 include_directories : includes,
1337 link_with : [lib_common,
1339 install_dir : usrbin_exec_dir,
1341 if not is_disabler(exe)
1343 manadocs += ['sys-utils/renice.1.adoc']
1344 bashcompletions += ['renice']
1350 include_directories : includes,
1351 link_with : [lib_common,
1353 install_dir : usrbin_exec_dir,
1355 if opt and not is_disabler(exe)
1357 manadocs += ['sys-utils/setsid.1.adoc']
1358 bashcompletions += ['setsid']
1363 readprofile_sources,
1364 include_directories : includes,
1365 link_with : [lib_common,
1367 install_dir : usrsbin_exec_dir,
1369 if not is_disabler(exe)
1371 manadocs += ['sys-utils/readprofile.8.adoc']
1372 bashcompletions += ['readprofile']
1375 opt = not get_option('build-tunelp').disabled()
1379 include_directories : includes,
1380 link_with : [lib_common],
1381 install_dir : usrsbin_exec_dir,
1383 build_by_default : opt)
1384 if opt and not is_disabler(exe)
1386 manadocs += ['sys-utils/tunelp.8.adoc']
1387 bashcompletions += ['tunelp']
1393 include_directories : includes,
1394 link_with : [lib_common,
1396 install_dir : sbindir,
1398 if not is_disabler(exe)
1400 manadocs += ['sys-utils/fstrim.8.adoc']
1401 bashcompletions += ['fstrim']
1407 include_directories : includes,
1408 link_with : [lib_common,
1411 if not is_disabler(exe)
1413 manadocs += ['sys-utils/dmesg.1.adoc']
1414 bashcompletions += ['dmesg']
1420 include_directories : dir_include,
1421 c_args : '-DTEST_DMESG',
1422 link_with : [lib_common,
1424 if not is_disabler(exe)
1431 include_directories : includes,
1432 link_with : [lib_common],
1433 install_dir : sbindir,
1436 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1437 bashcompletions += ['ctrlaltdel']
1442 include_directories : includes,
1443 install_dir : sbindir,
1446 manadocs += ['sys-utils/fsfreeze.8.adoc']
1447 bashcompletions += ['fsfreeze']
1452 include_directories : includes,
1453 link_with : [lib_common,
1455 install_dir : sbindir,
1458 manadocs += ['sys-utils/blkdiscard.8.adoc']
1459 bashcompletions += ['blkdiscard']
1464 include_directories : includes,
1465 link_with : [lib_common],
1466 install_dir : sbindir,
1469 manadocs += ['sys-utils/blkzone.8.adoc']
1470 bashcompletions += ['blkzone']
1475 include_directories : includes,
1476 link_with : [lib_common],
1477 install_dir : sbindir,
1480 manadocs += ['sys-utils/blkpr.8.adoc']
1485 include_directories : includes,
1486 link_with : [lib_common],
1487 install_dir : usrsbin_exec_dir,
1490 manadocs += ['sys-utils/ldattach.8.adoc']
1491 bashcompletions += ['ldattach']
1496 include_directories : includes,
1497 link_with : [lib_common],
1498 install_dir : usrsbin_exec_dir,
1501 manadocs += ['sys-utils/rtcwake.8.adoc']
1502 bashcompletions += ['rtcwake']
1507 include_directories : includes,
1508 link_with : [lib_common],
1509 install_dir : usrbin_exec_dir,
1512 manadocs += ['sys-utils/setarch.8.adoc']
1513 bashcompletions += ['setarch']
1515 setarch_links = ['uname26', 'linux32', 'linux64']
1516 setarch_links_arch = {
1517 's390x' : ['s390', 's390x'],
1519 'x86_64' : ['i386', 'x86_64'],
1520 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1521 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1522 'mips64' : ['mips', 'mips64', 'mips32'],
1523 'ia64' : ['i386', 'ia64'],
1524 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1526 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1528 foreach link: setarch_links
1529 meson.add_install_script(meson_make_symlink,
1531 join_paths(usrbin_exec_dir, link))
1532 manlinks += {link + '.8': 'setarch.8'}
1535 opt = not get_option('build-eject').disabled()
1539 include_directories : includes,
1540 link_with : [lib_common,
1542 install_dir : usrbin_exec_dir,
1544 build_by_default : opt)
1545 if opt and not is_disabler(exe)
1547 manadocs += ['sys-utils/eject.1.adoc']
1548 bashcompletions += ['eject']
1551 opt = not get_option('build-losetup').disabled()
1555 include_directories : includes,
1556 link_with : [lib_common,
1558 install_dir : sbindir,
1560 build_by_default : opt)
1561 if opt and not is_disabler(exe)
1562 manadocs += ['sys-utils/losetup.8.adoc']
1564 bashcompletions += ['losetup']
1567 opt = opt and 'losetup' in static_programs
1571 include_directories : includes,
1572 link_args : ['--static'],
1573 link_with : [lib_common,
1574 lib_smartcols.get_static_lib()],
1575 install_dir : sbindir,
1577 build_by_default : opt)
1578 if opt and not is_disabler(exe)
1582 opt = not get_option('build-zramctl').disabled()
1586 include_directories : includes,
1587 link_with : [lib_common,
1589 install_dir : sbindir,
1591 build_by_default : opt)
1592 if opt and not is_disabler(exe)
1594 manadocs += ['sys-utils/zramctl.8.adoc']
1595 bashcompletions += ['zramctl']
1601 include_directories : includes,
1602 link_with : [lib_common,
1604 install_dir : usrbin_exec_dir,
1606 if not is_disabler(exe)
1608 manadocs += ['sys-utils/prlimit.1.adoc']
1609 bashcompletions += ['prlimit']
1615 include_directories : includes,
1616 link_with : [lib_common,
1619 install_dir : usrbin_exec_dir,
1621 if not is_disabler(exe)
1623 manadocs += ['sys-utils/lsns.8.adoc']
1624 bashcompletions += ['lsns']
1627 opt = not get_option('build-mount').disabled()
1631 include_directories : includes,
1632 link_with : [lib_common,
1635 dependencies : lib_selinux,
1636 install_mode : 'rwsr-xr-x',
1638 build_by_default : opt)
1642 include_directories : includes,
1643 link_with : [lib_common,
1645 install_mode : 'rwsr-xr-x',
1647 build_by_default : opt)
1648 if opt and not is_disabler(exe)
1650 manadocs += ['sys-utils/fstab.5.adoc',
1651 'sys-utils/mount.8.adoc',
1652 'sys-utils/umount.8.adoc']
1653 bashcompletions += ['mount', 'umount']
1656 opt2 = opt and 'mount' in static_programs
1660 include_directories : includes,
1661 link_args : ['--static'],
1662 link_with : [lib_common,
1663 lib_smartcols_static,
1666 build_by_default : opt2)
1667 if opt2 and not is_disabler(exe)
1671 opt2 = opt and 'umount' in static_programs
1675 include_directories : includes,
1676 link_args : ['--static'],
1677 link_with : [lib_common,
1680 build_by_default : opt2)
1681 if opt2 and not is_disabler(exe)
1690 include_directories : includes,
1691 link_with : [lib_common,
1695 install_dir : sbindir,
1697 if not is_disabler(exe)
1699 manadocs += ['sys-utils/swapon.8.adoc']
1700 bashcompletions += ['swapon']
1706 include_directories : includes,
1707 link_with : [lib_common,
1710 install_dir : sbindir,
1712 if not is_disabler(exe)
1714 manlinks += {'swapoff.8': 'swapon.8'}
1715 bashcompletions += ['swapoff']
1721 include_directories : includes,
1722 link_with : [lib_common,
1724 dependencies : [rtas_libs],
1725 install_dir : usrbin_exec_dir,
1727 if not is_disabler(exe)
1729 manadocs += ['sys-utils/lscpu.1.adoc']
1730 bashcompletions += ['lscpu']
1736 include_directories : includes,
1737 link_with : [lib_common],
1738 install_dir : sbindir,
1741 manadocs += ['sys-utils/chcpu.8.adoc']
1742 bashcompletions += ['chcpu']
1747 include_directories : includes,
1748 link_with : [lib_common,
1751 if not is_disabler(exe)
1753 manadocs += ['sys-utils/wdctl.8.adoc']
1754 bashcompletions += ['wdctl']
1757 opt = not get_option('build-mountpoint').disabled()
1761 include_directories : includes,
1762 link_with : [lib_mount],
1764 build_by_default : opt)
1765 if opt and not is_disabler(exe)
1767 manadocs += ['sys-utils/mountpoint.1.adoc']
1768 bashcompletions += ['mountpoint']
1771 opt = not get_option('build-fallocate').disabled()
1775 include_directories : includes,
1776 link_with : [lib_common],
1777 install_dir : usrbin_exec_dir,
1779 build_by_default : opt)
1780 if opt and not is_disabler(exe)
1782 manadocs += ['sys-utils/fallocate.1.adoc']
1783 bashcompletions += ['fallocate']
1786 opt = not get_option('build-pivot_root').disabled()
1790 include_directories : includes,
1791 install_dir : sbindir,
1793 build_by_default : opt)
1794 if opt and not is_disabler(exe)
1796 manadocs += ['sys-utils/pivot_root.8.adoc']
1797 bashcompletions += ['pivot_root']
1800 opt = not get_option('build-switch_root').disabled()
1801 if opt and not have_dirfd and not have_ddfd
1802 error('neither dirfd nor ddfd are available')
1806 switch_root_sources,
1807 include_directories : includes,
1808 install_dir : sbindir,
1810 build_by_default : opt)
1811 if opt and not is_disabler(exe)
1813 manadocs += ['sys-utils/switch_root.8.adoc']
1816 opt = not get_option('build-unshare').disabled()
1820 include_directories : includes,
1821 link_with : [lib_common],
1822 install_dir : usrbin_exec_dir,
1824 build_by_default : opt)
1825 if opt and not is_disabler(exe)
1827 manadocs += ['sys-utils/unshare.1.adoc']
1828 bashcompletions += ['unshare']
1831 opt = opt and 'unshare' in static_programs
1835 include_directories : includes,
1836 link_with : [lib_common],
1837 install_dir : usrbin_exec_dir,
1839 build_by_default : opt)
1840 if opt and not is_disabler(exe)
1844 opt = not get_option('build-nsenter').disabled()
1848 include_directories : includes,
1849 link_with : [lib_common],
1850 dependencies : [lib_selinux],
1851 install_dir : usrbin_exec_dir,
1853 build_by_default : opt)
1854 if opt and not is_disabler(exe)
1856 manadocs += ['sys-utils/nsenter.1.adoc']
1857 bashcompletions += ['nsenter']
1860 opt = opt and 'nsenter' in static_programs
1864 include_directories : includes,
1865 link_with : [lib_common],
1866 dependencies : [lib_selinux],
1867 install_dir : usrbin_exec_dir,
1869 build_by_default : opt)
1870 if opt and not is_disabler(exe)
1874 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1878 include_directories : includes,
1879 link_with : [lib_common],
1880 dependencies : [lib_cap_ng],
1881 install_dir : usrbin_exec_dir,
1883 build_by_default : opt)
1884 if opt and not is_disabler(exe)
1886 manadocs += ['sys-utils/setpriv.1.adoc']
1887 bashcompletions += ['setpriv']
1893 include_directories : includes,
1894 link_with : [lib_common],
1895 dependencies : realtime_libs,
1896 install_dir : usrbin_exec_dir,
1899 manadocs += ['sys-utils/flock.1.adoc']
1900 bashcompletions += ['flock']
1902 opt = not get_option('build-lsirq').disabled()
1906 include_directories : includes,
1907 link_with : [lib_common,
1909 install_dir : usrbin_exec_dir,
1911 build_by_default : opt)
1912 if opt and not is_disabler(exe)
1914 manadocs += ['sys-utils/lsirq.1.adoc']
1915 bashcompletions += ['lsirq']
1918 opt = not get_option('build-irqtop').disabled()
1922 include_directories : includes,
1923 dependencies : [realtime_libs, curses_libs],
1924 link_with : [lib_common,
1927 install_dir : usrbin_exec_dir,
1929 build_by_default : opt)
1930 if opt and not is_disabler(exe)
1932 manadocs += ['sys-utils/irqtop.1.adoc']
1933 bashcompletions += ['irqtop']
1936 opt = not get_option('build-ipcs').disabled()
1940 include_directories : includes,
1941 link_with : [lib_common,
1943 install_dir : usrbin_exec_dir,
1945 build_by_default : opt)
1946 if opt and not is_disabler(exe)
1948 manadocs += ['sys-utils/lsipc.1.adoc']
1949 bashcompletions += ['lsipc']
1956 include_directories : includes,
1957 link_with : [lib_common],
1958 dependencies : [lib_m,
1960 install_dir : sbindir,
1962 build_by_default : opt)
1963 if opt and not is_disabler(exe)
1965 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1966 bashcompletions += ['hwclock']
1972 include_directories : includes,
1973 install_dir : sbindir,
1976 manadocs += ['disk-utils/mkfs.8.adoc']
1977 bashcompletions += ['mkfs']
1979 opt = not get_option('build-bfs').disabled()
1983 include_directories : includes,
1984 link_with : [lib_common],
1985 install_dir : sbindir,
1987 build_by_default : opt)
1988 if opt and not is_disabler(exe)
1990 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1991 bashcompletions += ['mkfs.bfs']
1997 include_directories : includes,
1998 link_with : [lib_common],
1999 install_dir : usrbin_exec_dir,
2002 manadocs += ['disk-utils/isosize.8.adoc']
2003 bashcompletions += ['isosize']
2008 include_directories : includes,
2009 link_with : [lib_common,
2012 dependencies: [lib_selinux],
2013 install_dir : sbindir,
2015 if opt and not is_disabler(exe)
2017 manadocs += ['disk-utils/mkswap.8.adoc']
2018 bashcompletions += ['mkswap']
2024 include_directories : includes,
2025 link_with : [lib_common,
2028 install_dir : sbindir,
2030 if opt and not is_disabler(exe)
2032 manadocs += ['disk-utils/swaplabel.8.adoc']
2033 bashcompletions += ['swaplabel']
2036 opt = not get_option('build-fsck').disabled()
2040 include_directories : includes,
2041 link_with : [lib_common,
2044 dependencies : realtime_libs,
2045 install_dir : sbindir,
2047 build_by_default : opt)
2048 if opt and not is_disabler(exe)
2050 manadocs += ['disk-utils/fsck.8.adoc']
2051 bashcompletions += ['fsck']
2054 opt = not get_option('build-minix').disabled()
2058 include_directories : includes,
2059 link_with : [lib_common],
2060 install_dir : sbindir,
2062 build_by_default : opt)
2066 include_directories : includes,
2067 c_args : '-DTEST_SCRIPT',
2068 link_with : [lib_common],
2069 build_by_default : opt)
2073 include_directories : includes,
2074 link_with : [lib_common],
2075 install_dir : sbindir,
2077 build_by_default : opt)
2078 if opt and not is_disabler(exe)
2079 exes += [exe, exe2, exe3]
2080 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2081 bashcompletions += ['mkfs.minix', 'fsck.minix']
2084 opt = not get_option('build-cramfs').disabled()
2087 mkfs_cramfs_sources,
2088 include_directories : includes,
2089 link_with : [lib_common],
2090 dependencies : [lib_z],
2091 install_dir : sbindir,
2093 build_by_default : opt)
2096 fsck_cramfs_sources,
2097 include_directories : includes,
2098 link_with : [lib_common],
2099 dependencies : [lib_z],
2100 install_dir : sbindir,
2102 build_by_default : opt)
2103 if not is_disabler(exe)
2105 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2106 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2109 opt = not get_option('build-raw').disabled()
2111 cc.has_header('linux/raw.h', required: opt)
2116 include_directories : includes,
2117 install_dir : sbindir,
2119 build_by_default : opt)
2120 if opt and not is_disabler(exe)
2122 manadocs += ['disk-utils/raw.8.adoc']
2123 bashcompletions += ['raw']
2126 opt = not get_option('build-fdformat').disabled()
2130 include_directories : includes,
2131 link_with : [lib_common],
2132 install_dir : usrsbin_exec_dir,
2134 build_by_default : opt)
2135 if opt and not is_disabler(exe)
2137 manadocs += ['disk-utils/fdformat.8.adoc']
2143 include_directories : includes,
2144 link_with : [lib_common],
2145 install_dir : sbindir,
2147 manadocs += ['disk-utils/blockdev.8.adoc']
2148 bashcompletions += ['blockdev']
2150 opt = not get_option('build-fdisks').disabled()
2151 if opt and not have_dirfd and not have_ddfd
2152 error('neither dirfd nor ddfd are available')
2157 include_directories : includes,
2158 link_with : [lib_common,
2162 dependencies : [lib_readline],
2163 install_dir : sbindir,
2165 build_by_default : opt)
2166 if opt and not is_disabler(exe)
2168 bashcompletions += ['fdisk']
2171 opt2 = opt and 'fdisk' in static_programs
2175 link_args : ['--static'],
2176 include_directories : includes,
2177 link_with : [lib_common,
2180 lib_smartcols.get_static_lib()],
2181 dependencies : [lib_readline_static],
2182 install_dir : sbindir,
2184 build_by_default : opt2)
2185 if opt2 and not is_disabler(exe)
2192 include_directories : includes,
2193 link_with : [lib_common,
2197 dependencies : [lib_readline],
2198 install_dir : sbindir,
2200 build_by_default : opt)
2201 if opt and not is_disabler(exe)
2203 bashcompletions += ['sfdisk']
2206 opt2 = opt and 'sfdisk' in static_programs
2210 include_directories : includes,
2211 link_with : [lib_common,
2214 lib_smartcols.get_static_lib()],
2215 dependencies : [lib_readline_static],
2216 install_dir : sbindir,
2218 build_by_default : opt2)
2219 if opt2 and not is_disabler(exe)
2226 include_directories : includes,
2227 link_with : [lib_common,
2232 dependencies : [curses_libs],
2233 install_dir : sbindir,
2235 build_by_default : opt)
2236 if opt and not is_disabler(exe)
2238 manadocs += ['disk-utils/fdisk.8.adoc',
2239 'disk-utils/sfdisk.8.adoc',
2240 'disk-utils/cfdisk.8.adoc']
2241 bashcompletions += ['cfdisk']
2244 opt = not get_option('build-partx').disabled()
2248 include_directories : includes,
2249 link_with : [lib_common],
2250 install_dir : usrsbin_exec_dir,
2252 build_by_default : opt)
2256 include_directories : includes,
2257 link_with : [lib_common],
2258 install_dir : usrsbin_exec_dir,
2260 build_by_default : opt)
2264 include_directories : includes,
2265 link_with : [lib_common],
2266 install_dir : usrsbin_exec_dir,
2268 build_by_default : opt)
2272 include_directories : includes,
2273 link_with : [lib_common,
2276 install_dir : usrsbin_exec_dir,
2278 build_by_default : opt)
2280 exes += [exe, exe2, exe3, exe4]
2281 manadocs += ['disk-utils/addpart.8.adoc',
2282 'disk-utils/delpart.8.adoc',
2283 'disk-utils/resizepart.8.adoc',
2284 'disk-utils/partx.8.adoc']
2285 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2288 ############################################################
2293 include_directories : includes,
2294 link_with : [lib_common],
2295 dependencies : [lib_util,
2299 install_dir : usrbin_exec_dir,
2302 manadocs += ['term-utils/script.1.adoc']
2303 bashcompletions += ['script']
2308 include_directories : includes,
2309 c_args : '-DTEST_SCRIPT',
2310 link_with : [lib_common],
2311 dependencies : [lib_util,
2320 include_directories : includes,
2321 link_with : [lib_common],
2322 dependencies : [lib_util,
2325 install_dir : usrbin_exec_dir,
2328 manadocs += ['term-utils/scriptlive.1.adoc']
2329 bashcompletions += ['scriptlive']
2333 scriptreplay_sources,
2334 include_directories : includes,
2335 link_with : [lib_common],
2336 dependencies : [math_libs],
2337 install_dir : usrbin_exec_dir,
2340 manadocs += ['term-utils/scriptreplay.1.adoc']
2341 bashcompletions += ['scriptreplay']
2343 opt = not get_option('build-agetty').disabled()
2347 include_directories : includes,
2348 link_with : [lib_common, logindefs_c],
2349 dependencies : BSD ? lib_util : [],
2350 install_dir : sbindir,
2352 build_by_default : opt)
2355 manadocs += ['term-utils/agetty.8.adoc']
2358 opt = not get_option('build-setterm').disabled()
2362 include_directories : includes,
2363 link_with : [lib_common],
2364 dependencies : [curses_libs],
2365 install_dir : usrbin_exec_dir,
2367 build_by_default : opt)
2370 manadocs += ['term-utils/setterm.1.adoc']
2371 bashcompletions += ['setterm']
2374 opt = not get_option('build-mesg').disabled()
2378 include_directories : includes,
2379 link_with : [lib_common],
2380 install_dir : usrbin_exec_dir,
2382 build_by_default : opt)
2385 manadocs += ['term-utils/mesg.1.adoc']
2386 bashcompletions += ['mesg']
2389 opt = not get_option('build-wall').disabled()
2393 include_directories : includes,
2394 link_with : [lib_common],
2395 install_dir : usrbin_exec_dir,
2396 install_mode : 'rwxr-sr-x',
2398 build_by_default : opt)
2401 manadocs += ['term-utils/wall.1.adoc']
2402 bashcompletions += ['wall']
2405 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2406 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2408 opt = not get_option('build-write').disabled()
2412 include_directories : includes,
2413 link_with : [lib_common],
2414 install_dir : usrbin_exec_dir,
2415 install_mode : 'rwxr-sr-x',
2417 build_by_default : opt)
2420 manadocs += ['term-utils/write.1.adoc']
2421 bashcompletions += ['write']
2424 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2425 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2427 opt = not get_option('build-login').disabled()
2431 include_directories : includes,
2432 link_with : [lib_common, logindefs_c],
2433 dependencies : [lib_pam,
2437 build_by_default : opt)
2438 if not is_disabler(exe)
2440 manadocs += ['login-utils/login.1.adoc']
2443 opt = not get_option('build-sulogin').disabled()
2447 include_directories : includes,
2448 link_with : [lib_common],
2449 dependencies : [lib_crypt,
2451 install_dir : sbindir,
2453 build_by_default : opt)
2454 if not is_disabler(exe)
2456 manadocs += ['login-utils/sulogin.8.adoc']
2462 include_directories : includes,
2463 link_with : [lib_common,
2465 dependencies : [curses_libs],
2466 install_dir : usrbin_exec_dir,
2469 manadocs += ['misc-utils/cal.1.adoc']
2470 bashcompletions += ['cal']
2472 opt = not get_option('build-logger').disabled()
2476 include_directories : includes,
2477 link_with : [lib_common],
2478 dependencies : [lib_systemd],
2479 install_dir : usrbin_exec_dir,
2481 build_by_default : opt)
2482 if opt and not is_disabler(exe)
2484 manadocs += ['misc-utils/logger.1.adoc']
2485 bashcompletions += ['logger']
2491 include_directories : includes,
2492 c_args : '-DTEST_LOGGER',
2493 link_with : [lib_common],
2494 dependencies : [lib_systemd])
2495 if not is_disabler(exe)
2502 include_directories : includes,
2503 install_dir : usrbin_exec_dir,
2506 manadocs += ['misc-utils/look.1.adoc']
2507 bashcompletions += ['look']
2512 include_directories : includes,
2513 link_with : [lib_common],
2514 install_dir : usrbin_exec_dir,
2517 manadocs += ['misc-utils/mcookie.1.adoc']
2518 bashcompletions += ['mcookie']
2523 include_directories : includes,
2524 dependencies : [lib_selinux],
2525 install_dir : usrbin_exec_dir,
2528 manadocs += ['misc-utils/namei.1.adoc']
2529 bashcompletions += ['namei']
2534 include_directories : includes,
2535 link_with : [lib_common],
2536 install_dir : usrbin_exec_dir,
2539 manadocs += ['misc-utils/whereis.1.adoc']
2540 bashcompletions += ['whereis']
2545 include_directories : includes,
2546 link_with : [lib_common,
2549 install_dir : usrbin_exec_dir,
2551 if not is_disabler(exe)
2553 manadocs += ['misc-utils/lslocks.8.adoc']
2554 bashcompletions += ['lslocks']
2560 include_directories : includes,
2561 link_with : [lib_common,
2565 dependencies : lib_udev,
2567 if not is_disabler(exe)
2569 manadocs += ['misc-utils/lsblk.8.adoc']
2570 bashcompletions += ['lsblk']
2576 include_directories : includes,
2577 link_with : [lib_common,
2579 install_dir : usrbin_exec_dir,
2581 if not is_disabler(exe)
2583 manadocs += ['misc-utils/lsfd.1.adoc']
2589 include_directories : includes,
2590 link_with : [lib_uuid],
2591 install_dir : usrbin_exec_dir,
2593 if not is_disabler(exe)
2595 manadocs += ['misc-utils/uuidgen.1.adoc']
2596 bashcompletions += ['uuidgen']
2602 include_directories : includes,
2603 link_with : [lib_common,
2606 install_dir : usrbin_exec_dir,
2608 if not is_disabler(exe)
2610 manadocs += ['misc-utils/uuidparse.1.adoc']
2611 bashcompletions += ['uuidparse']
2618 include_directories : includes,
2619 link_with : [lib_common,
2621 dependencies : [realtime_libs,
2623 install_dir : usrsbin_exec_dir,
2625 build_by_default : opt)
2629 include_directories : includes,
2630 link_with : [lib_common,
2632 dependencies : thread_libs,
2633 build_by_default : opt)
2634 if not is_disabler(exe)
2636 manadocs += ['misc-utils/uuidd.8.adoc']
2637 bashcompletions += ['uuidd']
2640 opt = build_libblkid
2644 include_directories : includes,
2645 link_with : [lib_common,
2647 install_dir : sbindir,
2649 build_by_default : opt)
2650 if opt and not is_disabler(exe)
2652 manadocs += ['misc-utils/blkid.8.adoc']
2653 bashcompletions += ['blkid']
2656 opt = opt and 'blkid' in static_programs
2660 include_directories : includes,
2661 link_with : [lib_common,
2663 install_dir : sbindir,
2665 build_by_default : opt)
2666 if opt and not is_disabler(exe)
2672 'libblkid/samples/mkfs.c',
2673 include_directories : includes,
2674 link_with : lib_blkid)
2675 if not is_disabler(exe)
2680 'sample-partitions',
2681 'libblkid/samples/partitions.c',
2682 include_directories : includes,
2683 link_with : lib_blkid)
2684 if not is_disabler(exe)
2689 'sample-superblocks',
2690 'libblkid/samples/superblocks.c',
2691 include_directories : includes,
2692 link_with : lib_blkid)
2693 if not is_disabler(exe)
2699 'libblkid/samples/topology.c',
2700 include_directories : includes,
2701 link_with : lib_blkid)
2702 if not is_disabler(exe)
2707 'test_blkid_fuzz_sample',
2708 'libblkid/src/fuzz.c',
2709 include_directories: includes,
2710 link_with: lib_blkid)
2711 if not is_disabler(exe)
2715 ############################################################
2720 include_directories : includes,
2721 link_with : [lib_blkid],
2722 install_dir : sbindir,
2724 if not is_disabler(exe)
2726 manadocs += ['misc-utils/findfs.8.adoc']
2727 bashcompletions += ['findfs']
2733 include_directories : includes,
2734 link_with : [lib_common,
2737 install_dir : sbindir,
2739 if not is_disabler(exe)
2741 manadocs += ['misc-utils/wipefs.8.adoc']
2742 bashcompletions += ['wipefs']
2748 include_directories : includes,
2749 link_with : [lib_common,
2753 dependencies : [lib_udev],
2755 if not is_disabler(exe)
2757 manadocs += ['misc-utils/findmnt.8.adoc']
2758 bashcompletions += ['findmnt']
2764 include_directories : includes,
2765 link_with : [lib_common],
2767 if not is_disabler(exe)
2769 manadocs += ['misc-utils/kill.1.adoc']
2772 opt = not get_option('build-rename').disabled()
2776 include_directories : includes,
2777 install_dir : usrbin_exec_dir,
2779 build_by_default : opt)
2780 if opt and not is_disabler(exe)
2782 manadocs += ['misc-utils/rename.1.adoc']
2783 bashcompletions += ['rename']
2789 include_directories : includes,
2790 link_with : [lib_common],
2791 install_dir : usrbin_exec_dir,
2794 manadocs += ['misc-utils/getopt.1.adoc']
2795 bashcompletions += ['getopt']
2800 include_directories : includes,
2801 link_with : [lib_common,
2803 install_dir : usrbin_exec_dir,
2805 if not is_disabler(exe)
2807 manadocs += ['misc-utils/fincore.1.adoc']
2808 bashcompletions += ['fincore']
2814 include_directories : includes,
2815 link_with : [lib_common],
2816 install_dir : usrbin_exec_dir,
2818 if not is_disabler(exe)
2820 manadocs += ['misc-utils/hardlink.1.adoc']
2821 bashcompletions += ['hardlink']
2824 opt = not get_option('build-pipesz').disabled()
2828 include_directories : includes,
2829 link_with : [lib_common],
2830 install_dir : usrbin_exec_dir,
2832 if opt and not is_disabler(exe)
2834 manadocs += ['misc-utils/pipesz.1.adoc']
2835 bashcompletions += ['pipesz']
2841 include_directories : includes,
2842 c_args : '-DTEST_CAL',
2843 link_with : [lib_common,
2845 dependencies : [curses_libs])
2846 if not is_disabler(exe)
2853 include_directories : includes,
2854 link_with : [lib_common],
2855 install_dir : usrbin_exec_dir,
2857 if not is_disabler(exe)
2859 manadocs += ['misc-utils/fadvise.1.adoc']
2860 bashcompletions += ['fadvise']
2863 if LINUX and conf.get('HAVE_PIDFD_OPEN') != false
2867 include_directories : includes,
2868 link_with : [lib_common],
2869 install_dir : usrbin_exec_dir,
2871 if not is_disabler(exe)
2873 manadocs += ['misc-utils/waitpid.1.adoc']
2874 bashcompletions += ['waitpid']
2878 syscalls_h = custom_target('syscalls.h',
2879 input : 'tools/all_syscalls',
2880 output : 'syscalls.h',
2881 command : ['bash', '@INPUT@', cc.cmd_array()],
2884 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
2887 'misc-utils/enosys.c', syscalls_h,
2888 include_directories : includes,
2889 link_with : [lib_common],
2890 install_dir : usrbin_exec_dir,
2892 if not is_disabler(exe)
2894 manadocs += ['misc-utils/enosys.1.adoc']
2895 bashcompletions += ['enosys']
2899 ############################################################
2901 opt = not get_option('build-schedutils').disabled()
2904 'schedutils/chrt.c',
2905 include_directories : includes,
2906 link_with : lib_common,
2907 install_dir : usrbin_exec_dir,
2909 build_by_default : opt)
2913 'schedutils/ionice.c',
2914 include_directories : includes,
2915 link_with : lib_common,
2916 install_dir : usrbin_exec_dir,
2918 build_by_default : opt)
2922 'schedutils/taskset.c',
2923 include_directories : includes,
2924 link_with : lib_common,
2925 install_dir : usrbin_exec_dir,
2927 build_by_default : opt)
2931 'schedutils/uclampset.c',
2932 include_directories : includes,
2933 link_with : lib_common,
2934 install_dir : usrbin_exec_dir,
2936 build_by_default : opt)
2938 if opt and not is_disabler(exe)
2939 exes += [exe, exe2, exe3, exe4]
2940 manadocs += ['schedutils/chrt.1.adoc',
2941 'schedutils/ionice.1.adoc',
2942 'schedutils/taskset.1.adoc',
2943 'schedutils/uclampset.1.adoc']
2944 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2947 ############################################################
2949 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2954 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2955 include_directories : dir_include,
2956 link_with : lib_common)
2962 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2963 include_directories : dir_include,
2964 link_with : lib_common)
2970 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2971 include_directories : dir_include,
2972 link_with : lib_common)
2978 c_args : ['-DTEST_PROGRAM_MANGLE'],
2979 include_directories : dir_include)
2985 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2986 include_directories : dir_include)
2992 'lib/color-names.c',
2993 c_args : ['-DTEST_PROGRAM_COLORS'],
2994 include_directories : dir_include,
2995 link_with : [lib_common, lib_tcolors])
3001 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
3002 include_directories : dir_include)
3005 if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false
3009 c_args : ['-DTEST_PROGRAM_PROCFS'],
3010 include_directories : dir_include,
3011 link_with : lib_common)
3018 have_cpu_set_t ? 'lib/cpuset.c' : [],
3019 c_args : ['-DTEST_PROGRAM_PATH'],
3020 include_directories : dir_include,
3021 link_with : lib_common)
3025 if conf.get('HAVE_PTY') != false
3030 c_args : ['-DTEST_PROGRAM_PTY'],
3031 include_directories : dir_include,
3032 link_with : [lib_common],
3033 dependencies : [lib_m,
3043 c_args : ['-DTEST_PROGRAM_CPUSET'],
3044 include_directories : dir_include)
3055 have_cpu_set_t ? 'lib/cpuset.c' : [],
3056 c_args : ['-DTEST_PROGRAM_SYSFS'],
3057 include_directories : dir_include)
3063 c_args : ['-DTEST_PROGRAM_PAGER'],
3064 include_directories : dir_include)
3068 'test_linux_version',
3069 'lib/linux_version.c',
3070 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3071 include_directories : dir_include)
3077 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3078 include_directories : dir_include)
3082 'test_canonicalize',
3083 'lib/canonicalize.c',
3084 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3085 include_directories : dir_include)
3092 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3093 include_directories : dir_include)
3099 c_args : ['-DTEST_PROGRAM'],
3100 include_directories : dir_include,
3101 link_with : lib_common)
3107 c_args : ['-DTEST_PROGRAM'],
3108 include_directories : dir_include,
3109 link_with : [lib_common, logindefs_c])
3113 ############################################################
3117 'libuuid/src/test_uuid.c',
3118 include_directories : [dir_include, dir_libuuid],
3119 link_with : lib_uuid,
3120 dependencies : socket_libs)
3121 if not is_disabler(exe)
3125 ############################################################
3127 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3129 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3133 'libfdisk/src/ask.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/gpt.c',
3144 c_args : libfdisk_tests_cflags,
3145 include_directories : lib_fdisk_includes,
3146 link_with : libfdisk_tests_ldadd)
3147 if not is_disabler(exe)
3153 'libfdisk/src/utils.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_script',
3163 'libfdisk/src/script.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)
3172 'test_fdisk_version',
3173 'libfdisk/src/version.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)
3183 'libfdisk/src/item.c',
3184 c_args : libfdisk_tests_cflags,
3185 include_directories : lib_fdisk_includes,
3186 link_with : libfdisk_tests_ldadd)
3187 if not is_disabler(exe)
3191 sample_fdisk_cflags = ['-Wno-unused']
3192 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3195 'sample-fdisk-mkpart',
3196 'libfdisk/samples/mkpart.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)
3205 'sample-fdisk-mkpart-fullspec',
3206 'libfdisk/samples/mkpart-fullspec.c',
3207 c_args : sample_fdisk_cflags,
3208 include_directories : lib_fdisk_includes,
3209 link_with : sample_fdisk_ldadd)
3210 if not is_disabler(exe)
3214 ############################################################
3218 'tests/helpers/test_mbsencode.c',
3219 include_directories : includes,
3220 link_with : lib_common)
3225 'tests/helpers/test_byteswap.c',
3226 include_directories : includes)
3231 'tests/helpers/test_md5.c',
3233 include_directories : includes)
3238 'tests/helpers/test_sha1.c',
3240 include_directories : includes)
3245 'tests/helpers/test_pathnames.c',
3246 include_directories : includes)
3251 'tests/helpers/test_strerror.c',
3252 include_directories : includes)
3257 'tests/helpers/test_sysinfo.c',
3258 include_directories : includes)
3263 'tests/helpers/test_sigreceive.c',
3264 include_directories : includes,
3265 link_with : lib_common)
3270 'tests/helpers/test_tiocsti.c',
3271 include_directories : includes)
3275 'test_uuid_namespace',
3276 'tests/helpers/test_uuid_namespace.c',
3280 include_directories : includes)
3284 mq_libs += cc.find_library('rt', required : true)
3289 'tests/helpers/test_mkfds.c',
3290 include_directories : includes,
3291 dependencies : mq_libs)
3297 'tests/helpers/test_enosys.c',
3298 include_directories : includes)
3301 ############################################################
3303 if conf.get('HAVE_OPENAT') != false
3305 'sample-scols-tree',
3306 'libsmartcols/samples/tree.c',
3307 include_directories : includes,
3308 link_with : [lib_smartcols, lib_common])
3309 if not is_disabler(exe)
3315 'sample-scols-title',
3316 'libsmartcols/samples/title.c',
3317 include_directories : includes,
3318 link_with : [lib_smartcols, lib_common])
3319 if not is_disabler(exe)
3324 'sample-scols-wrap',
3325 'libsmartcols/samples/wrap.c',
3326 include_directories : includes,
3327 link_with : [lib_smartcols, lib_common])
3328 if not is_disabler(exe)
3333 'sample-scols-continuous',
3334 'libsmartcols/samples/continuous.c',
3335 include_directories : includes,
3336 link_with : [lib_smartcols, lib_common])
3337 if not is_disabler(exe)
3342 'sample-scols-maxout',
3343 'libsmartcols/samples/maxout.c',
3344 include_directories : includes,
3345 link_with : [lib_smartcols, lib_common])
3346 if not is_disabler(exe)
3351 'sample-scols-fromfile',
3352 'libsmartcols/samples/fromfile.c',
3353 include_directories : includes,
3354 link_with : [lib_smartcols, lib_common])
3355 if not is_disabler(exe)
3360 'sample-scols-grouping-simple',
3361 'libsmartcols/samples/grouping-simple.c',
3362 include_directories : includes,
3363 link_with : [lib_smartcols, lib_common])
3364 if not is_disabler(exe)
3369 'sample-scols-grouping-overlay',
3370 'libsmartcols/samples/grouping-overlay.c',
3371 include_directories : includes,
3372 link_with : [lib_smartcols, lib_common])
3373 if not is_disabler(exe)
3377 ############################################################
3379 # Let the test runner know whether we're running under asan and export
3380 # some paths. We use a file on disk so that it is possible to run the
3381 # test scripts from commandline without setting any variables.
3382 configure_file(output : 'meson.conf',
3387 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3388 python.full_path())])
3390 run_sh = find_program('tests/run.sh')
3394 '--srcdir=' + meson.current_source_dir(),
3395 '--builddir=' + meson.current_build_dir(),
3401 manadocs += ['lib/terminal-colors.d.5.adoc']
3402 manadocs += ['libblkid/libblkid.3.adoc']
3406 'libuuid/man/uuid.3.adoc',
3407 'libuuid/man/uuid_clear.3.adoc',
3408 'libuuid/man/uuid_compare.3.adoc',
3409 'libuuid/man/uuid_copy.3.adoc',
3410 'libuuid/man/uuid_generate.3.adoc',
3411 'libuuid/man/uuid_is_null.3.adoc',
3412 'libuuid/man/uuid_parse.3.adoc',
3413 'libuuid/man/uuid_time.3.adoc',
3414 'libuuid/man/uuid_unparse.3.adoc']
3416 'uuid_generate_random.3': 'uuid_generate.3',
3417 'uuid_generate_time.3': 'uuid_generate.3',
3418 'uuid_generate_time_safe.3': 'uuid_generate.3',
3422 asciidoctor = find_program('asciidoctor', required : false)
3423 if asciidoctor.found()
3424 foreach adoc : manadocs
3425 name = adoc.split('/')[-1]
3426 page = name.split('.adoc')[0]
3427 section = page.split('.')[-1]
3428 mandirn = join_paths(mandir, 'man' + section)
3433 command : [ asciidoctor,
3435 '-a', 'VERSION=' + meson.project_version(),
3436 '-a', 'release-version=' + meson.project_version(),
3437 '-a', 'ADJTIME_PATH=/etc/adjtime',
3438 '-a', 'package-docdir=' + docdir,
3439 '--base-dir=' + meson.current_source_dir(),
3440 '--destination-dir=' + meson.current_build_dir(),
3441 '--load-path', '@SOURCE_ROOT@/tools',
3442 '--require', 'asciidoctor-includetracker',
3446 depfile : page + '.deps',
3448 install_dir : mandirn)
3451 foreach link_name, target : manlinks
3452 link_section = link_name.split('.')[-1]
3453 target_section = target.split('.')[-1]
3454 meson.add_install_script(meson_make_manpage_stub,
3455 join_paths('man' + target_section, target),
3456 join_paths(mandir, 'man' + link_section, link_name))
3460 if bash_completion.found()
3461 foreach completion : bashcompletions
3463 join_paths('bash-completion', completion),
3464 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3467 foreach link_name, target : bashcompletionslinks
3468 meson.add_install_script(meson_make_symlink,
3470 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))