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
223 lib_m = cc.find_library('m')
225 lib_tinfo = dependency(
227 required : get_option('tinfo'))
229 lib_ncursesw = dependency(
231 required : get_option('ncursesw'))
232 if lib_ncursesw.found()
233 headers += ['ncursesw/ncurses.h',
237 lib_ncurses = disabler()
239 lib_ncurses = dependency(
241 required : get_option('ncurses'))
242 headers += ['ncurses.h',
246 conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
247 conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
248 conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
250 lib_slang = dependency(
252 required : get_option('slang'))
254 headers += ['slang.h',
259 conf.set('HAVE_SLANG', lib_slang.found())
261 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
262 if curses_libs.found()
263 have = cc.has_function('use_default_colors', dependencies : curses_libs)
264 conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false)
265 have = cc.has_function('resizeterm', dependencies : curses_libs)
266 conf.set('HAVE_RESIZETERM', have ? 1 : false)
273 required : get_option('zlib'))
275 lib_readline = dependency(
277 required : get_option('readline'))
278 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
280 lib_readline_static = dependency(
283 required : need_static_libs ? get_option('readline') : disabler())
285 if meson.version().version_compare('>= 0.59.0')
286 lib_intl = dependency(
288 required : get_option('nls'))
289 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
291 if get_option('nls').enabled()
292 error('nls is not supported with meson before 0.59.0')
294 lib_intl = dependency('', required : false)
297 lib_user = dependency(
300 required : get_option('libuser'))
301 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
303 lib_util = cc.find_library(
305 required : get_option('libutil'))
306 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
308 lib_utempter = cc.find_library(
310 required : get_option('libutempter'))
311 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
313 systemd = dependency(
315 required : get_option('systemd'))
317 lib_systemd = dependency(
319 required : get_option('systemd'))
320 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
321 conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false)
323 lib_udev = dependency(
325 required : get_option('systemd'))
326 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
328 lib_crypt = cc.find_library('crypt')
330 lib_pam = cc.find_library('pam', required : get_option('build-login'))
331 if not lib_pam.found()
332 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
334 if not lib_pam.found()
335 lib_pam = cc.find_library('pam', required : get_option('build-su'))
337 if not lib_pam.found()
338 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
341 lib_pam_misc = cc.find_library('pam_misc')
342 lib_pam = [lib_pam, lib_pam_misc]
344 lib_pam_misc = declare_dependency()
347 lib_cryptsetup = dependency(
349 required : get_option('cryptsetup'))
350 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
352 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
353 if meson.version().version_compare('>= 0.62.0')
354 lib_dl = dependency('dl')
356 lib_dl = cc.find_library('dl')
358 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
359 summary('cryptsetup support (dlopen)',
361 section : 'components')
363 summary('cryptsetup support',
364 lib_cryptsetup.found() ? 'enabled' : 'disabled',
365 section : 'components')
368 have = cc.has_function(
369 'crypt_activate_by_signed_key',
370 dependencies : lib_cryptsetup)
371 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
373 lib_cap_ng = dependency(
375 required : get_option('build-setpriv'))
377 lib_selinux = dependency(
380 required : get_option('selinux'))
381 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
383 lib_magic = dependency(
385 required : get_option('magic'))
386 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
388 lib_econf = dependency(
390 required : get_option('econf'))
391 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
393 lib_audit = dependency(
395 required : get_option('audit'))
396 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
398 conf.set('HAVE_SMACK', not get_option('smack').disabled())
400 foreach header : headers
401 have = cc.has_header(header)
402 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
405 header = 'linux/btrfs.h'
406 enable_btrfs = cc.has_header(header,
407 required : get_option('btrfs'))
408 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
409 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
411 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
416 have = cc.has_header(header,
418 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
421 have = cc.has_header('sched.h')
422 conf.set10('HAVE_DECL_CPU_ALLOC', have)
423 # We get -1 if the size cannot be determined
424 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
425 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
427 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
428 conf.set10('HAVE_ENVIRON_DECL', have)
430 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
431 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
433 have = cc.has_function('strsignal')
434 conf.set10('HAVE_STRSIGNAL_DECL', have)
436 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
437 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
439 have = cc.has_type('loff_t', prefix : '#include <sys/types.h>')
440 conf.set('HAVE_LOFF_T', have ? 1 : false)
442 have = cc.compiles('''
443 #define _GNU_SOURCE 1
444 #include <langinfo.h>
447 str = nl_langinfo (ALTMON_1);
448 str = nl_langinfo (ALTMON_2);
449 str = nl_langinfo (ALTMON_3);
450 str = nl_langinfo (ALTMON_4);
451 str = nl_langinfo (ALTMON_5);
452 str = nl_langinfo (ALTMON_6);
453 str = nl_langinfo (ALTMON_7);
454 str = nl_langinfo (ALTMON_8);
455 str = nl_langinfo (ALTMON_9);
456 str = nl_langinfo (ALTMON_10);
457 str = nl_langinfo (ALTMON_11);
458 str = nl_langinfo (ALTMON_12);
462 name : 'langinfo.h defines ALTMON_x constants')
463 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
465 have = cc.compiles('''
466 #define _GNU_SOURCE 1
467 #include <langinfo.h>
470 str = nl_langinfo (_NL_ABALTMON_1);
471 str = nl_langinfo (_NL_ABALTMON_2);
472 str = nl_langinfo (_NL_ABALTMON_3);
473 str = nl_langinfo (_NL_ABALTMON_4);
474 str = nl_langinfo (_NL_ABALTMON_5);
475 str = nl_langinfo (_NL_ABALTMON_6);
476 str = nl_langinfo (_NL_ABALTMON_7);
477 str = nl_langinfo (_NL_ABALTMON_8);
478 str = nl_langinfo (_NL_ABALTMON_9);
479 str = nl_langinfo (_NL_ABALTMON_10);
480 str = nl_langinfo (_NL_ABALTMON_11);
481 str = nl_langinfo (_NL_ABALTMON_12);
485 name : 'langinfo.h defines _NL_ABALTMON_x constants')
486 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
488 have = cc.compiles('''
489 #define _GNU_SOURCE 1
490 #include <langinfo.h>
493 str = nl_langinfo (_NL_TIME_WEEK_1STDAY);
497 name : 'langinfo.h defines _NL_TIME_WEEK_1STDAY constant')
498 conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false)
592 have = cc.has_function(func)
593 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
594 # This makes little sense, but is necessary to avoid warnings about
595 # redefined macros from Python.h, which uses this convention.
596 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
599 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
600 conf.set('AGETTY_RELOAD', have ? 1 : false)
602 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
605 have_dirfd = (cc.has_function('dirfd') or
606 cc.has_header_symbol('dirent.h', 'dirfd',
607 prefix : '#include <sys/types.h>'))
608 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
610 have_ddfd = cc.has_member('DIR', 'dd_fd',
612 #include <sys/types.h>
615 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
617 have = cc.has_member('struct tm', 'tm_gmtoff',
622 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
626 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
627 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
629 have = cc.has_member('struct termios', 'c_line',
630 prefix : '#include <termios.h>')
631 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
633 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
634 prefix : '#include <sys/stat.h>')
635 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
637 # replacement for AC_STRUCT_TIMEZONE
638 have = cc.has_member('struct tm', 'tm_zone',
639 prefix : '#include <time.h>')
640 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
642 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
643 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
645 have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY')
646 conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false)
648 have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY')
649 conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false)
654 extern char *tzname[];
657 return tzname ? 0 : 1;
659 '''.format(have ? 1 : 0)
660 have = cc.compiles(code, name : 'using tzname[]')
661 conf.set('HAVE_TZNAME', have ? 1 : false)
664 if not cc.has_function('socket')
665 socket_libs += cc.find_library('socket', required : true)
666 have = cc.has_function('socket',
667 dependencies : socket_libs)
669 error('socket() function not available')
674 have = cc.has_function('clock_gettime')
676 realtime_libs += cc.find_library('rt', required : true)
677 have = cc.has_function('clock_gettime',
678 dependencies : realtime_libs)
680 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
682 thread_libs = dependency('threads')
684 have = cc.has_function('timer_create')
686 realtime_libs = [cc.find_library('rt', required : true)]
687 have = cc.has_function('timer_create',
688 dependencies : realtime_libs)
690 realtime_libs += thread_libs
691 have = cc.has_function('timer_create',
692 dependencies : realtime_libs)
695 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
697 have = cc.has_function('setitimer')
698 conf.set('HAVE_SETITIMER', have ? 1 : false)
701 rtas_libs = cc.find_library('rtas', required : false)
702 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
705 if not cc.has_header_symbol('math.h', 'isnan')
706 lib = cc.find_library('m', required : true)
707 if (cc.has_function('isnan', dependencies : lib) and
708 cc.has_function('__isnan', dependencies : lib))
713 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
714 args : '-D_GNU_SOURCE')
715 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
718 extern char *__progname;
720 return (*__progname != 0);
723 have = cc.compiles(code, name : 'using __progname')
724 conf.set('HAVE___PROGNAME', have ? 1 : false)
726 have = conf.get('HAVE_PTY_H') != false and conf.get('HAVE_SYS_SIGNALFD_H') != false
727 conf.set('HAVE_PTY', have ? 1 : false)
729 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
730 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
732 build_plymouth_support = get_option('build-plymouth-support')
733 have_tiocglcktrmios = cc.has_header_symbol(
734 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
735 required : build_plymouth_support.enabled())
736 have_sock_cloexec = cc.has_header_symbol(
737 'sys/socket.h', 'SOCK_CLOEXEC',
738 prefix : '#include <sys/types.h>',
739 required : build_plymouth_support.enabled())
740 have_sock_nonblock = cc.has_header_symbol(
741 'sys/socket.h', 'SOCK_NONBLOCK',
742 prefix : '#include <sys/types.h>',
743 required : build_plymouth_support.enabled())
744 have_so_passcred = cc.has_header_symbol(
745 'sys/socket.h', 'SO_PASSCRED',
746 prefix : '#include <sys/types.h>',
747 required : build_plymouth_support.enabled())
749 build_plymouth_support = (not build_plymouth_support.disabled() and
750 have_tiocglcktrmios and
751 have_sock_cloexec and
752 have_sock_nonblock and
754 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
755 summary('plymouth support',
756 build_plymouth_support ? 'enabled' : 'disabled',
757 section : 'components')
759 # check for valid fallocate() function
760 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
761 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
762 # and program can't be linked.
770 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
771 return ret == 0 ? 0 : 1;
774 have = cc.links(code, name : 'fallocate() function')
775 conf.set('HAVE_FALLOCATE', have ? 1 : false)
783 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
784 return ret == 0 ? 0 : 1;
787 have = cc.links(code, name : 'posix_fallocate() function')
788 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
790 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
791 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
792 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
794 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
795 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
796 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
798 ############################################################
801 fs_search_path = get_option('fs-search-path')
802 fs_search_path_extra = get_option('fs-search-path-extra')
803 if fs_search_path_extra != ''
804 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
806 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
808 systemdsystemunitdir = ''
810 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
813 sysvinit = get_option('sysvinit').enabled()
814 sysvinitrcdir = sysconfdir + '/init.d'
816 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
817 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
819 have = get_option('chsh-only-listed')
820 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
822 have = get_option('use-tty-group')
823 conf.set('USE_TTY_GROUP', have ? 1 : false)
825 build_hwclock = not get_option('build-hwclock').disabled()
826 bison = find_program('bison', required: build_hwclock)
827 bison_gen = generator(
829 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
830 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
834 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
835 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
839 configuration : conf)
841 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
846 '-Waddress-of-packed-member',
847 '-Wdiscarded-qualifiers',
848 '-Wembedded-directive',
851 '-Wimplicit-function-declaration',
852 '-Wmissing-declarations',
853 '-Wmissing-parameter-type',
854 '-Wmissing-prototypes',
856 '-Wno-missing-field-initializers',
857 '-Wold-style-definition',
861 '-Wstrict-prototypes',
864 '-Wunused-but-set-parameter',
865 '-Wunused-but-set-variable',
866 '-Wunused-parameter',
870 foreach compiler_flag : compiler_flags
871 if cc.has_argument(compiler_flag)
872 add_project_arguments(compiler_flag, language : 'c')
880 bashcompletionslinks = {}
886 subdir('libsmartcols')
889 subdir('login-utils')
897 includes = [dir_include,
907 opt = not get_option('build-chfn-chsh').disabled()
912 include_directories : includes,
913 link_with : [lib_common, logindefs_c],
914 dependencies : chfn_chsh_deps,
915 install_dir : usrbin_exec_dir,
916 install_mode : 'rwsr-xr-x',
918 build_by_default : opt)
922 'login-utils/chsh.c',
925 include_directories : includes,
926 link_with : lib_common,
927 dependencies : chfn_chsh_deps,
928 install_dir : usrbin_exec_dir,
929 install_mode : 'rwsr-xr-x',
931 build_by_default : opt)
932 if opt and not is_disabler(exe)
934 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
935 bashcompletions += ['chfn', 'chsh']
940 test_islocal_sources,
941 include_directories : includes,
942 c_args : '-DTEST_PROGRAM')
947 test_consoles_sources,
948 c_args : ['-DTEST_PROGRAM'],
949 include_directories : includes,
950 link_with : lib_common)
953 opt = not get_option('build-last').disabled()
957 include_directories : includes,
958 link_with : [lib_common],
959 install_dir : usrbin_exec_dir,
961 build_by_default : opt)
962 if opt and not is_disabler(exe)
964 meson.add_install_script(meson_make_symlink,
966 join_paths(usrbin_exec_dir, 'lastb'))
967 manadocs += ['login-utils/last.1.adoc']
968 manlinks += {'lastb.1': 'last.1'}
969 bashcompletions += ['last']
970 bashcompletionslinks += {'lastb': 'last'}
973 opt = not get_option('build-nologin').disabled()
976 'login-utils/nologin.c',
977 include_directories : includes,
978 install_dir : sbindir,
979 link_with : [lib_common],
981 build_by_default : opt)
982 if opt and not is_disabler(exe)
984 manadocs += ['login-utils/nologin.8.adoc']
987 opt = not get_option('build-utmpdump').disabled()
990 'login-utils/utmpdump.c',
991 include_directories : includes,
992 link_with : [lib_common],
993 install_dir : usrbin_exec_dir,
995 build_by_default : opt)
996 if opt and not is_disabler(exe)
998 manadocs += ['login-utils/utmpdump.1.adoc']
999 bashcompletions += ['utmpdump']
1002 opt = not get_option('build-su').disabled()
1006 'login-utils/su-common.c',
1007 'login-utils/su-common.h',
1011 include_directories : includes,
1012 link_with : [lib_common, logindefs_c],
1013 dependencies : [lib_pam,
1017 install_mode : 'rwsr-xr-x',
1019 build_by_default : opt)
1020 if opt and not is_disabler(exe)
1022 manadocs += ['login-utils/su.1.adoc']
1023 bashcompletions += ['su']
1026 opt = not get_option('build-newgrp').disabled()
1029 'login-utils/newgrp.c',
1030 include_directories : includes,
1031 dependencies : [lib_crypt],
1032 install_dir : usrbin_exec_dir,
1033 install_mode : 'rwsr-xr-x',
1035 build_by_default : opt)
1036 if opt and not is_disabler(exe)
1038 manadocs += ['login-utils/newgrp.1.adoc']
1039 bashcompletions += ['newgrp']
1042 opt = not get_option('build-lslogins').disabled()
1045 'login-utils/lslogins.c',
1046 include_directories : includes,
1047 link_with : [lib_common,
1050 dependencies : [lib_selinux,
1052 install_dir : usrbin_exec_dir,
1054 build_by_default : opt)
1055 if opt and not is_disabler(exe)
1057 manadocs += ['login-utils/lslogins.1.adoc']
1058 bashcompletions += ['lslogins']
1061 opt = not get_option('build-vipw').disabled()
1064 'login-utils/vipw.c',
1065 'login-utils/setpwnam.h',
1066 include_directories : includes,
1067 link_with : [lib_common],
1068 dependencies : [lib_selinux],
1069 install_dir : usrbin_exec_dir,
1071 build_by_default : opt)
1072 if opt and not is_disabler(exe)
1074 meson.add_install_script(meson_make_symlink,
1076 join_paths(usrbin_exec_dir, 'vigr'))
1077 manadocs += ['login-utils/vipw.8.adoc']
1078 meson.add_install_script(meson_make_symlink,
1080 join_paths(mandir, 'man8/vigr.8'))
1083 opt = not get_option('build-runuser').disabled()
1086 'login-utils/runuser.c',
1087 'login-utils/su-common.c',
1088 'login-utils/su-common.h',
1092 include_directories : includes,
1093 link_with : [lib_common, logindefs_c],
1094 dependencies : [lib_pam,
1098 install_dir : sbindir,
1100 build_by_default : opt)
1101 if opt and not is_disabler(exe)
1103 manadocs += ['login-utils/runuser.1.adoc']
1104 bashcompletionslinks += {'runuser': 'su'}
1107 ############################################################
1112 include_directories : includes,
1113 link_with : lib_common,
1114 install_dir : usrbin_exec_dir,
1117 manadocs += ['text-utils/col.1.adoc']
1118 bashcompletions += ['col']
1123 include_directories : includes,
1124 install_dir : usrbin_exec_dir,
1127 manadocs += ['text-utils/colcrt.1.adoc']
1128 bashcompletions += ['colcrt']
1133 include_directories : includes,
1134 link_with : lib_common,
1135 install_dir : usrbin_exec_dir,
1138 manadocs += ['text-utils/colrm.1.adoc']
1139 bashcompletions += ['colrm']
1144 include_directories : includes,
1145 install_dir : usrbin_exec_dir,
1148 manadocs += ['text-utils/rev.1.adoc']
1149 bashcompletions += ['rev']
1154 include_directories : includes,
1155 link_with : [lib_common,
1157 install_dir : usrbin_exec_dir,
1159 if not is_disabler(exe)
1161 manadocs += ['text-utils/column.1.adoc']
1162 bashcompletions += ['column']
1165 opt = not get_option('build-line').disabled()
1169 include_directories : includes,
1170 install_dir : usrbin_exec_dir,
1172 build_by_default : opt)
1173 if opt and not is_disabler(exe)
1175 manadocs += ['text-utils/line.1.adoc']
1178 opt = not get_option('build-pg').disabled()
1182 link_with : lib_common,
1183 include_directories : includes,
1184 dependencies : [lib_tinfo,
1186 install_dir : usrbin_exec_dir,
1188 build_by_default : opt)
1189 if opt and not is_disabler(exe)
1191 manadocs += ['text-utils/pg.1.adoc']
1192 bashcompletions += ['pg']
1195 opt = not get_option('build-ul').disabled()
1199 include_directories : includes,
1200 dependencies : [lib_tinfo,
1202 install_dir : usrbin_exec_dir,
1204 build_by_default : opt)
1205 if opt and not is_disabler(exe)
1207 manadocs += ['text-utils/ul.1.adoc']
1208 bashcompletions += ['ul']
1211 opt = not get_option('build-more').disabled()
1215 link_with : [lib_common],
1216 include_directories : includes,
1217 dependencies : [lib_tinfo,
1221 build_by_default : opt)
1225 link_with : [lib_common],
1226 include_directories : includes,
1227 c_args : '-DTEST_PROGRAM',
1228 dependencies : [lib_tinfo,
1231 build_by_default : opt)
1233 if opt and not is_disabler(exe)
1235 manadocs += ['text-utils/more.1.adoc']
1236 bashcompletions += ['more']
1242 include_directories : includes,
1243 link_with : [lib_common,
1245 install_dir : usrbin_exec_dir,
1247 if not is_disabler(exe)
1249 manadocs += ['text-utils/hexdump.1.adoc']
1250 bashcompletions += ['hexdump']
1253 opt = not get_option('build-lsmem').disabled()
1257 include_directories : includes,
1258 link_with : [lib_common,
1260 install_dir : usrbin_exec_dir,
1262 build_by_default : opt)
1263 if opt and not is_disabler(exe)
1265 manadocs += ['sys-utils/lsmem.1.adoc']
1266 bashcompletions += ['lsmem']
1269 opt = not get_option('build-chmem').disabled()
1273 include_directories : includes,
1274 link_with : [lib_common],
1275 install_dir : usrbin_exec_dir,
1277 build_by_default : opt)
1278 if opt and not is_disabler(exe)
1280 manadocs += ['sys-utils/chmem.8.adoc']
1281 bashcompletions += ['chmem']
1287 include_directories : includes,
1288 link_with : [lib_common],
1289 install_dir : usrbin_exec_dir,
1292 manadocs += ['sys-utils/choom.1.adoc']
1297 include_directories : includes,
1298 link_with : [lib_common],
1299 install_dir : usrbin_exec_dir,
1302 manadocs += ['sys-utils/ipcmk.1.adoc']
1303 bashcompletions += ['ipcmk']
1308 include_directories : includes,
1309 link_with : [lib_common],
1310 install_dir : usrbin_exec_dir,
1313 manadocs += ['sys-utils/ipcrm.1.adoc']
1314 bashcompletions += ['ipcrm']
1316 opt = not get_option('build-ipcs').disabled()
1320 include_directories : includes,
1321 link_with : [lib_common],
1322 install_dir : usrbin_exec_dir,
1324 build_by_default : opt)
1325 if opt and not is_disabler(exe)
1327 manadocs += ['sys-utils/ipcs.1.adoc']
1328 bashcompletions += ['ipcs']
1331 opt = not get_option('build-rfkill').disabled()
1335 include_directories : includes,
1336 link_with : [lib_common,
1338 install_dir : usrsbin_exec_dir,
1340 build_by_default : opt)
1341 if opt and not is_disabler(exe)
1343 manadocs += ['sys-utils/rfkill.8.adoc']
1344 bashcompletions += ['rfkill']
1350 include_directories : includes,
1351 link_with : [lib_common,
1353 install_dir : usrbin_exec_dir,
1355 if not is_disabler(exe)
1357 manadocs += ['sys-utils/renice.1.adoc']
1358 bashcompletions += ['renice']
1364 include_directories : includes,
1365 link_with : [lib_common,
1367 install_dir : usrbin_exec_dir,
1369 if opt and not is_disabler(exe)
1371 manadocs += ['sys-utils/setsid.1.adoc']
1372 bashcompletions += ['setsid']
1377 readprofile_sources,
1378 include_directories : includes,
1379 link_with : [lib_common,
1381 install_dir : usrsbin_exec_dir,
1383 if not is_disabler(exe)
1385 manadocs += ['sys-utils/readprofile.8.adoc']
1386 bashcompletions += ['readprofile']
1389 opt = not get_option('build-tunelp').disabled()
1393 include_directories : includes,
1394 link_with : [lib_common],
1395 install_dir : usrsbin_exec_dir,
1397 build_by_default : opt)
1398 if opt and not is_disabler(exe)
1400 manadocs += ['sys-utils/tunelp.8.adoc']
1401 bashcompletions += ['tunelp']
1407 include_directories : includes,
1408 link_with : [lib_common,
1410 install_dir : sbindir,
1412 if not is_disabler(exe)
1414 manadocs += ['sys-utils/fstrim.8.adoc']
1415 bashcompletions += ['fstrim']
1421 include_directories : includes,
1422 link_with : [lib_common,
1425 if not is_disabler(exe)
1427 manadocs += ['sys-utils/dmesg.1.adoc']
1428 bashcompletions += ['dmesg']
1434 include_directories : dir_include,
1435 c_args : '-DTEST_DMESG',
1436 link_with : [lib_common,
1438 if not is_disabler(exe)
1445 include_directories : includes,
1446 link_with : [lib_common],
1447 install_dir : sbindir,
1450 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1451 bashcompletions += ['ctrlaltdel']
1456 include_directories : includes,
1457 install_dir : sbindir,
1460 manadocs += ['sys-utils/fsfreeze.8.adoc']
1461 bashcompletions += ['fsfreeze']
1466 include_directories : includes,
1467 link_with : [lib_common,
1469 install_dir : sbindir,
1472 manadocs += ['sys-utils/blkdiscard.8.adoc']
1473 bashcompletions += ['blkdiscard']
1478 include_directories : includes,
1479 link_with : [lib_common],
1480 install_dir : sbindir,
1483 manadocs += ['sys-utils/blkzone.8.adoc']
1484 bashcompletions += ['blkzone']
1489 include_directories : includes,
1490 link_with : [lib_common],
1491 install_dir : sbindir,
1494 manadocs += ['sys-utils/blkpr.8.adoc']
1499 include_directories : includes,
1500 link_with : [lib_common],
1501 install_dir : usrsbin_exec_dir,
1504 manadocs += ['sys-utils/ldattach.8.adoc']
1505 bashcompletions += ['ldattach']
1510 include_directories : includes,
1511 link_with : [lib_common],
1512 install_dir : usrsbin_exec_dir,
1515 manadocs += ['sys-utils/rtcwake.8.adoc']
1516 bashcompletions += ['rtcwake']
1521 include_directories : includes,
1522 link_with : [lib_common],
1523 install_dir : usrbin_exec_dir,
1526 manadocs += ['sys-utils/setarch.8.adoc']
1527 bashcompletions += ['setarch']
1529 setarch_links = ['uname26', 'linux32', 'linux64']
1530 setarch_links_arch = {
1531 's390x' : ['s390', 's390x'],
1533 'x86_64' : ['i386', 'x86_64'],
1534 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1535 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1536 'mips64' : ['mips', 'mips64', 'mips32'],
1537 'ia64' : ['i386', 'ia64'],
1538 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1540 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1542 foreach link: setarch_links
1543 meson.add_install_script(meson_make_symlink,
1545 join_paths(usrbin_exec_dir, link))
1546 manlinks += {link + '.8': 'setarch.8'}
1549 opt = not get_option('build-eject').disabled()
1553 include_directories : includes,
1554 link_with : [lib_common,
1556 install_dir : usrbin_exec_dir,
1558 build_by_default : opt)
1559 if opt and not is_disabler(exe)
1561 manadocs += ['sys-utils/eject.1.adoc']
1562 bashcompletions += ['eject']
1565 opt = not get_option('build-losetup').disabled()
1569 include_directories : includes,
1570 link_with : [lib_common,
1572 install_dir : sbindir,
1574 build_by_default : opt)
1575 if opt and not is_disabler(exe)
1576 manadocs += ['sys-utils/losetup.8.adoc']
1578 bashcompletions += ['losetup']
1581 opt = opt and 'losetup' in static_programs
1585 include_directories : includes,
1586 link_args : ['--static'],
1587 link_with : [lib_common,
1588 lib_smartcols.get_static_lib()],
1589 install_dir : sbindir,
1591 build_by_default : opt)
1592 if opt and not is_disabler(exe)
1596 opt = not get_option('build-zramctl').disabled()
1600 include_directories : includes,
1601 link_with : [lib_common,
1603 install_dir : sbindir,
1605 build_by_default : opt)
1606 if opt and not is_disabler(exe)
1608 manadocs += ['sys-utils/zramctl.8.adoc']
1609 bashcompletions += ['zramctl']
1615 include_directories : includes,
1616 link_with : [lib_common,
1618 install_dir : usrbin_exec_dir,
1620 if not is_disabler(exe)
1622 manadocs += ['sys-utils/prlimit.1.adoc']
1623 bashcompletions += ['prlimit']
1629 include_directories : includes,
1630 link_with : [lib_common,
1633 install_dir : usrbin_exec_dir,
1635 if not is_disabler(exe)
1637 manadocs += ['sys-utils/lsns.8.adoc']
1638 bashcompletions += ['lsns']
1641 opt = not get_option('build-mount').disabled()
1645 include_directories : includes,
1646 link_with : [lib_common,
1649 dependencies : lib_selinux,
1650 install_mode : 'rwsr-xr-x',
1652 build_by_default : opt)
1656 include_directories : includes,
1657 link_with : [lib_common,
1659 install_mode : 'rwsr-xr-x',
1661 build_by_default : opt)
1662 if opt and not is_disabler(exe)
1664 manadocs += ['sys-utils/fstab.5.adoc',
1665 'sys-utils/mount.8.adoc',
1666 'sys-utils/umount.8.adoc']
1667 bashcompletions += ['mount', 'umount']
1670 opt2 = opt and 'mount' in static_programs
1674 include_directories : includes,
1675 link_args : ['--static'],
1676 link_with : [lib_common,
1677 lib_smartcols_static,
1680 build_by_default : opt2)
1681 if opt2 and not is_disabler(exe)
1685 opt2 = opt and 'umount' in static_programs
1689 include_directories : includes,
1690 link_args : ['--static'],
1691 link_with : [lib_common,
1694 build_by_default : opt2)
1695 if opt2 and not is_disabler(exe)
1704 include_directories : includes,
1705 link_with : [lib_common,
1709 install_dir : sbindir,
1711 if not is_disabler(exe)
1713 manadocs += ['sys-utils/swapon.8.adoc']
1714 bashcompletions += ['swapon']
1720 include_directories : includes,
1721 link_with : [lib_common,
1724 install_dir : sbindir,
1726 if not is_disabler(exe)
1728 manlinks += {'swapoff.8': 'swapon.8'}
1729 bashcompletions += ['swapoff']
1735 include_directories : includes,
1736 link_with : [lib_common,
1738 dependencies : [rtas_libs],
1739 install_dir : usrbin_exec_dir,
1741 if not is_disabler(exe)
1743 manadocs += ['sys-utils/lscpu.1.adoc']
1744 bashcompletions += ['lscpu']
1750 include_directories : includes,
1751 link_with : [lib_common],
1752 install_dir : sbindir,
1755 manadocs += ['sys-utils/chcpu.8.adoc']
1756 bashcompletions += ['chcpu']
1761 include_directories : includes,
1762 link_with : [lib_common,
1765 if not is_disabler(exe)
1767 manadocs += ['sys-utils/wdctl.8.adoc']
1768 bashcompletions += ['wdctl']
1771 opt = not get_option('build-mountpoint').disabled()
1775 include_directories : includes,
1776 link_with : [lib_mount],
1778 build_by_default : opt)
1779 if opt and not is_disabler(exe)
1781 manadocs += ['sys-utils/mountpoint.1.adoc']
1782 bashcompletions += ['mountpoint']
1785 opt = not get_option('build-fallocate').disabled()
1789 include_directories : includes,
1790 link_with : [lib_common],
1791 install_dir : usrbin_exec_dir,
1793 build_by_default : opt)
1794 if opt and not is_disabler(exe)
1796 manadocs += ['sys-utils/fallocate.1.adoc']
1797 bashcompletions += ['fallocate']
1800 opt = not get_option('build-pivot_root').disabled()
1804 include_directories : includes,
1805 install_dir : sbindir,
1807 build_by_default : opt)
1808 if opt and not is_disabler(exe)
1810 manadocs += ['sys-utils/pivot_root.8.adoc']
1811 bashcompletions += ['pivot_root']
1814 opt = not get_option('build-switch_root').disabled()
1815 if opt and not have_dirfd and not have_ddfd
1816 error('neither dirfd nor ddfd are available')
1820 switch_root_sources,
1821 include_directories : includes,
1822 install_dir : sbindir,
1824 build_by_default : opt)
1825 if opt and not is_disabler(exe)
1827 manadocs += ['sys-utils/switch_root.8.adoc']
1830 opt = not get_option('build-unshare').disabled()
1834 include_directories : includes,
1835 link_with : [lib_common],
1836 install_dir : usrbin_exec_dir,
1838 build_by_default : opt)
1839 if opt and not is_disabler(exe)
1841 manadocs += ['sys-utils/unshare.1.adoc']
1842 bashcompletions += ['unshare']
1845 opt = opt and 'unshare' in static_programs
1849 include_directories : includes,
1850 link_with : [lib_common],
1851 install_dir : usrbin_exec_dir,
1853 build_by_default : opt)
1854 if opt and not is_disabler(exe)
1858 opt = not get_option('build-nsenter').disabled()
1862 include_directories : includes,
1863 link_with : [lib_common],
1864 dependencies : [lib_selinux],
1865 install_dir : usrbin_exec_dir,
1867 build_by_default : opt)
1868 if opt and not is_disabler(exe)
1870 manadocs += ['sys-utils/nsenter.1.adoc']
1871 bashcompletions += ['nsenter']
1874 opt = opt and 'nsenter' in static_programs
1878 include_directories : includes,
1879 link_with : [lib_common],
1880 dependencies : [lib_selinux],
1881 install_dir : usrbin_exec_dir,
1883 build_by_default : opt)
1884 if opt and not is_disabler(exe)
1888 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1892 include_directories : includes,
1893 link_with : [lib_common],
1894 dependencies : [lib_cap_ng],
1895 install_dir : usrbin_exec_dir,
1897 build_by_default : opt)
1898 if opt and not is_disabler(exe)
1900 manadocs += ['sys-utils/setpriv.1.adoc']
1901 bashcompletions += ['setpriv']
1907 include_directories : includes,
1908 link_with : [lib_common],
1909 dependencies : realtime_libs,
1910 install_dir : usrbin_exec_dir,
1913 manadocs += ['sys-utils/flock.1.adoc']
1914 bashcompletions += ['flock']
1916 opt = not get_option('build-lsirq').disabled()
1920 include_directories : includes,
1921 link_with : [lib_common,
1923 install_dir : usrbin_exec_dir,
1925 build_by_default : opt)
1926 if opt and not is_disabler(exe)
1928 manadocs += ['sys-utils/lsirq.1.adoc']
1929 bashcompletions += ['lsirq']
1932 opt = not get_option('build-irqtop').disabled()
1936 include_directories : includes,
1937 dependencies : [realtime_libs, curses_libs],
1938 link_with : [lib_common,
1941 install_dir : usrbin_exec_dir,
1943 build_by_default : opt)
1944 if opt and not is_disabler(exe)
1946 manadocs += ['sys-utils/irqtop.1.adoc']
1947 bashcompletions += ['irqtop']
1950 opt = not get_option('build-ipcs').disabled()
1954 include_directories : includes,
1955 link_with : [lib_common,
1957 install_dir : usrbin_exec_dir,
1959 build_by_default : opt)
1960 if opt and not is_disabler(exe)
1962 manadocs += ['sys-utils/lsipc.1.adoc']
1963 bashcompletions += ['lsipc']
1970 include_directories : includes,
1971 link_with : [lib_common],
1972 dependencies : [lib_m,
1974 install_dir : sbindir,
1976 build_by_default : opt)
1977 if opt and not is_disabler(exe)
1979 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1980 bashcompletions += ['hwclock']
1986 include_directories : includes,
1987 install_dir : sbindir,
1990 manadocs += ['disk-utils/mkfs.8.adoc']
1991 bashcompletions += ['mkfs']
1993 opt = not get_option('build-bfs').disabled()
1997 include_directories : includes,
1998 link_with : [lib_common],
1999 install_dir : sbindir,
2001 build_by_default : opt)
2002 if opt and not is_disabler(exe)
2004 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
2005 bashcompletions += ['mkfs.bfs']
2011 include_directories : includes,
2012 link_with : [lib_common],
2013 install_dir : usrbin_exec_dir,
2016 manadocs += ['disk-utils/isosize.8.adoc']
2017 bashcompletions += ['isosize']
2022 include_directories : includes,
2023 link_with : [lib_common,
2026 dependencies: [lib_selinux],
2027 install_dir : sbindir,
2029 if opt and not is_disabler(exe)
2031 manadocs += ['disk-utils/mkswap.8.adoc']
2032 bashcompletions += ['mkswap']
2038 include_directories : includes,
2039 link_with : [lib_common,
2042 install_dir : sbindir,
2044 if opt and not is_disabler(exe)
2046 manadocs += ['disk-utils/swaplabel.8.adoc']
2047 bashcompletions += ['swaplabel']
2050 opt = not get_option('build-fsck').disabled()
2054 include_directories : includes,
2055 link_with : [lib_common,
2058 dependencies : realtime_libs,
2059 install_dir : sbindir,
2061 build_by_default : opt)
2062 if opt and not is_disabler(exe)
2064 manadocs += ['disk-utils/fsck.8.adoc']
2065 bashcompletions += ['fsck']
2068 opt = not get_option('build-minix').disabled()
2072 include_directories : includes,
2073 link_with : [lib_common],
2074 install_dir : sbindir,
2076 build_by_default : opt)
2080 include_directories : includes,
2081 c_args : '-DTEST_SCRIPT',
2082 link_with : [lib_common],
2083 build_by_default : opt)
2087 include_directories : includes,
2088 link_with : [lib_common],
2089 install_dir : sbindir,
2091 build_by_default : opt)
2092 if opt and not is_disabler(exe)
2093 exes += [exe, exe2, exe3]
2094 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2095 bashcompletions += ['mkfs.minix', 'fsck.minix']
2098 opt = not get_option('build-cramfs').disabled()
2101 mkfs_cramfs_sources,
2102 include_directories : includes,
2103 link_with : [lib_common],
2104 dependencies : [lib_z],
2105 install_dir : sbindir,
2107 build_by_default : opt)
2110 fsck_cramfs_sources,
2111 include_directories : includes,
2112 link_with : [lib_common],
2113 dependencies : [lib_z],
2114 install_dir : sbindir,
2116 build_by_default : opt)
2117 if not is_disabler(exe)
2119 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2120 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2123 opt = not get_option('build-raw').disabled()
2125 cc.has_header('linux/raw.h', required: opt)
2130 include_directories : includes,
2131 install_dir : sbindir,
2133 build_by_default : opt)
2134 if opt and not is_disabler(exe)
2136 manadocs += ['disk-utils/raw.8.adoc']
2137 bashcompletions += ['raw']
2140 opt = not get_option('build-fdformat').disabled()
2144 include_directories : includes,
2145 link_with : [lib_common],
2146 install_dir : usrsbin_exec_dir,
2148 build_by_default : opt)
2149 if opt and not is_disabler(exe)
2151 manadocs += ['disk-utils/fdformat.8.adoc']
2157 include_directories : includes,
2158 link_with : [lib_common],
2159 install_dir : sbindir,
2161 manadocs += ['disk-utils/blockdev.8.adoc']
2162 bashcompletions += ['blockdev']
2164 opt = not get_option('build-fdisks').disabled()
2165 if opt and not have_dirfd and not have_ddfd
2166 error('neither dirfd nor ddfd are available')
2171 include_directories : includes,
2172 link_with : [lib_common,
2176 dependencies : [lib_readline],
2177 install_dir : sbindir,
2179 build_by_default : opt)
2180 if opt and not is_disabler(exe)
2182 bashcompletions += ['fdisk']
2185 opt2 = opt and 'fdisk' in static_programs
2189 link_args : ['--static'],
2190 include_directories : includes,
2191 link_with : [lib_common,
2194 lib_smartcols.get_static_lib()],
2195 dependencies : [lib_readline_static],
2196 install_dir : sbindir,
2198 build_by_default : opt2)
2199 if opt2 and not is_disabler(exe)
2206 include_directories : includes,
2207 link_with : [lib_common,
2211 dependencies : [lib_readline],
2212 install_dir : sbindir,
2214 build_by_default : opt)
2215 if opt and not is_disabler(exe)
2217 bashcompletions += ['sfdisk']
2220 opt2 = opt and 'sfdisk' in static_programs
2224 include_directories : includes,
2225 link_with : [lib_common,
2228 lib_smartcols.get_static_lib()],
2229 dependencies : [lib_readline_static],
2230 install_dir : sbindir,
2232 build_by_default : opt2)
2233 if opt2 and not is_disabler(exe)
2240 include_directories : includes,
2241 link_with : [lib_common,
2246 dependencies : [curses_libs],
2247 install_dir : sbindir,
2249 build_by_default : opt)
2250 if opt and not is_disabler(exe)
2252 manadocs += ['disk-utils/fdisk.8.adoc',
2253 'disk-utils/sfdisk.8.adoc',
2254 'disk-utils/cfdisk.8.adoc']
2255 bashcompletions += ['cfdisk']
2258 opt = not get_option('build-partx').disabled()
2262 include_directories : includes,
2263 link_with : [lib_common],
2264 install_dir : usrsbin_exec_dir,
2266 build_by_default : opt)
2270 include_directories : includes,
2271 link_with : [lib_common],
2272 install_dir : usrsbin_exec_dir,
2274 build_by_default : opt)
2278 include_directories : includes,
2279 link_with : [lib_common],
2280 install_dir : usrsbin_exec_dir,
2282 build_by_default : opt)
2286 include_directories : includes,
2287 link_with : [lib_common,
2290 install_dir : usrsbin_exec_dir,
2292 build_by_default : opt)
2294 exes += [exe, exe2, exe3, exe4]
2295 manadocs += ['disk-utils/addpart.8.adoc',
2296 'disk-utils/delpart.8.adoc',
2297 'disk-utils/resizepart.8.adoc',
2298 'disk-utils/partx.8.adoc']
2299 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2302 ############################################################
2307 include_directories : includes,
2308 link_with : [lib_common],
2309 dependencies : [lib_util,
2313 install_dir : usrbin_exec_dir,
2316 manadocs += ['term-utils/script.1.adoc']
2317 bashcompletions += ['script']
2322 include_directories : includes,
2323 c_args : '-DTEST_SCRIPT',
2324 link_with : [lib_common],
2325 dependencies : [lib_util,
2334 include_directories : includes,
2335 link_with : [lib_common],
2336 dependencies : [lib_util,
2339 install_dir : usrbin_exec_dir,
2342 manadocs += ['term-utils/scriptlive.1.adoc']
2343 bashcompletions += ['scriptlive']
2347 scriptreplay_sources,
2348 include_directories : includes,
2349 link_with : [lib_common],
2350 dependencies : [math_libs],
2351 install_dir : usrbin_exec_dir,
2354 manadocs += ['term-utils/scriptreplay.1.adoc']
2355 bashcompletions += ['scriptreplay']
2357 opt = not get_option('build-agetty').disabled()
2361 include_directories : includes,
2362 link_with : [lib_common, logindefs_c],
2363 dependencies : BSD ? lib_util : [],
2364 install_dir : sbindir,
2366 build_by_default : opt)
2369 manadocs += ['term-utils/agetty.8.adoc']
2372 opt = not get_option('build-setterm').disabled()
2376 include_directories : includes,
2377 link_with : [lib_common],
2378 dependencies : [curses_libs],
2379 install_dir : usrbin_exec_dir,
2381 build_by_default : opt)
2384 manadocs += ['term-utils/setterm.1.adoc']
2385 bashcompletions += ['setterm']
2388 opt = not get_option('build-mesg').disabled()
2392 include_directories : includes,
2393 link_with : [lib_common],
2394 install_dir : usrbin_exec_dir,
2396 build_by_default : opt)
2399 manadocs += ['term-utils/mesg.1.adoc']
2400 bashcompletions += ['mesg']
2403 opt = not get_option('build-wall').disabled()
2407 include_directories : includes,
2408 link_with : [lib_common],
2409 install_dir : usrbin_exec_dir,
2410 install_mode : 'rwxr-sr-x',
2412 build_by_default : opt)
2415 manadocs += ['term-utils/wall.1.adoc']
2416 bashcompletions += ['wall']
2419 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2420 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2422 opt = not get_option('build-write').disabled()
2426 include_directories : includes,
2427 link_with : [lib_common],
2428 install_dir : usrbin_exec_dir,
2429 install_mode : 'rwxr-sr-x',
2431 build_by_default : opt)
2434 manadocs += ['term-utils/write.1.adoc']
2435 bashcompletions += ['write']
2438 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2439 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2441 opt = not get_option('build-login').disabled()
2445 include_directories : includes,
2446 link_with : [lib_common, logindefs_c],
2447 dependencies : [lib_pam,
2451 build_by_default : opt)
2452 if not is_disabler(exe)
2454 manadocs += ['login-utils/login.1.adoc']
2457 opt = not get_option('build-sulogin').disabled()
2461 include_directories : includes,
2462 link_with : [lib_common],
2463 dependencies : [lib_crypt,
2465 install_dir : sbindir,
2467 build_by_default : opt)
2468 if not is_disabler(exe)
2470 manadocs += ['login-utils/sulogin.8.adoc']
2476 include_directories : includes,
2477 link_with : [lib_common,
2479 dependencies : [curses_libs],
2480 install_dir : usrbin_exec_dir,
2483 manadocs += ['misc-utils/cal.1.adoc']
2484 bashcompletions += ['cal']
2486 opt = not get_option('build-logger').disabled()
2490 include_directories : includes,
2491 link_with : [lib_common],
2492 dependencies : [lib_systemd],
2493 install_dir : usrbin_exec_dir,
2495 build_by_default : opt)
2496 if opt and not is_disabler(exe)
2498 manadocs += ['misc-utils/logger.1.adoc']
2499 bashcompletions += ['logger']
2505 include_directories : includes,
2506 c_args : '-DTEST_LOGGER',
2507 link_with : [lib_common],
2508 dependencies : [lib_systemd])
2509 if not is_disabler(exe)
2516 include_directories : includes,
2517 install_dir : usrbin_exec_dir,
2520 manadocs += ['misc-utils/look.1.adoc']
2521 bashcompletions += ['look']
2526 include_directories : includes,
2527 link_with : [lib_common],
2528 install_dir : usrbin_exec_dir,
2531 manadocs += ['misc-utils/mcookie.1.adoc']
2532 bashcompletions += ['mcookie']
2537 include_directories : includes,
2538 dependencies : [lib_selinux],
2539 install_dir : usrbin_exec_dir,
2542 manadocs += ['misc-utils/namei.1.adoc']
2543 bashcompletions += ['namei']
2548 include_directories : includes,
2549 link_with : [lib_common],
2550 install_dir : usrbin_exec_dir,
2553 manadocs += ['misc-utils/whereis.1.adoc']
2554 bashcompletions += ['whereis']
2559 include_directories : includes,
2560 link_with : [lib_common,
2563 install_dir : usrbin_exec_dir,
2565 if not is_disabler(exe)
2567 manadocs += ['misc-utils/lslocks.8.adoc']
2568 bashcompletions += ['lslocks']
2574 include_directories : includes,
2575 link_with : [lib_common,
2579 dependencies : lib_udev,
2581 if not is_disabler(exe)
2583 manadocs += ['misc-utils/lsblk.8.adoc']
2584 bashcompletions += ['lsblk']
2590 include_directories : includes,
2591 link_with : [lib_common,
2593 install_dir : usrbin_exec_dir,
2595 if not is_disabler(exe)
2597 manadocs += ['misc-utils/lsfd.1.adoc']
2603 include_directories : includes,
2604 link_with : [lib_uuid],
2605 install_dir : usrbin_exec_dir,
2607 if not is_disabler(exe)
2609 manadocs += ['misc-utils/uuidgen.1.adoc']
2610 bashcompletions += ['uuidgen']
2616 include_directories : includes,
2617 link_with : [lib_common,
2620 install_dir : usrbin_exec_dir,
2622 if not is_disabler(exe)
2624 manadocs += ['misc-utils/uuidparse.1.adoc']
2625 bashcompletions += ['uuidparse']
2632 include_directories : includes,
2633 link_with : [lib_common,
2635 dependencies : [realtime_libs,
2637 install_dir : usrsbin_exec_dir,
2639 build_by_default : opt)
2643 include_directories : includes,
2644 link_with : [lib_common,
2646 dependencies : thread_libs,
2647 build_by_default : opt)
2648 if not is_disabler(exe)
2650 manadocs += ['misc-utils/uuidd.8.adoc']
2651 bashcompletions += ['uuidd']
2654 opt = build_libblkid
2658 include_directories : includes,
2659 link_with : [lib_common,
2661 install_dir : sbindir,
2663 build_by_default : opt)
2664 if opt and not is_disabler(exe)
2666 manadocs += ['misc-utils/blkid.8.adoc']
2667 bashcompletions += ['blkid']
2670 opt = opt and 'blkid' in static_programs
2674 include_directories : includes,
2675 link_with : [lib_common,
2677 install_dir : sbindir,
2679 build_by_default : opt)
2680 if opt and not is_disabler(exe)
2686 'libblkid/samples/mkfs.c',
2687 include_directories : includes,
2688 link_with : lib_blkid)
2689 if not is_disabler(exe)
2694 'sample-partitions',
2695 'libblkid/samples/partitions.c',
2696 include_directories : includes,
2697 link_with : lib_blkid)
2698 if not is_disabler(exe)
2703 'sample-superblocks',
2704 'libblkid/samples/superblocks.c',
2705 include_directories : includes,
2706 link_with : lib_blkid)
2707 if not is_disabler(exe)
2713 'libblkid/samples/topology.c',
2714 include_directories : includes,
2715 link_with : lib_blkid)
2716 if not is_disabler(exe)
2721 'test_blkid_fuzz_sample',
2722 'libblkid/src/fuzz.c',
2723 include_directories: includes,
2724 link_with: lib_blkid)
2725 if not is_disabler(exe)
2729 ############################################################
2734 include_directories : includes,
2735 link_with : [lib_blkid],
2736 install_dir : sbindir,
2738 if not is_disabler(exe)
2740 manadocs += ['misc-utils/findfs.8.adoc']
2741 bashcompletions += ['findfs']
2747 include_directories : includes,
2748 link_with : [lib_common,
2751 install_dir : sbindir,
2753 if not is_disabler(exe)
2755 manadocs += ['misc-utils/wipefs.8.adoc']
2756 bashcompletions += ['wipefs']
2762 include_directories : includes,
2763 link_with : [lib_common,
2767 dependencies : [lib_udev],
2769 if not is_disabler(exe)
2771 manadocs += ['misc-utils/findmnt.8.adoc']
2772 bashcompletions += ['findmnt']
2778 include_directories : includes,
2779 link_with : [lib_common],
2781 if not is_disabler(exe)
2783 manadocs += ['misc-utils/kill.1.adoc']
2786 opt = not get_option('build-rename').disabled()
2790 include_directories : includes,
2791 install_dir : usrbin_exec_dir,
2793 build_by_default : opt)
2794 if opt and not is_disabler(exe)
2796 manadocs += ['misc-utils/rename.1.adoc']
2797 bashcompletions += ['rename']
2803 include_directories : includes,
2804 link_with : [lib_common],
2805 install_dir : usrbin_exec_dir,
2808 manadocs += ['misc-utils/getopt.1.adoc']
2809 bashcompletions += ['getopt']
2814 include_directories : includes,
2815 link_with : [lib_common,
2817 install_dir : usrbin_exec_dir,
2819 if not is_disabler(exe)
2821 manadocs += ['misc-utils/fincore.1.adoc']
2822 bashcompletions += ['fincore']
2828 include_directories : includes,
2829 link_with : [lib_common],
2830 install_dir : usrbin_exec_dir,
2832 if not is_disabler(exe)
2834 manadocs += ['misc-utils/hardlink.1.adoc']
2835 bashcompletions += ['hardlink']
2838 opt = not get_option('build-pipesz').disabled()
2842 include_directories : includes,
2843 link_with : [lib_common],
2844 install_dir : usrbin_exec_dir,
2846 if opt and not is_disabler(exe)
2848 manadocs += ['misc-utils/pipesz.1.adoc']
2849 bashcompletions += ['pipesz']
2855 include_directories : includes,
2856 c_args : '-DTEST_CAL',
2857 link_with : [lib_common,
2859 dependencies : [curses_libs])
2860 if not is_disabler(exe)
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/fadvise.1.adoc']
2874 bashcompletions += ['fadvise']
2877 if LINUX and conf.get('HAVE_PIDFD_OPEN') != false
2881 include_directories : includes,
2882 link_with : [lib_common],
2883 install_dir : usrbin_exec_dir,
2885 if not is_disabler(exe)
2887 manadocs += ['misc-utils/waitpid.1.adoc']
2888 bashcompletions += ['waitpid']
2892 syscalls_h = custom_target('syscalls.h',
2893 input : 'tools/all_syscalls',
2894 output : 'syscalls.h',
2895 command : ['bash', '@INPUT@', cc.cmd_array()],
2898 if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
2901 'misc-utils/enosys.c', syscalls_h,
2902 include_directories : includes,
2903 link_with : [lib_common],
2904 install_dir : usrbin_exec_dir,
2906 if not is_disabler(exe)
2908 manadocs += ['misc-utils/enosys.1.adoc']
2909 bashcompletions += ['enosys']
2916 include_directories : includes,
2917 link_with : [lib_common, lib_smartcols],
2918 install_dir : usrbin_exec_dir,
2920 if not is_disabler(exe)
2922 manadocs += ['misc-utils/lsclocks.1.adoc']
2923 bashcompletions += ['lsclocks']
2926 ############################################################
2928 opt = not get_option('build-schedutils').disabled()
2931 'schedutils/chrt.c',
2932 include_directories : includes,
2933 link_with : lib_common,
2934 install_dir : usrbin_exec_dir,
2936 build_by_default : opt)
2940 'schedutils/ionice.c',
2941 include_directories : includes,
2942 link_with : lib_common,
2943 install_dir : usrbin_exec_dir,
2945 build_by_default : opt)
2949 'schedutils/taskset.c',
2950 include_directories : includes,
2951 link_with : lib_common,
2952 install_dir : usrbin_exec_dir,
2954 build_by_default : opt)
2958 'schedutils/uclampset.c',
2959 include_directories : includes,
2960 link_with : lib_common,
2961 install_dir : usrbin_exec_dir,
2963 build_by_default : opt)
2965 if opt and not is_disabler(exe)
2966 exes += [exe, exe2, exe3, exe4]
2967 manadocs += ['schedutils/chrt.1.adoc',
2968 'schedutils/ionice.1.adoc',
2969 'schedutils/taskset.1.adoc',
2970 'schedutils/uclampset.1.adoc']
2971 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2974 ############################################################
2976 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2981 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2982 include_directories : dir_include,
2983 link_with : lib_common)
2989 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2990 include_directories : dir_include,
2991 link_with : lib_common)
2997 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2998 include_directories : dir_include,
2999 link_with : lib_common)
3005 c_args : ['-DTEST_PROGRAM_MANGLE'],
3006 include_directories : dir_include)
3012 c_args : ['-DTEST_PROGRAM_STRUTILS'],
3013 include_directories : dir_include)
3019 'lib/color-names.c',
3020 c_args : ['-DTEST_PROGRAM_COLORS'],
3021 include_directories : dir_include,
3022 link_with : [lib_common, lib_tcolors])
3028 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
3029 include_directories : dir_include)
3032 if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false
3036 c_args : ['-DTEST_PROGRAM_PROCFS'],
3037 include_directories : dir_include,
3038 link_with : lib_common)
3045 have_cpu_set_t ? 'lib/cpuset.c' : [],
3046 c_args : ['-DTEST_PROGRAM_PATH'],
3047 include_directories : dir_include,
3048 link_with : lib_common)
3052 if conf.get('HAVE_PTY') != false
3057 c_args : ['-DTEST_PROGRAM_PTY'],
3058 include_directories : dir_include,
3059 link_with : [lib_common],
3060 dependencies : [lib_m,
3070 c_args : ['-DTEST_PROGRAM_CPUSET'],
3071 include_directories : dir_include)
3082 have_cpu_set_t ? 'lib/cpuset.c' : [],
3083 c_args : ['-DTEST_PROGRAM_SYSFS'],
3084 include_directories : dir_include)
3090 c_args : ['-DTEST_PROGRAM_PAGER'],
3091 include_directories : dir_include)
3095 'test_linux_version',
3096 'lib/linux_version.c',
3097 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3098 include_directories : dir_include)
3104 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3105 include_directories : dir_include)
3109 'test_canonicalize',
3110 'lib/canonicalize.c',
3111 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3112 include_directories : dir_include)
3119 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3120 include_directories : dir_include)
3126 c_args : ['-DTEST_PROGRAM'],
3127 include_directories : dir_include,
3128 link_with : lib_common)
3134 c_args : ['-DTEST_PROGRAM'],
3135 include_directories : dir_include,
3136 link_with : [lib_common, logindefs_c])
3140 ############################################################
3144 'libuuid/src/test_uuid.c',
3145 include_directories : [dir_include, dir_libuuid],
3146 link_with : lib_uuid,
3147 dependencies : socket_libs)
3148 if not is_disabler(exe)
3152 ############################################################
3154 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3156 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3160 'libfdisk/src/ask.c',
3161 c_args : libfdisk_tests_cflags,
3162 include_directories : lib_fdisk_includes,
3163 link_with : libfdisk_tests_ldadd)
3164 if not is_disabler(exe)
3170 'libfdisk/src/gpt.c',
3171 c_args : libfdisk_tests_cflags,
3172 include_directories : lib_fdisk_includes,
3173 link_with : libfdisk_tests_ldadd)
3174 if not is_disabler(exe)
3180 'libfdisk/src/utils.c',
3181 c_args : libfdisk_tests_cflags,
3182 include_directories : lib_fdisk_includes,
3183 link_with : libfdisk_tests_ldadd)
3184 if not is_disabler(exe)
3189 'test_fdisk_script',
3190 'libfdisk/src/script.c',
3191 c_args : libfdisk_tests_cflags,
3192 include_directories : lib_fdisk_includes,
3193 link_with : libfdisk_tests_ldadd)
3194 if not is_disabler(exe)
3199 'test_fdisk_version',
3200 'libfdisk/src/version.c',
3201 c_args : libfdisk_tests_cflags,
3202 include_directories : lib_fdisk_includes,
3203 link_with : libfdisk_tests_ldadd)
3204 if not is_disabler(exe)
3210 'libfdisk/src/item.c',
3211 c_args : libfdisk_tests_cflags,
3212 include_directories : lib_fdisk_includes,
3213 link_with : libfdisk_tests_ldadd)
3214 if not is_disabler(exe)
3218 sample_fdisk_cflags = ['-Wno-unused']
3219 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3222 'sample-fdisk-mkpart',
3223 'libfdisk/samples/mkpart.c',
3224 c_args : sample_fdisk_cflags,
3225 include_directories : lib_fdisk_includes,
3226 link_with : sample_fdisk_ldadd)
3227 if not is_disabler(exe)
3232 'sample-fdisk-mkpart-fullspec',
3233 'libfdisk/samples/mkpart-fullspec.c',
3234 c_args : sample_fdisk_cflags,
3235 include_directories : lib_fdisk_includes,
3236 link_with : sample_fdisk_ldadd)
3237 if not is_disabler(exe)
3241 ############################################################
3245 'tests/helpers/test_mbsencode.c',
3246 include_directories : includes,
3247 link_with : lib_common)
3252 'tests/helpers/test_byteswap.c',
3253 include_directories : includes)
3258 'tests/helpers/test_md5.c',
3260 include_directories : includes)
3265 'tests/helpers/test_sha1.c',
3267 include_directories : includes)
3272 'tests/helpers/test_pathnames.c',
3273 include_directories : includes)
3278 'tests/helpers/test_strerror.c',
3279 include_directories : includes)
3284 'tests/helpers/test_sysinfo.c',
3285 include_directories : includes)
3290 'tests/helpers/test_sigreceive.c',
3291 include_directories : includes,
3292 link_with : lib_common)
3297 'tests/helpers/test_tiocsti.c',
3298 include_directories : includes)
3302 'test_uuid_namespace',
3303 'tests/helpers/test_uuid_namespace.c',
3307 include_directories : includes)
3311 mq_libs += cc.find_library('rt', required : true)
3316 'tests/helpers/test_mkfds.c',
3317 include_directories : includes,
3318 dependencies : mq_libs)
3324 'tests/helpers/test_enosys.c',
3325 include_directories : includes)
3328 ############################################################
3330 if conf.get('HAVE_OPENAT') != false
3332 'sample-scols-tree',
3333 'libsmartcols/samples/tree.c',
3334 include_directories : includes,
3335 link_with : [lib_smartcols, lib_common])
3336 if not is_disabler(exe)
3342 'sample-scols-title',
3343 'libsmartcols/samples/title.c',
3344 include_directories : includes,
3345 link_with : [lib_smartcols, lib_common])
3346 if not is_disabler(exe)
3351 'sample-scols-wrap',
3352 'libsmartcols/samples/wrap.c',
3353 include_directories : includes,
3354 link_with : [lib_smartcols, lib_common])
3355 if not is_disabler(exe)
3360 'sample-scols-continuous',
3361 'libsmartcols/samples/continuous.c',
3362 include_directories : includes,
3363 link_with : [lib_smartcols, lib_common])
3364 if not is_disabler(exe)
3369 'sample-scols-maxout',
3370 'libsmartcols/samples/maxout.c',
3371 include_directories : includes,
3372 link_with : [lib_smartcols, lib_common])
3373 if not is_disabler(exe)
3378 'sample-scols-fromfile',
3379 'libsmartcols/samples/fromfile.c',
3380 include_directories : includes,
3381 link_with : [lib_smartcols, lib_common])
3382 if not is_disabler(exe)
3387 'sample-scols-grouping-simple',
3388 'libsmartcols/samples/grouping-simple.c',
3389 include_directories : includes,
3390 link_with : [lib_smartcols, lib_common])
3391 if not is_disabler(exe)
3396 'sample-scols-grouping-overlay',
3397 'libsmartcols/samples/grouping-overlay.c',
3398 include_directories : includes,
3399 link_with : [lib_smartcols, lib_common])
3400 if not is_disabler(exe)
3404 ############################################################
3406 # Let the test runner know whether we're running under asan and export
3407 # some paths. We use a file on disk so that it is possible to run the
3408 # test scripts from commandline without setting any variables.
3409 configure_file(output : 'meson.conf',
3414 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3415 python.full_path())])
3417 run_sh = find_program('tests/run.sh')
3421 '--srcdir=' + meson.current_source_dir(),
3422 '--builddir=' + meson.current_build_dir(),
3428 manadocs += ['lib/terminal-colors.d.5.adoc']
3429 manadocs += ['libblkid/libblkid.3.adoc']
3433 'libuuid/man/uuid.3.adoc',
3434 'libuuid/man/uuid_clear.3.adoc',
3435 'libuuid/man/uuid_compare.3.adoc',
3436 'libuuid/man/uuid_copy.3.adoc',
3437 'libuuid/man/uuid_generate.3.adoc',
3438 'libuuid/man/uuid_is_null.3.adoc',
3439 'libuuid/man/uuid_parse.3.adoc',
3440 'libuuid/man/uuid_time.3.adoc',
3441 'libuuid/man/uuid_unparse.3.adoc']
3443 'uuid_generate_random.3': 'uuid_generate.3',
3444 'uuid_generate_time.3': 'uuid_generate.3',
3445 'uuid_generate_time_safe.3': 'uuid_generate.3',
3449 asciidoctor = find_program('asciidoctor', required : false)
3450 if asciidoctor.found()
3451 foreach adoc : manadocs
3452 name = adoc.split('/')[-1]
3453 page = name.split('.adoc')[0]
3454 section = page.split('.')[-1]
3455 mandirn = join_paths(mandir, 'man' + section)
3460 command : [ asciidoctor,
3462 '-a', 'VERSION=' + meson.project_version(),
3463 '-a', 'release-version=' + meson.project_version(),
3464 '-a', 'ADJTIME_PATH=/etc/adjtime',
3465 '-a', 'package-docdir=' + docdir,
3466 '--base-dir=' + meson.current_source_dir(),
3467 '--destination-dir=' + meson.current_build_dir(),
3468 '--load-path', '@SOURCE_ROOT@/tools',
3469 '--require', 'asciidoctor-includetracker',
3473 depfile : page + '.deps',
3475 install_dir : mandirn)
3478 foreach link_name, target : manlinks
3479 link_section = link_name.split('.')[-1]
3480 target_section = target.split('.')[-1]
3481 meson.add_install_script(meson_make_manpage_stub,
3482 join_paths('man' + target_section, target),
3483 join_paths(mandir, 'man' + link_section, link_name))
3487 if bash_completion.found()
3488 foreach completion : bashcompletions
3490 join_paths('bash-completion', completion),
3491 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3494 foreach link_name, target : bashcompletionslinks
3495 meson.add_install_script(meson_make_symlink,
3497 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))