1 project('util-linux', 'c',
2 version : run_command('tools/git-version-gen', check: true).stdout(),
3 meson_version: '>=0.53.0',
6 pkgconfig = import('pkgconfig')
8 libblkid_version = '1.1.0'
9 libblkid_date = '01-Jun-2021'
10 libuuid_version = '1.3.0'
11 libmount_version = '1.1.0'
12 libsmartcols_version = '1.1.0'
13 libfdisk_version = '1.1.0'
15 prefixdir = get_option('prefix')
16 if not prefixdir.startswith('/')
17 error('Prefix is not absolute: "@0@"'.format(prefixdir))
19 bindir = join_paths(prefixdir, get_option('bindir'))
20 sbindir = join_paths(prefixdir, get_option('sbindir'))
21 sysconfstaticdir = join_paths(prefixdir, 'lib')
22 docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux')
23 mandir = join_paths(prefixdir, get_option('mandir'))
25 execprefixdir = prefixdir
26 sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
27 usrbin_exec_dir = join_paths(execprefixdir, bindir)
28 usrsbin_exec_dir = join_paths(execprefixdir, sbindir)
29 bash_completion = dependency('bash-completion', required : get_option('build-bash-completion'))
31 vendordir = get_option('vendordir')
33 add_project_arguments('-D_GNU_SOURCE', language : 'c')
35 cc = meson.get_compiler('c')
37 conf = configuration_data()
38 conf.set_quoted('PACKAGE', meson.project_name())
39 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
40 package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version())
41 conf.set_quoted('PACKAGE_STRING', package_string)
43 codes = [''' {print $1} ''',
44 ''' {sub("-.*","",$2); print $2} ''',
45 ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} ''']
48 res = run_command('bash', '-c',
49 '''echo '@0@' | awk -F. '@1@' '''.format(
50 meson.project_version(), code), check: true)
51 pc_version += res.stdout().strip()
53 pc_version = '.'.join(pc_version)
55 conf.set_quoted('LIBBLKID_VERSION', libblkid_version)
56 conf.set_quoted('LIBBLKID_DATE', libblkid_date)
58 conf.set('bindir', bindir)
59 conf.set('sbindir', sbindir)
60 conf.set('runstatedir', runstatedir)
61 conf.set('sysconfdir', sysconfdir)
62 conf.set('usrsbin_execdir', usrsbin_exec_dir)
63 conf.set('docdir', docdir)
64 conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir)
65 conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir)
66 conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime')
67 conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :(
69 conf.set_quoted('_PATH_VENDORDIR', vendordir)
70 conf.set('USE_VENDORDIR', vendordir == '' ? false : 1)
72 build_libblkid = not get_option('build-libblkid').disabled()
73 conf.set('HAVE_LIBBLKID', build_libblkid ? 1 : false)
74 summary('libblkid', build_libblkid ? 'enabled' : 'disabled', section : 'components')
76 build_libuuid = not get_option('build-libuuid').disabled()
77 conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false)
78 summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components')
80 have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
81 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
82 conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
84 build_libmount = not get_option('build-libmount').disabled()
85 conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false)
86 conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1)
87 conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false)
88 summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components')
90 build_libsmartcols = not get_option('build-libsmartcols').disabled()
91 conf.set('HAVE_LIBSMARTCOLS', build_libsmartcols ? 1 : false)
92 summary('libsmartcols', build_libsmartcols ? 'enabled' : 'disabled', section : 'components')
94 build_libfdisk = not get_option('build-libfdisk').disabled()
95 conf.set('HAVE_LIBFDISK', build_libfdisk ? 1 : false)
96 summary('libfdisk', build_libfdisk ? 'enabled' : 'disabled', section : 'components')
98 build_uuidd = not get_option('build-uuidd').disabled()
99 conf.set('HAVE_UUIDD', build_uuidd ? 1 : false)
100 summary('uuidd', build_uuidd ? 'enabled' : 'disabled', section : 'components')
102 static_programs = get_option('static-programs')
103 need_static_libs = static_programs.length() > 0 # a rough estimate...
104 summary('static programs', static_programs)
106 LINUX = host_machine.system() in ['linux']
107 BSD = host_machine.system() in ['dragonfly', 'freebsd', 'netbsd', 'openbsd']
109 ############################################################
127 have = cc.compiles(code, name : 'wchar_t support')
128 if not have and get_option('widechar').enabled()
129 error('widechar support requested but unavailable')
131 if get_option('ncurses').enabled() and get_option('widechar').enabled()
132 error('widechar support is incompatible with non-wide ncurses')
134 conf.set('HAVE_WIDECHAR', have ? 1 : false)
175 linux/net_namespace.h
221 lib_m = cc.find_library('m')
223 lib_tinfo = dependency(
225 required : get_option('tinfo'))
227 lib_ncursesw = dependency(
229 required : get_option('ncursesw'))
230 if lib_ncursesw.found()
231 headers += ['ncursesw/ncurses.h',
235 lib_ncurses = disabler()
237 lib_ncurses = dependency(
239 required : get_option('ncurses'))
240 headers += ['ncurses.h',
244 conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
245 conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
246 conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
248 lib_slang = dependency(
250 required : get_option('slang'))
252 headers += ['slang.h',
257 conf.set('HAVE_SLANG', lib_slang.found())
259 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
260 if curses_libs.found()
261 have = cc.has_function('use_default_colors', dependencies : curses_libs)
262 conf.set('HAVE_USE_DEFAULT_COLORS', have ? 1 : false)
263 have = cc.has_function('resizeterm', dependencies : curses_libs)
264 conf.set('HAVE_RESIZETERM', have ? 1 : false)
271 required : get_option('zlib'))
273 lib_readline = dependency(
275 required : get_option('readline'))
276 conf.set('HAVE_LIBREADLINE', lib_readline.found() ? 1 : false)
278 lib_readline_static = dependency(
281 required : need_static_libs ? get_option('readline') : disabler())
283 if meson.version().version_compare('>= 0.59.0')
284 lib_intl = dependency(
286 required : get_option('nls'))
287 conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
289 if get_option('nls').enabled()
290 error('nls is not supported with meson before 0.59.0')
292 lib_intl = dependency('', required : false)
295 lib_user = dependency(
298 required : get_option('libuser'))
299 conf.set('HAVE_LIBUSER', lib_user.found() ? 1 : false)
301 lib_util = cc.find_library(
303 required : get_option('libutil'))
304 conf.set('HAVE_LIBUTIL', lib_util.found() ? 1 : false)
306 lib_utempter = cc.find_library(
308 required : get_option('libutempter'))
309 conf.set('HAVE_LIBUTEMPTER', lib_utempter.found() ? 1 : false)
311 systemd = dependency(
313 required : get_option('systemd'))
315 lib_systemd = dependency(
317 required : get_option('systemd'))
318 conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false)
319 conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false)
321 lib_udev = dependency(
323 required : get_option('systemd'))
324 conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false)
326 lib_crypt = cc.find_library('crypt')
328 lib_pam = cc.find_library('pam', required : get_option('build-login'))
329 if not lib_pam.found()
330 lib_pam = cc.find_library('pam', required : get_option('build-chfn-chsh'))
332 if not lib_pam.found()
333 lib_pam = cc.find_library('pam', required : get_option('build-su'))
335 if not lib_pam.found()
336 lib_pam = cc.find_library('pam', required : get_option('build-runuser'))
339 lib_pam_misc = cc.find_library('pam_misc')
340 lib_pam = [lib_pam, lib_pam_misc]
342 lib_pam_misc = declare_dependency()
345 lib_cryptsetup = dependency(
347 required : get_option('cryptsetup'))
348 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
350 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
351 if meson.version().version_compare('>= 0.62.0')
352 lib_dl = dependency('dl')
354 lib_dl = cc.find_library('dl')
356 conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
357 summary('cryptsetup support (dlopen)',
359 section : 'components')
361 summary('cryptsetup support',
362 lib_cryptsetup.found() ? 'enabled' : 'disabled',
363 section : 'components')
366 have = cc.has_function(
367 'crypt_activate_by_signed_key',
368 dependencies : lib_cryptsetup)
369 conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false)
371 lib_cap_ng = dependency(
373 required : get_option('build-setpriv'))
375 lib_selinux = dependency(
378 required : get_option('selinux'))
379 conf.set('HAVE_LIBSELINUX', lib_selinux.found() ? 1 : false)
381 lib_magic = dependency(
383 required : get_option('magic'))
384 conf.set('HAVE_MAGIC', lib_magic.found() ? 1 : false)
386 lib_econf = dependency(
388 required : get_option('econf'))
389 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
391 lib_audit = dependency(
393 required : get_option('audit'))
394 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
396 conf.set('HAVE_SMACK', not get_option('smack').disabled())
398 foreach header : headers
399 have = cc.has_header(header)
400 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
403 header = 'linux/btrfs.h'
404 enable_btrfs = cc.has_header(header,
405 required : get_option('btrfs'))
406 conf.set('HAVE_' + header.underscorify().to_upper(), enable_btrfs ? 1 : false)
407 conf.set('HAVE_BTRFS_SUPPORT', enable_btrfs ? 1 : false)
409 prefix = conf.get('HAVE_LINUX_COMPILER_H') ? '#include <linux/compiler.h>' : ''
414 have = cc.has_header(header,
416 conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false)
419 have = cc.has_header('sched.h')
420 conf.set10('HAVE_DECL_CPU_ALLOC', have)
421 # We get -1 if the size cannot be determined
422 have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
423 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
425 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
426 conf.set10('HAVE_ENVIRON_DECL', have)
428 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
429 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)
431 have = cc.has_function('strsignal')
432 conf.set10('HAVE_STRSIGNAL_DECL', have)
434 have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0
435 conf.set('HAVE_UNION_SEMUN', have ? 1 : false)
437 have = cc.has_type('loff_t', prefix : '#include <sys/types.h>')
438 conf.set('HAVE_LOFF_T', have ? 1 : false)
440 have = cc.compiles('''
441 #define _GNU_SOURCE 1
442 #include <langinfo.h>
445 str = nl_langinfo (ALTMON_1);
446 str = nl_langinfo (ALTMON_2);
447 str = nl_langinfo (ALTMON_3);
448 str = nl_langinfo (ALTMON_4);
449 str = nl_langinfo (ALTMON_5);
450 str = nl_langinfo (ALTMON_6);
451 str = nl_langinfo (ALTMON_7);
452 str = nl_langinfo (ALTMON_8);
453 str = nl_langinfo (ALTMON_9);
454 str = nl_langinfo (ALTMON_10);
455 str = nl_langinfo (ALTMON_11);
456 str = nl_langinfo (ALTMON_12);
460 name : 'langinfo.h defines ALTMON_x constants')
461 conf.set('HAVE_LANGINFO_ALTMON', have ? 1 : false)
463 have = cc.compiles('''
464 #define _GNU_SOURCE 1
465 #include <langinfo.h>
468 str = nl_langinfo (_NL_ABALTMON_1);
469 str = nl_langinfo (_NL_ABALTMON_2);
470 str = nl_langinfo (_NL_ABALTMON_3);
471 str = nl_langinfo (_NL_ABALTMON_4);
472 str = nl_langinfo (_NL_ABALTMON_5);
473 str = nl_langinfo (_NL_ABALTMON_6);
474 str = nl_langinfo (_NL_ABALTMON_7);
475 str = nl_langinfo (_NL_ABALTMON_8);
476 str = nl_langinfo (_NL_ABALTMON_9);
477 str = nl_langinfo (_NL_ABALTMON_10);
478 str = nl_langinfo (_NL_ABALTMON_11);
479 str = nl_langinfo (_NL_ABALTMON_12);
483 name : 'langinfo.h defines _NL_ABALTMON_x constants')
484 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
577 have = cc.has_function(func)
578 # For autotools compatibility, use either #define FOO 1 or #undef FOO.
579 # This makes little sense, but is necessary to avoid warnings about
580 # redefined macros from Python.h, which uses this convention.
581 conf.set('HAVE_' + func.to_upper(), have ? 1 : false)
584 have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1]
585 conf.set('AGETTY_RELOAD', have ? 1 : false)
587 warning('futimens or inotify_init1 not found; agetty(8) will not provide --reload functionality')
590 have_dirfd = (cc.has_function('dirfd') or
591 cc.has_header_symbol('dirent.h', 'dirfd',
592 prefix : '#include <sys/types.h>'))
593 conf.set('HAVE_DIRFD', have_dirfd ? 1 : false)
595 have_ddfd = cc.has_member('DIR', 'dd_fd',
597 #include <sys/types.h>
600 conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false)
602 have = cc.has_member('struct tm', 'tm_gmtoff',
607 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
611 have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
612 conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
614 have = cc.has_member('struct termios', 'c_line',
615 prefix : '#include <termios.h>')
616 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
618 have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
619 prefix : '#include <sys/stat.h>')
620 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
622 # replacement for AC_STRUCT_TIMEZONE
623 have = cc.has_member('struct tm', 'tm_zone',
624 prefix : '#include <time.h>')
625 conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false)
627 have = cc.has_header_symbol('time.h', 'tzname', args: '-D_GNU_SOURCE')
628 conf.set('HAVE_DECL_TZNAME', have ? 1 : false)
630 have = cc.has_header_symbol('linux/blkzoned.h', 'BLK_ZONE_REP_CAPACITY')
631 conf.set('HAVE_DECL_BLK_ZONE_REP_CAPACITY', have ? 1 : false)
633 have = cc.has_header_symbol('linux/pr.h', 'PR_REP_CAPACITY')
634 conf.set('HAVE_DECL_PR_REP_CAPACITY', have ? 1 : false)
639 extern char *tzname[];
642 return tzname ? 0 : 1;
644 '''.format(have ? 1 : 0)
645 have = cc.compiles(code, name : 'using tzname[]')
646 conf.set('HAVE_TZNAME', have ? 1 : false)
649 if not cc.has_function('socket')
650 socket_libs += cc.find_library('socket', required : true)
651 have = cc.has_function('socket',
652 dependencies : socket_libs)
654 error('socket() function not available')
659 have = cc.has_function('clock_gettime')
661 realtime_libs += cc.find_library('rt', required : true)
662 have = cc.has_function('clock_gettime',
663 dependencies : realtime_libs)
665 conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
667 thread_libs = dependency('threads')
669 have = cc.has_function('timer_create')
671 realtime_libs = [cc.find_library('rt', required : true)]
672 have = cc.has_function('timer_create',
673 dependencies : realtime_libs)
675 realtime_libs += thread_libs
676 have = cc.has_function('timer_create',
677 dependencies : realtime_libs)
680 conf.set('HAVE_TIMER_CREATE', have ? 1 : false)
682 have = cc.has_function('setitimer')
683 conf.set('HAVE_SETITIMER', have ? 1 : false)
686 rtas_libs = cc.find_library('rtas', required : false)
687 conf.set('HAVE_LIBRTAS', rtas_libs.found() ? 1 : false)
690 if not cc.has_header_symbol('math.h', 'isnan')
691 lib = cc.find_library('m', required : true)
692 if (cc.has_function('isnan', dependencies : lib) and
693 cc.has_function('__isnan', dependencies : lib))
698 have = cc.has_header_symbol('errno.h', 'program_invocation_short_name',
699 args : '-D_GNU_SOURCE')
700 conf.set('HAVE_PROGRAM_INVOCATION_SHORT_NAME', have ? 1 : false)
703 extern char *__progname;
705 return (*__progname != 0);
708 have = cc.compiles(code, name : 'using __progname')
709 conf.set('HAVE___PROGNAME', have ? 1 : false)
711 have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
712 conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
714 build_plymouth_support = get_option('build-plymouth-support')
715 have_tiocglcktrmios = cc.has_header_symbol(
716 'sys/ioctl.h', 'TIOCGLCKTRMIOS',
717 required : build_plymouth_support.enabled())
718 have_sock_cloexec = cc.has_header_symbol(
719 'sys/socket.h', 'SOCK_CLOEXEC',
720 prefix : '#include <sys/types.h>',
721 required : build_plymouth_support.enabled())
722 have_sock_nonblock = cc.has_header_symbol(
723 'sys/socket.h', 'SOCK_NONBLOCK',
724 prefix : '#include <sys/types.h>',
725 required : build_plymouth_support.enabled())
726 have_so_passcred = cc.has_header_symbol(
727 'sys/socket.h', 'SO_PASSCRED',
728 prefix : '#include <sys/types.h>',
729 required : build_plymouth_support.enabled())
731 build_plymouth_support = (not build_plymouth_support.disabled() and
732 have_tiocglcktrmios and
733 have_sock_cloexec and
734 have_sock_nonblock and
736 conf.set('ENABLE_PLYMOUTH_SUPPORT', build_plymouth_support ? 1 : false)
737 summary('plymouth support',
738 build_plymouth_support ? 'enabled' : 'disabled',
739 section : 'components')
741 # check for valid fallocate() function
742 # with 32 bits glibc 2.10, fallocate() exists but not fallocate64()
743 # when _FILE_OFFSET_BITS==64, fallocate() is redirect to fallocate64()
744 # and program can't be linked.
752 ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0xfffffffful, 0xfffffffful);
753 return ret == 0 ? 0 : 1;
756 have = cc.links(code, name : 'fallocate() function')
757 conf.set('HAVE_FALLOCATE', have ? 1 : false)
765 ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful);
766 return ret == 0 ? 0 : 1;
769 have = cc.links(code, name : 'posix_fallocate() function')
770 conf.set('HAVE_POSIX_FALLOCATE', have ? 1 : false)
772 use_hwclock_cmos = host_machine.cpu_family() in ['x86', 'x86_64']
773 message('Use CMOS clock: @0@'.format(use_hwclock_cmos))
774 conf.set('USE_HWCLOCK_CMOS', use_hwclock_cmos ? 1 : false)
776 conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
777 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
778 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
780 ############################################################
783 fs_search_path = get_option('fs-search-path')
784 fs_search_path_extra = get_option('fs-search-path-extra')
785 if fs_search_path_extra != ''
786 fs_search_path = ':'.join(fs_search_path, fs_search_path_extra)
788 conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
790 systemdsystemunitdir = ''
792 systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
795 sysvinit = get_option('sysvinit').enabled()
796 sysvinitrcdir = sysconfdir + '/init.d'
798 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
799 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
801 have = get_option('chsh-only-listed')
802 conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
804 have = get_option('use-tty-group')
805 conf.set('USE_TTY_GROUP', have ? 1 : false)
807 build_hwclock = not get_option('build-hwclock').disabled()
808 bison = find_program('bison', required: build_hwclock)
809 bison_gen = generator(
811 output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
812 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
816 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
817 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
821 configuration : conf)
823 add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
828 '-Waddress-of-packed-member',
829 '-Wdiscarded-qualifiers',
830 '-Wembedded-directive',
833 '-Wimplicit-function-declaration',
834 '-Wmissing-declarations',
835 '-Wmissing-parameter-type',
836 '-Wmissing-prototypes',
838 '-Wno-missing-field-initializers',
839 '-Wold-style-definition',
843 '-Wstrict-prototypes',
846 '-Wunused-but-set-parameter',
847 '-Wunused-but-set-variable',
848 '-Wunused-parameter',
852 foreach compiler_flag : compiler_flags
853 if cc.has_argument(compiler_flag)
854 add_project_arguments(compiler_flag, language : 'c')
862 bashcompletionslinks = {}
868 subdir('libsmartcols')
871 subdir('login-utils')
879 includes = [dir_include,
889 opt = not get_option('build-chfn-chsh').disabled()
894 include_directories : includes,
895 link_with : [lib_common, logindefs_c],
896 dependencies : chfn_chsh_deps,
897 install_dir : usrbin_exec_dir,
899 build_by_default : opt)
903 'login-utils/chsh.c',
906 include_directories : includes,
907 link_with : lib_common,
908 dependencies : chfn_chsh_deps,
909 install_dir : usrbin_exec_dir,
911 build_by_default : opt)
912 if opt and not is_disabler(exe)
914 manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
915 bashcompletions += ['chfn', 'chsh']
920 test_islocal_sources,
921 include_directories : includes,
922 c_args : '-DTEST_PROGRAM')
927 test_consoles_sources,
928 c_args : ['-DTEST_PROGRAM'],
929 include_directories : includes,
930 link_with : lib_common)
933 opt = not get_option('build-last').disabled()
937 include_directories : includes,
938 link_with : [lib_common],
939 install_dir : usrbin_exec_dir,
941 build_by_default : opt)
942 if opt and not is_disabler(exe)
944 meson.add_install_script(meson_make_symlink,
946 join_paths(usrbin_exec_dir, 'lastb'))
947 manadocs += ['login-utils/last.1.adoc']
948 manlinks += {'lastb.1': 'last.1'}
949 bashcompletions += ['last']
950 bashcompletionslinks += {'lastb': 'last'}
953 opt = not get_option('build-nologin').disabled()
956 'login-utils/nologin.c',
957 include_directories : includes,
958 install_dir : sbindir,
959 link_with : [lib_common],
961 build_by_default : opt)
962 if opt and not is_disabler(exe)
964 manadocs += ['login-utils/nologin.8.adoc']
967 opt = not get_option('build-utmpdump').disabled()
970 'login-utils/utmpdump.c',
971 include_directories : includes,
972 link_with : [lib_common],
973 install_dir : usrbin_exec_dir,
975 build_by_default : opt)
976 if opt and not is_disabler(exe)
978 manadocs += ['login-utils/utmpdump.1.adoc']
979 bashcompletions += ['utmpdump']
982 opt = not get_option('build-su').disabled()
986 'login-utils/su-common.c',
987 'login-utils/su-common.h',
991 include_directories : includes,
992 link_with : [lib_common, logindefs_c],
993 dependencies : [lib_pam,
998 build_by_default : opt)
999 if opt and not is_disabler(exe)
1001 manadocs += ['login-utils/su.1.adoc']
1002 bashcompletions += ['su']
1005 opt = not get_option('build-newgrp').disabled()
1008 'login-utils/newgrp.c',
1009 include_directories : includes,
1010 dependencies : [lib_crypt],
1011 install_dir : usrbin_exec_dir,
1013 build_by_default : opt)
1014 if opt and not is_disabler(exe)
1016 manadocs += ['login-utils/newgrp.1.adoc']
1017 bashcompletions += ['newgrp']
1020 opt = not get_option('build-lslogins').disabled()
1023 'login-utils/lslogins.c',
1024 include_directories : includes,
1025 link_with : [lib_common,
1028 dependencies : [lib_selinux,
1030 install_dir : usrbin_exec_dir,
1032 build_by_default : opt)
1033 if opt and not is_disabler(exe)
1035 manadocs += ['login-utils/lslogins.1.adoc']
1036 bashcompletions += ['lslogins']
1039 opt = not get_option('build-vipw').disabled()
1042 'login-utils/vipw.c',
1043 'login-utils/setpwnam.h',
1044 include_directories : includes,
1045 link_with : [lib_common],
1046 dependencies : [lib_selinux],
1047 install_dir : usrbin_exec_dir,
1049 build_by_default : opt)
1050 if opt and not is_disabler(exe)
1052 meson.add_install_script(meson_make_symlink,
1054 join_paths(usrbin_exec_dir, 'vigr'))
1055 manadocs += ['login-utils/vipw.8.adoc']
1056 meson.add_install_script(meson_make_symlink,
1058 join_paths(mandir, 'man8/vigr.8'))
1061 opt = not get_option('build-runuser').disabled()
1064 'login-utils/runuser.c',
1065 'login-utils/su-common.c',
1066 'login-utils/su-common.h',
1070 include_directories : includes,
1071 link_with : [lib_common, logindefs_c],
1072 dependencies : [lib_pam,
1076 install_dir : sbindir,
1078 build_by_default : opt)
1079 if opt and not is_disabler(exe)
1081 manadocs += ['login-utils/runuser.1.adoc']
1082 bashcompletionslinks += {'runuser': 'su'}
1085 ############################################################
1090 include_directories : includes,
1091 link_with : lib_common,
1092 install_dir : usrbin_exec_dir,
1095 manadocs += ['text-utils/col.1.adoc']
1096 bashcompletions += ['col']
1101 include_directories : includes,
1102 install_dir : usrbin_exec_dir,
1105 manadocs += ['text-utils/colcrt.1.adoc']
1106 bashcompletions += ['colcrt']
1111 include_directories : includes,
1112 link_with : lib_common,
1113 install_dir : usrbin_exec_dir,
1116 manadocs += ['text-utils/colrm.1.adoc']
1117 bashcompletions += ['colrm']
1122 include_directories : includes,
1123 install_dir : usrbin_exec_dir,
1126 manadocs += ['text-utils/rev.1.adoc']
1127 bashcompletions += ['rev']
1132 include_directories : includes,
1133 link_with : [lib_common,
1135 install_dir : usrbin_exec_dir,
1137 if not is_disabler(exe)
1139 manadocs += ['text-utils/column.1.adoc']
1140 bashcompletions += ['column']
1143 opt = not get_option('build-line').disabled()
1147 include_directories : includes,
1148 install_dir : usrbin_exec_dir,
1150 build_by_default : opt)
1151 if opt and not is_disabler(exe)
1153 manadocs += ['text-utils/line.1.adoc']
1156 opt = not get_option('build-pg').disabled()
1160 link_with : lib_common,
1161 include_directories : includes,
1162 dependencies : [lib_tinfo,
1164 install_dir : usrbin_exec_dir,
1166 build_by_default : opt)
1167 if opt and not is_disabler(exe)
1169 manadocs += ['text-utils/pg.1.adoc']
1170 bashcompletions += ['pg']
1173 opt = not get_option('build-ul').disabled()
1177 include_directories : includes,
1178 dependencies : [lib_tinfo,
1180 install_dir : usrbin_exec_dir,
1182 build_by_default : opt)
1183 if opt and not is_disabler(exe)
1185 manadocs += ['text-utils/ul.1.adoc']
1186 bashcompletions += ['ul']
1189 opt = not get_option('build-more').disabled()
1193 link_with : [lib_common],
1194 include_directories : includes,
1195 dependencies : [lib_tinfo,
1199 build_by_default : opt)
1203 link_with : [lib_common],
1204 include_directories : includes,
1205 c_args : '-DTEST_PROGRAM',
1206 dependencies : [lib_tinfo,
1209 build_by_default : opt)
1211 if opt and not is_disabler(exe)
1213 manadocs += ['text-utils/more.1.adoc']
1214 bashcompletions += ['more']
1220 include_directories : includes,
1221 link_with : [lib_common,
1223 install_dir : usrbin_exec_dir,
1225 if not is_disabler(exe)
1227 manadocs += ['text-utils/hexdump.1.adoc']
1228 bashcompletions += ['hexdump']
1231 opt = not get_option('build-lsmem').disabled()
1235 include_directories : includes,
1236 link_with : [lib_common,
1238 install_dir : usrbin_exec_dir,
1240 build_by_default : opt)
1241 if opt and not is_disabler(exe)
1243 manadocs += ['sys-utils/lsmem.1.adoc']
1244 bashcompletions += ['lsmem']
1247 opt = not get_option('build-chmem').disabled()
1251 include_directories : includes,
1252 link_with : [lib_common],
1253 install_dir : usrbin_exec_dir,
1255 build_by_default : opt)
1256 if opt and not is_disabler(exe)
1258 manadocs += ['sys-utils/chmem.8.adoc']
1259 bashcompletions += ['chmem']
1265 include_directories : includes,
1266 link_with : [lib_common],
1267 install_dir : usrbin_exec_dir,
1270 manadocs += ['sys-utils/choom.1.adoc']
1275 include_directories : includes,
1276 link_with : [lib_common],
1277 install_dir : usrbin_exec_dir,
1280 manadocs += ['sys-utils/ipcmk.1.adoc']
1281 bashcompletions += ['ipcmk']
1286 include_directories : includes,
1287 link_with : [lib_common],
1288 install_dir : usrbin_exec_dir,
1291 manadocs += ['sys-utils/ipcrm.1.adoc']
1292 bashcompletions += ['ipcrm']
1294 opt = not get_option('build-ipcs').disabled()
1298 include_directories : includes,
1299 link_with : [lib_common],
1300 install_dir : usrbin_exec_dir,
1302 build_by_default : opt)
1303 if opt and not is_disabler(exe)
1305 manadocs += ['sys-utils/ipcs.1.adoc']
1306 bashcompletions += ['ipcs']
1309 opt = not get_option('build-rfkill').disabled()
1313 include_directories : includes,
1314 link_with : [lib_common,
1316 install_dir : usrsbin_exec_dir,
1318 build_by_default : opt)
1319 if opt and not is_disabler(exe)
1321 manadocs += ['sys-utils/rfkill.8.adoc']
1322 bashcompletions += ['rfkill']
1328 include_directories : includes,
1329 link_with : [lib_common,
1331 install_dir : usrbin_exec_dir,
1333 if not is_disabler(exe)
1335 manadocs += ['sys-utils/renice.1.adoc']
1336 bashcompletions += ['renice']
1342 include_directories : includes,
1343 link_with : [lib_common,
1345 install_dir : usrbin_exec_dir,
1347 if opt and not is_disabler(exe)
1349 manadocs += ['sys-utils/setsid.1.adoc']
1350 bashcompletions += ['setsid']
1355 readprofile_sources,
1356 include_directories : includes,
1357 link_with : [lib_common,
1359 install_dir : usrsbin_exec_dir,
1361 if not is_disabler(exe)
1363 manadocs += ['sys-utils/readprofile.8.adoc']
1364 bashcompletions += ['readprofile']
1367 opt = not get_option('build-tunelp').disabled()
1371 include_directories : includes,
1372 link_with : [lib_common],
1373 install_dir : usrsbin_exec_dir,
1375 build_by_default : opt)
1376 if opt and not is_disabler(exe)
1378 manadocs += ['sys-utils/tunelp.8.adoc']
1379 bashcompletions += ['tunelp']
1385 include_directories : includes,
1386 link_with : [lib_common,
1388 install_dir : sbindir,
1390 if not is_disabler(exe)
1392 manadocs += ['sys-utils/fstrim.8.adoc']
1393 bashcompletions += ['fstrim']
1399 include_directories : includes,
1400 link_with : [lib_common,
1403 if not is_disabler(exe)
1405 manadocs += ['sys-utils/dmesg.1.adoc']
1406 bashcompletions += ['dmesg']
1412 include_directories : dir_include,
1413 c_args : '-DTEST_DMESG',
1414 link_with : [lib_common,
1416 if not is_disabler(exe)
1423 include_directories : includes,
1424 link_with : [lib_common],
1425 install_dir : sbindir,
1428 manadocs += ['sys-utils/ctrlaltdel.8.adoc']
1429 bashcompletions += ['ctrlaltdel']
1434 include_directories : includes,
1435 install_dir : sbindir,
1438 manadocs += ['sys-utils/fsfreeze.8.adoc']
1439 bashcompletions += ['fsfreeze']
1444 include_directories : includes,
1445 link_with : [lib_common,
1447 install_dir : sbindir,
1450 manadocs += ['sys-utils/blkdiscard.8.adoc']
1451 bashcompletions += ['blkdiscard']
1456 include_directories : includes,
1457 link_with : [lib_common],
1458 install_dir : sbindir,
1461 manadocs += ['sys-utils/blkzone.8.adoc']
1462 bashcompletions += ['blkzone']
1467 include_directories : includes,
1468 link_with : [lib_common],
1469 install_dir : sbindir,
1472 manadocs += ['sys-utils/blkpr.8.adoc']
1477 include_directories : includes,
1478 link_with : [lib_common],
1479 install_dir : usrsbin_exec_dir,
1482 manadocs += ['sys-utils/ldattach.8.adoc']
1483 bashcompletions += ['ldattach']
1488 include_directories : includes,
1489 link_with : [lib_common],
1490 install_dir : usrsbin_exec_dir,
1493 manadocs += ['sys-utils/rtcwake.8.adoc']
1494 bashcompletions += ['rtcwake']
1499 include_directories : includes,
1500 link_with : [lib_common],
1501 install_dir : usrbin_exec_dir,
1504 manadocs += ['sys-utils/setarch.8.adoc']
1505 bashcompletions += ['setarch']
1507 setarch_links = ['uname26', 'linux32', 'linux64']
1508 setarch_links_arch = {
1509 's390x' : ['s390', 's390x'],
1511 'x86_64' : ['i386', 'x86_64'],
1512 'ppc64' : ['ppc', 'ppc64', 'ppc32'],
1513 'space64' : ['sparc', 'sparc64', 'sparc32', 'sparc32bash'],
1514 'mips64' : ['mips', 'mips64', 'mips32'],
1515 'ia64' : ['i386', 'ia64'],
1516 'hppa' : ['parisc', 'parisc64', 'parisc32'],
1518 setarch_links += setarch_links_arch.get(host_machine.cpu_family(), [])
1520 foreach link: setarch_links
1521 meson.add_install_script(meson_make_symlink,
1523 join_paths(usrbin_exec_dir, link))
1524 manlinks += {link + '.8': 'setarch.8'}
1527 opt = not get_option('build-eject').disabled()
1531 include_directories : includes,
1532 link_with : [lib_common,
1534 install_dir : usrbin_exec_dir,
1536 build_by_default : opt)
1537 if opt and not is_disabler(exe)
1539 manadocs += ['sys-utils/eject.1.adoc']
1540 bashcompletions += ['eject']
1543 opt = not get_option('build-losetup').disabled()
1547 include_directories : includes,
1548 link_with : [lib_common,
1550 install_dir : sbindir,
1552 build_by_default : opt)
1553 if opt and not is_disabler(exe)
1554 manadocs += ['sys-utils/losetup.8.adoc']
1556 bashcompletions += ['losetup']
1559 opt = opt and 'losetup' in static_programs
1563 include_directories : includes,
1564 link_args : ['--static'],
1565 link_with : [lib_common,
1566 lib_smartcols.get_static_lib()],
1567 install_dir : sbindir,
1569 build_by_default : opt)
1570 if opt and not is_disabler(exe)
1574 opt = not get_option('build-zramctl').disabled()
1578 include_directories : includes,
1579 link_with : [lib_common,
1581 install_dir : sbindir,
1583 build_by_default : opt)
1584 if opt and not is_disabler(exe)
1586 manadocs += ['sys-utils/zramctl.8.adoc']
1587 bashcompletions += ['zramctl']
1593 include_directories : includes,
1594 link_with : [lib_common,
1596 install_dir : usrbin_exec_dir,
1598 if not is_disabler(exe)
1600 manadocs += ['sys-utils/prlimit.1.adoc']
1601 bashcompletions += ['prlimit']
1607 include_directories : includes,
1608 link_with : [lib_common,
1611 install_dir : usrbin_exec_dir,
1613 if not is_disabler(exe)
1615 manadocs += ['sys-utils/lsns.8.adoc']
1616 bashcompletions += ['lsns']
1619 opt = not get_option('build-mount').disabled()
1623 include_directories : includes,
1624 link_with : [lib_common,
1627 dependencies : lib_selinux,
1629 build_by_default : opt)
1633 include_directories : includes,
1634 link_with : [lib_common,
1637 build_by_default : opt)
1638 if opt and not is_disabler(exe)
1640 manadocs += ['sys-utils/fstab.5.adoc',
1641 'sys-utils/mount.8.adoc',
1642 'sys-utils/umount.8.adoc']
1643 bashcompletions += ['mount', 'umount']
1646 opt2 = opt and 'mount' in static_programs
1650 include_directories : includes,
1651 link_args : ['--static'],
1652 link_with : [lib_common,
1653 lib_smartcols_static,
1656 build_by_default : opt2)
1657 if opt2 and not is_disabler(exe)
1661 opt2 = opt and 'umount' in static_programs
1665 include_directories : includes,
1666 link_args : ['--static'],
1667 link_with : [lib_common,
1670 build_by_default : opt2)
1671 if opt2 and not is_disabler(exe)
1680 include_directories : includes,
1681 link_with : [lib_common,
1685 install_dir : sbindir,
1687 if not is_disabler(exe)
1689 manadocs += ['sys-utils/swapon.8.adoc']
1690 bashcompletions += ['swapon']
1696 include_directories : includes,
1697 link_with : [lib_common,
1700 install_dir : sbindir,
1702 if not is_disabler(exe)
1704 manlinks += {'swapoff.8': 'swapon.8'}
1705 bashcompletions += ['swapoff']
1711 include_directories : includes,
1712 link_with : [lib_common,
1714 dependencies : [rtas_libs],
1715 install_dir : usrbin_exec_dir,
1717 if not is_disabler(exe)
1719 manadocs += ['sys-utils/lscpu.1.adoc']
1720 bashcompletions += ['lscpu']
1726 include_directories : includes,
1727 link_with : [lib_common],
1728 install_dir : sbindir,
1731 manadocs += ['sys-utils/chcpu.8.adoc']
1732 bashcompletions += ['chcpu']
1737 include_directories : includes,
1738 link_with : [lib_common,
1741 if not is_disabler(exe)
1743 manadocs += ['sys-utils/wdctl.8.adoc']
1744 bashcompletions += ['wdctl']
1747 opt = not get_option('build-mountpoint').disabled()
1751 include_directories : includes,
1752 link_with : [lib_mount],
1754 build_by_default : opt)
1755 if opt and not is_disabler(exe)
1757 manadocs += ['sys-utils/mountpoint.1.adoc']
1758 bashcompletions += ['mountpoint']
1761 opt = not get_option('build-fallocate').disabled()
1765 include_directories : includes,
1766 link_with : [lib_common],
1767 install_dir : usrbin_exec_dir,
1769 build_by_default : opt)
1770 if opt and not is_disabler(exe)
1772 manadocs += ['sys-utils/fallocate.1.adoc']
1773 bashcompletions += ['fallocate']
1776 opt = not get_option('build-pivot_root').disabled()
1780 include_directories : includes,
1781 install_dir : sbindir,
1783 build_by_default : opt)
1784 if opt and not is_disabler(exe)
1786 manadocs += ['sys-utils/pivot_root.8.adoc']
1787 bashcompletions += ['pivot_root']
1790 opt = not get_option('build-switch_root').disabled()
1791 if opt and not have_dirfd and not have_ddfd
1792 error('neither dirfd nor ddfd are available')
1796 switch_root_sources,
1797 include_directories : includes,
1798 install_dir : sbindir,
1800 build_by_default : opt)
1801 if opt and not is_disabler(exe)
1803 manadocs += ['sys-utils/switch_root.8.adoc']
1806 opt = not get_option('build-unshare').disabled()
1810 include_directories : includes,
1811 link_with : [lib_common],
1812 install_dir : usrbin_exec_dir,
1814 build_by_default : opt)
1815 if opt and not is_disabler(exe)
1817 manadocs += ['sys-utils/unshare.1.adoc']
1818 bashcompletions += ['unshare']
1821 opt = opt and 'unshare' in static_programs
1825 include_directories : includes,
1826 link_with : [lib_common],
1827 install_dir : usrbin_exec_dir,
1829 build_by_default : opt)
1830 if opt and not is_disabler(exe)
1834 opt = not get_option('build-nsenter').disabled()
1838 include_directories : includes,
1839 link_with : [lib_common],
1840 dependencies : [lib_selinux],
1841 install_dir : usrbin_exec_dir,
1843 build_by_default : opt)
1844 if opt and not is_disabler(exe)
1846 manadocs += ['sys-utils/nsenter.1.adoc']
1847 bashcompletions += ['nsenter']
1850 opt = opt and 'nsenter' in static_programs
1854 include_directories : includes,
1855 link_with : [lib_common],
1856 dependencies : [lib_selinux],
1857 install_dir : usrbin_exec_dir,
1859 build_by_default : opt)
1860 if opt and not is_disabler(exe)
1864 opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
1868 include_directories : includes,
1869 link_with : [lib_common],
1870 dependencies : [lib_cap_ng],
1871 install_dir : usrbin_exec_dir,
1873 build_by_default : opt)
1874 if opt and not is_disabler(exe)
1876 manadocs += ['sys-utils/setpriv.1.adoc']
1877 bashcompletions += ['setpriv']
1883 include_directories : includes,
1884 link_with : [lib_common],
1885 dependencies : realtime_libs,
1886 install_dir : usrbin_exec_dir,
1889 manadocs += ['sys-utils/flock.1.adoc']
1890 bashcompletions += ['flock']
1892 opt = not get_option('build-lsirq').disabled()
1896 include_directories : includes,
1897 link_with : [lib_common,
1899 install_dir : usrbin_exec_dir,
1901 build_by_default : opt)
1902 if opt and not is_disabler(exe)
1904 manadocs += ['sys-utils/lsirq.1.adoc']
1905 bashcompletions += ['lsirq']
1908 opt = not get_option('build-irqtop').disabled()
1912 include_directories : includes,
1913 dependencies : [realtime_libs, curses_libs],
1914 link_with : [lib_common,
1917 install_dir : usrbin_exec_dir,
1919 build_by_default : opt)
1920 if opt and not is_disabler(exe)
1922 manadocs += ['sys-utils/irqtop.1.adoc']
1923 bashcompletions += ['irqtop']
1926 opt = not get_option('build-ipcs').disabled()
1930 include_directories : includes,
1931 link_with : [lib_common,
1933 install_dir : usrbin_exec_dir,
1935 build_by_default : opt)
1936 if opt and not is_disabler(exe)
1938 manadocs += ['sys-utils/lsipc.1.adoc']
1939 bashcompletions += ['lsipc']
1946 include_directories : includes,
1947 link_with : [lib_common],
1948 dependencies : [lib_m,
1950 install_dir : sbindir,
1952 build_by_default : opt)
1953 if opt and not is_disabler(exe)
1955 manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
1956 bashcompletions += ['hwclock']
1962 include_directories : includes,
1963 install_dir : sbindir,
1966 manadocs += ['disk-utils/mkfs.8.adoc']
1967 bashcompletions += ['mkfs']
1969 opt = not get_option('build-bfs').disabled()
1973 include_directories : includes,
1974 link_with : [lib_common],
1975 install_dir : sbindir,
1977 build_by_default : opt)
1978 if opt and not is_disabler(exe)
1980 manadocs += ['disk-utils/mkfs.bfs.8.adoc']
1981 bashcompletions += ['mkfs.bfs']
1987 include_directories : includes,
1988 link_with : [lib_common],
1989 install_dir : usrbin_exec_dir,
1992 manadocs += ['disk-utils/isosize.8.adoc']
1993 bashcompletions += ['isosize']
1998 include_directories : includes,
1999 link_with : [lib_common,
2002 dependencies: [lib_selinux],
2003 install_dir : sbindir,
2005 if opt and not is_disabler(exe)
2007 manadocs += ['disk-utils/mkswap.8.adoc']
2008 bashcompletions += ['mkswap']
2014 include_directories : includes,
2015 link_with : [lib_common,
2018 install_dir : sbindir,
2020 if opt and not is_disabler(exe)
2022 manadocs += ['disk-utils/swaplabel.8.adoc']
2023 bashcompletions += ['swaplabel']
2026 opt = not get_option('build-fsck').disabled()
2030 include_directories : includes,
2031 link_with : [lib_common,
2034 dependencies : realtime_libs,
2035 install_dir : sbindir,
2037 build_by_default : opt)
2038 if opt and not is_disabler(exe)
2040 manadocs += ['disk-utils/fsck.8.adoc']
2041 bashcompletions += ['fsck']
2044 opt = not get_option('build-minix').disabled()
2048 include_directories : includes,
2049 link_with : [lib_common],
2050 install_dir : sbindir,
2052 build_by_default : opt)
2056 include_directories : includes,
2057 c_args : '-DTEST_SCRIPT',
2058 link_with : [lib_common],
2059 build_by_default : opt)
2063 include_directories : includes,
2064 link_with : [lib_common],
2065 install_dir : sbindir,
2067 build_by_default : opt)
2068 if opt and not is_disabler(exe)
2069 exes += [exe, exe2, exe3]
2070 manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
2071 bashcompletions += ['mkfs.minix', 'fsck.minix']
2074 opt = not get_option('build-cramfs').disabled()
2077 mkfs_cramfs_sources,
2078 include_directories : includes,
2079 link_with : [lib_common],
2080 dependencies : [lib_z],
2081 install_dir : sbindir,
2083 build_by_default : opt)
2086 fsck_cramfs_sources,
2087 include_directories : includes,
2088 link_with : [lib_common],
2089 dependencies : [lib_z],
2090 install_dir : sbindir,
2092 build_by_default : opt)
2093 if not is_disabler(exe)
2095 manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
2096 bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
2099 opt = not get_option('build-raw').disabled()
2101 cc.has_header('linux/raw.h', required: opt)
2106 include_directories : includes,
2107 install_dir : sbindir,
2109 build_by_default : opt)
2110 if opt and not is_disabler(exe)
2112 manadocs += ['disk-utils/raw.8.adoc']
2113 bashcompletions += ['raw']
2116 opt = not get_option('build-fdformat').disabled()
2120 include_directories : includes,
2121 link_with : [lib_common],
2122 install_dir : usrsbin_exec_dir,
2124 build_by_default : opt)
2125 if opt and not is_disabler(exe)
2127 manadocs += ['disk-utils/fdformat.8.adoc']
2133 include_directories : includes,
2134 link_with : [lib_common],
2135 install_dir : sbindir,
2137 manadocs += ['disk-utils/blockdev.8.adoc']
2138 bashcompletions += ['blockdev']
2140 opt = not get_option('build-fdisks').disabled()
2141 if opt and not have_dirfd and not have_ddfd
2142 error('neither dirfd nor ddfd are available')
2147 include_directories : includes,
2148 link_with : [lib_common,
2152 dependencies : [lib_readline],
2153 install_dir : sbindir,
2155 build_by_default : opt)
2156 if opt and not is_disabler(exe)
2158 bashcompletions += ['fdisk']
2161 opt2 = opt and 'fdisk' in static_programs
2165 link_args : ['--static'],
2166 include_directories : includes,
2167 link_with : [lib_common,
2170 lib_smartcols.get_static_lib()],
2171 dependencies : [lib_readline_static],
2172 install_dir : sbindir,
2174 build_by_default : opt2)
2175 if opt2 and not is_disabler(exe)
2182 include_directories : includes,
2183 link_with : [lib_common,
2187 dependencies : [lib_readline],
2188 install_dir : sbindir,
2190 build_by_default : opt)
2191 if opt and not is_disabler(exe)
2193 bashcompletions += ['sfdisk']
2196 opt2 = opt and 'sfdisk' in static_programs
2200 include_directories : includes,
2201 link_with : [lib_common,
2204 lib_smartcols.get_static_lib()],
2205 dependencies : [lib_readline_static],
2206 install_dir : sbindir,
2208 build_by_default : opt2)
2209 if opt2 and not is_disabler(exe)
2216 include_directories : includes,
2217 link_with : [lib_common,
2222 dependencies : [curses_libs],
2223 install_dir : sbindir,
2225 build_by_default : opt)
2226 if opt and not is_disabler(exe)
2228 manadocs += ['disk-utils/fdisk.8.adoc',
2229 'disk-utils/sfdisk.8.adoc',
2230 'disk-utils/cfdisk.8.adoc']
2231 bashcompletions += ['cfdisk']
2234 opt = not get_option('build-partx').disabled()
2238 include_directories : includes,
2239 link_with : [lib_common],
2240 install_dir : usrsbin_exec_dir,
2242 build_by_default : opt)
2246 include_directories : includes,
2247 link_with : [lib_common],
2248 install_dir : usrsbin_exec_dir,
2250 build_by_default : opt)
2254 include_directories : includes,
2255 link_with : [lib_common],
2256 install_dir : usrsbin_exec_dir,
2258 build_by_default : opt)
2262 include_directories : includes,
2263 link_with : [lib_common,
2266 install_dir : usrsbin_exec_dir,
2268 build_by_default : opt)
2270 exes += [exe, exe2, exe3, exe4]
2271 manadocs += ['disk-utils/addpart.8.adoc',
2272 'disk-utils/delpart.8.adoc',
2273 'disk-utils/resizepart.8.adoc',
2274 'disk-utils/partx.8.adoc']
2275 bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
2278 ############################################################
2283 include_directories : includes,
2284 link_with : [lib_common],
2285 dependencies : [lib_util,
2289 install_dir : usrbin_exec_dir,
2292 manadocs += ['term-utils/script.1.adoc']
2293 bashcompletions += ['script']
2298 include_directories : includes,
2299 c_args : '-DTEST_SCRIPT',
2300 link_with : [lib_common],
2301 dependencies : [lib_util,
2310 include_directories : includes,
2311 link_with : [lib_common],
2312 dependencies : [lib_util,
2315 install_dir : usrbin_exec_dir,
2318 manadocs += ['term-utils/scriptlive.1.adoc']
2319 bashcompletions += ['scriptlive']
2323 scriptreplay_sources,
2324 include_directories : includes,
2325 link_with : [lib_common],
2326 dependencies : [math_libs],
2327 install_dir : usrbin_exec_dir,
2330 manadocs += ['term-utils/scriptreplay.1.adoc']
2331 bashcompletions += ['scriptreplay']
2333 opt = not get_option('build-agetty').disabled()
2337 include_directories : includes,
2338 link_with : [lib_common, logindefs_c],
2339 dependencies : BSD ? lib_util : [],
2340 install_dir : sbindir,
2342 build_by_default : opt)
2345 manadocs += ['term-utils/agetty.8.adoc']
2348 opt = not get_option('build-setterm').disabled()
2352 include_directories : includes,
2353 link_with : [lib_common],
2354 dependencies : [curses_libs],
2355 install_dir : usrbin_exec_dir,
2357 build_by_default : opt)
2360 manadocs += ['term-utils/setterm.1.adoc']
2361 bashcompletions += ['setterm']
2364 opt = not get_option('build-mesg').disabled()
2368 include_directories : includes,
2369 link_with : [lib_common],
2370 install_dir : usrbin_exec_dir,
2372 build_by_default : opt)
2375 manadocs += ['term-utils/mesg.1.adoc']
2376 bashcompletions += ['mesg']
2379 opt = not get_option('build-wall').disabled()
2383 include_directories : includes,
2384 link_with : [lib_common],
2385 install_dir : usrbin_exec_dir,
2387 build_by_default : opt)
2390 manadocs += ['term-utils/wall.1.adoc']
2391 bashcompletions += ['wall']
2394 # chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
2395 # chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
2397 opt = not get_option('build-write').disabled()
2401 include_directories : includes,
2402 link_with : [lib_common],
2403 install_dir : usrbin_exec_dir,
2405 build_by_default : opt)
2408 manadocs += ['term-utils/write.1.adoc']
2409 bashcompletions += ['write']
2412 # chgrp tty $(DESTDIR)$(usrbin_execdir)/write
2413 # chmod g+s $(DESTDIR)$(usrbin_execdir)/write
2415 opt = not get_option('build-login').disabled()
2419 include_directories : includes,
2420 link_with : [lib_common, logindefs_c],
2421 dependencies : [lib_pam,
2425 build_by_default : opt)
2426 if not is_disabler(exe)
2428 manadocs += ['login-utils/login.1.adoc']
2431 opt = not get_option('build-sulogin').disabled()
2435 include_directories : includes,
2436 link_with : [lib_common],
2437 dependencies : [lib_crypt,
2439 install_dir : sbindir,
2441 build_by_default : opt)
2442 if not is_disabler(exe)
2444 manadocs += ['login-utils/sulogin.8.adoc']
2450 include_directories : includes,
2451 link_with : [lib_common,
2453 dependencies : [curses_libs],
2454 install_dir : usrbin_exec_dir,
2457 manadocs += ['misc-utils/cal.1.adoc']
2458 bashcompletions += ['cal']
2460 opt = not get_option('build-logger').disabled()
2464 include_directories : includes,
2465 link_with : [lib_common],
2466 dependencies : [lib_systemd],
2467 install_dir : usrbin_exec_dir,
2469 build_by_default : opt)
2470 if opt and not is_disabler(exe)
2472 manadocs += ['misc-utils/logger.1.adoc']
2473 bashcompletions += ['logger']
2479 include_directories : includes,
2480 c_args : '-DTEST_LOGGER',
2481 link_with : [lib_common],
2482 dependencies : [lib_systemd])
2483 if not is_disabler(exe)
2490 include_directories : includes,
2491 install_dir : usrbin_exec_dir,
2494 manadocs += ['misc-utils/look.1.adoc']
2495 bashcompletions += ['look']
2500 include_directories : includes,
2501 link_with : [lib_common],
2502 install_dir : usrbin_exec_dir,
2505 manadocs += ['misc-utils/mcookie.1.adoc']
2506 bashcompletions += ['mcookie']
2511 include_directories : includes,
2512 dependencies : [lib_selinux],
2513 install_dir : usrbin_exec_dir,
2516 manadocs += ['misc-utils/namei.1.adoc']
2517 bashcompletions += ['namei']
2522 include_directories : includes,
2523 link_with : [lib_common],
2524 install_dir : usrbin_exec_dir,
2527 manadocs += ['misc-utils/whereis.1.adoc']
2528 bashcompletions += ['whereis']
2533 include_directories : includes,
2534 link_with : [lib_common,
2537 install_dir : usrbin_exec_dir,
2539 if not is_disabler(exe)
2541 manadocs += ['misc-utils/lslocks.8.adoc']
2542 bashcompletions += ['lslocks']
2548 include_directories : includes,
2549 link_with : [lib_common,
2553 dependencies : lib_udev,
2555 if not is_disabler(exe)
2557 manadocs += ['misc-utils/lsblk.8.adoc']
2558 bashcompletions += ['lsblk']
2564 include_directories : includes,
2565 link_with : [lib_common,
2567 install_dir : usrbin_exec_dir,
2569 if not is_disabler(exe)
2571 manadocs += ['misc-utils/lsfd.1.adoc']
2577 include_directories : includes,
2578 link_with : [lib_uuid],
2579 install_dir : usrbin_exec_dir,
2581 if not is_disabler(exe)
2583 manadocs += ['misc-utils/uuidgen.1.adoc']
2584 bashcompletions += ['uuidgen']
2590 include_directories : includes,
2591 link_with : [lib_common,
2594 install_dir : usrbin_exec_dir,
2596 if not is_disabler(exe)
2598 manadocs += ['misc-utils/uuidparse.1.adoc']
2599 bashcompletions += ['uuidparse']
2606 include_directories : includes,
2607 link_with : [lib_common,
2609 dependencies : [realtime_libs,
2611 install_dir : usrsbin_exec_dir,
2613 build_by_default : opt)
2617 include_directories : includes,
2618 link_with : [lib_common,
2620 dependencies : thread_libs,
2621 build_by_default : opt)
2622 if not is_disabler(exe)
2624 manadocs += ['misc-utils/uuidd.8.adoc']
2625 bashcompletions += ['uuidd']
2628 opt = build_libblkid
2632 include_directories : includes,
2633 link_with : [lib_common,
2635 install_dir : sbindir,
2637 build_by_default : opt)
2638 if opt and not is_disabler(exe)
2640 manadocs += ['misc-utils/blkid.8.adoc']
2641 bashcompletions += ['blkid']
2644 opt = opt and 'blkid' in static_programs
2648 include_directories : includes,
2649 link_with : [lib_common,
2651 install_dir : sbindir,
2653 build_by_default : opt)
2654 if opt and not is_disabler(exe)
2660 'libblkid/samples/mkfs.c',
2661 include_directories : includes,
2662 link_with : lib_blkid)
2663 if not is_disabler(exe)
2668 'sample-partitions',
2669 'libblkid/samples/partitions.c',
2670 include_directories : includes,
2671 link_with : lib_blkid)
2672 if not is_disabler(exe)
2677 'sample-superblocks',
2678 'libblkid/samples/superblocks.c',
2679 include_directories : includes,
2680 link_with : lib_blkid)
2681 if not is_disabler(exe)
2687 'libblkid/samples/topology.c',
2688 include_directories : includes,
2689 link_with : lib_blkid)
2690 if not is_disabler(exe)
2695 'test_blkid_fuzz_sample',
2696 'libblkid/src/fuzz.c',
2697 include_directories: includes,
2698 link_with: lib_blkid)
2699 if not is_disabler(exe)
2703 ############################################################
2708 include_directories : includes,
2709 link_with : [lib_blkid],
2710 install_dir : sbindir,
2712 if not is_disabler(exe)
2714 manadocs += ['misc-utils/findfs.8.adoc']
2715 bashcompletions += ['findfs']
2721 include_directories : includes,
2722 link_with : [lib_common,
2725 install_dir : sbindir,
2727 if not is_disabler(exe)
2729 manadocs += ['misc-utils/wipefs.8.adoc']
2730 bashcompletions += ['wipefs']
2736 include_directories : includes,
2737 link_with : [lib_common,
2741 dependencies : [lib_udev],
2743 if not is_disabler(exe)
2745 manadocs += ['misc-utils/findmnt.8.adoc']
2746 bashcompletions += ['findmnt']
2752 include_directories : includes,
2753 link_with : [lib_common],
2755 if not is_disabler(exe)
2757 manadocs += ['misc-utils/kill.1.adoc']
2760 opt = not get_option('build-rename').disabled()
2764 include_directories : includes,
2765 install_dir : usrbin_exec_dir,
2767 build_by_default : opt)
2768 if opt and not is_disabler(exe)
2770 manadocs += ['misc-utils/rename.1.adoc']
2771 bashcompletions += ['rename']
2777 include_directories : includes,
2778 link_with : [lib_common],
2779 install_dir : usrbin_exec_dir,
2782 manadocs += ['misc-utils/getopt.1.adoc']
2783 bashcompletions += ['getopt']
2788 include_directories : includes,
2789 link_with : [lib_common,
2791 install_dir : usrbin_exec_dir,
2793 if not is_disabler(exe)
2795 manadocs += ['misc-utils/fincore.1.adoc']
2796 bashcompletions += ['fincore']
2802 include_directories : includes,
2803 link_with : [lib_common],
2804 install_dir : usrbin_exec_dir,
2806 if not is_disabler(exe)
2808 manadocs += ['misc-utils/hardlink.1.adoc']
2809 bashcompletions += ['hardlink']
2812 opt = not get_option('build-pipesz').disabled()
2816 include_directories : includes,
2817 link_with : [lib_common],
2818 install_dir : usrbin_exec_dir,
2820 if opt and not is_disabler(exe)
2822 manadocs += ['misc-utils/pipesz.1.adoc']
2823 bashcompletions += ['pipesz']
2829 include_directories : includes,
2830 c_args : '-DTEST_CAL',
2831 link_with : [lib_common,
2833 dependencies : [curses_libs])
2834 if not is_disabler(exe)
2841 include_directories : includes,
2842 link_with : [lib_common],
2843 install_dir : usrbin_exec_dir,
2845 if not is_disabler(exe)
2847 manadocs += ['misc-utils/fadvise.1.adoc']
2848 bashcompletions += ['fadvise']
2854 include_directories : includes,
2855 link_with : [lib_common],
2856 install_dir : usrbin_exec_dir,
2858 if not is_disabler(exe)
2860 manadocs += ['misc-utils/waitpid.1.adoc']
2861 bashcompletions += ['waitpid']
2864 syscalls_h = custom_target('syscalls.h',
2865 input : 'tools/all_syscalls',
2866 output : 'syscalls.h',
2867 command : ['bash', '@INPUT@', cc.cmd_array()],
2872 'misc-utils/enosys.c', syscalls_h,
2873 include_directories : includes,
2874 link_with : [lib_common],
2875 install_dir : usrbin_exec_dir,
2877 if not is_disabler(exe)
2879 manadocs += ['misc-utils/enosys.1.adoc']
2880 bashcompletions += ['enosys']
2883 ############################################################
2885 opt = not get_option('build-schedutils').disabled()
2888 'schedutils/chrt.c',
2889 include_directories : includes,
2890 link_with : lib_common,
2891 install_dir : usrbin_exec_dir,
2893 build_by_default : opt)
2897 'schedutils/ionice.c',
2898 include_directories : includes,
2899 link_with : lib_common,
2900 install_dir : usrbin_exec_dir,
2902 build_by_default : opt)
2906 'schedutils/taskset.c',
2907 include_directories : includes,
2908 link_with : lib_common,
2909 install_dir : usrbin_exec_dir,
2911 build_by_default : opt)
2915 'schedutils/uclampset.c',
2916 include_directories : includes,
2917 link_with : lib_common,
2918 install_dir : usrbin_exec_dir,
2920 build_by_default : opt)
2922 if opt and not is_disabler(exe)
2923 exes += [exe, exe2, exe3, exe4]
2924 manadocs += ['schedutils/chrt.1.adoc',
2925 'schedutils/ionice.1.adoc',
2926 'schedutils/taskset.1.adoc',
2927 'schedutils/uclampset.1.adoc']
2928 bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
2931 ############################################################
2933 # TODO: when autotools compat is not needed, s/_/-/g in file names?
2938 c_args : ['-DTEST_PROGRAM_TTYUTILS'],
2939 include_directories : dir_include,
2940 link_with : lib_common)
2946 c_args : ['-DTEST_PROGRAM_BLKDEV'],
2947 include_directories : dir_include,
2948 link_with : lib_common)
2954 c_args : ['-DTEST_PROGRAM_ISMOUNTED'],
2955 include_directories : dir_include,
2956 link_with : lib_common)
2962 c_args : ['-DTEST_PROGRAM_MANGLE'],
2963 include_directories : dir_include)
2969 c_args : ['-DTEST_PROGRAM_STRUTILS'],
2970 include_directories : dir_include)
2976 'lib/color-names.c',
2977 c_args : ['-DTEST_PROGRAM_COLORS'],
2978 include_directories : dir_include,
2979 link_with : [lib_common, lib_tcolors])
2985 c_args : ['-DTEST_PROGRAM_RANDUTILS'],
2986 include_directories : dir_include)
2989 # XXX: HAVE_OPENAT && HAVE_DIRFD
2993 c_args : ['-DTEST_PROGRAM_PROCFS'],
2994 include_directories : dir_include,
2995 link_with : lib_common)
2998 # XXX: HAVE_OPENAT && HAVE_DIRFD
3003 have_cpu_set_t ? 'lib/cpuset.c' : [],
3004 c_args : ['-DTEST_PROGRAM_PATH'],
3005 include_directories : dir_include,
3006 link_with : lib_common)
3014 c_args : ['-DTEST_PROGRAM_PTY'],
3015 include_directories : dir_include,
3016 link_with : [lib_common],
3017 dependencies : [lib_m,
3026 c_args : ['-DTEST_PROGRAM_CPUSET'],
3027 include_directories : dir_include)
3037 have_cpu_set_t ? 'lib/cpuset.c' : [],
3038 c_args : ['-DTEST_PROGRAM_SYSFS'],
3039 include_directories : dir_include)
3045 c_args : ['-DTEST_PROGRAM_PAGER'],
3046 include_directories : dir_include)
3050 'test_linux_version',
3051 'lib/linux_version.c',
3052 c_args : ['-DTEST_PROGRAM_LINUXVERSION'],
3053 include_directories : dir_include)
3059 c_args : ['-DTEST_PROGRAM_FILEUTILS'],
3060 include_directories : dir_include)
3064 'test_canonicalize',
3065 'lib/canonicalize.c',
3066 c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
3067 include_directories : dir_include)
3074 c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
3075 include_directories : dir_include)
3081 c_args : ['-DTEST_PROGRAM'],
3082 include_directories : dir_include,
3083 link_with : lib_common)
3089 c_args : ['-DTEST_PROGRAM'],
3090 include_directories : dir_include,
3091 link_with : [lib_common, logindefs_c])
3095 ############################################################
3099 'libuuid/src/test_uuid.c',
3100 include_directories : [dir_include, dir_libuuid],
3101 link_with : lib_uuid,
3102 dependencies : socket_libs)
3103 if not is_disabler(exe)
3107 ############################################################
3109 libfdisk_tests_cflags = ['-DTEST_PROGRAM',
3111 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
3115 'libfdisk/src/ask.c',
3116 c_args : libfdisk_tests_cflags,
3117 include_directories : lib_fdisk_includes,
3118 link_with : libfdisk_tests_ldadd)
3119 if not is_disabler(exe)
3125 'libfdisk/src/gpt.c',
3126 c_args : libfdisk_tests_cflags,
3127 include_directories : lib_fdisk_includes,
3128 link_with : libfdisk_tests_ldadd)
3129 if not is_disabler(exe)
3135 'libfdisk/src/utils.c',
3136 c_args : libfdisk_tests_cflags,
3137 include_directories : lib_fdisk_includes,
3138 link_with : libfdisk_tests_ldadd)
3139 if not is_disabler(exe)
3144 'test_fdisk_script',
3145 'libfdisk/src/script.c',
3146 c_args : libfdisk_tests_cflags,
3147 include_directories : lib_fdisk_includes,
3148 link_with : libfdisk_tests_ldadd)
3149 if not is_disabler(exe)
3154 'test_fdisk_version',
3155 'libfdisk/src/version.c',
3156 c_args : libfdisk_tests_cflags,
3157 include_directories : lib_fdisk_includes,
3158 link_with : libfdisk_tests_ldadd)
3159 if not is_disabler(exe)
3165 'libfdisk/src/item.c',
3166 c_args : libfdisk_tests_cflags,
3167 include_directories : lib_fdisk_includes,
3168 link_with : libfdisk_tests_ldadd)
3169 if not is_disabler(exe)
3173 sample_fdisk_cflags = ['-Wno-unused']
3174 sample_fdisk_ldadd = [lib_common, lib_fdisk]
3177 'sample-fdisk-mkpart',
3178 'libfdisk/samples/mkpart.c',
3179 c_args : sample_fdisk_cflags,
3180 include_directories : lib_fdisk_includes,
3181 link_with : sample_fdisk_ldadd)
3182 if not is_disabler(exe)
3187 'sample-fdisk-mkpart-fullspec',
3188 'libfdisk/samples/mkpart-fullspec.c',
3189 c_args : sample_fdisk_cflags,
3190 include_directories : lib_fdisk_includes,
3191 link_with : sample_fdisk_ldadd)
3192 if not is_disabler(exe)
3196 ############################################################
3200 'tests/helpers/test_mbsencode.c',
3201 include_directories : includes,
3202 link_with : lib_common)
3207 'tests/helpers/test_byteswap.c',
3208 include_directories : includes)
3213 'tests/helpers/test_md5.c',
3215 include_directories : includes)
3220 'tests/helpers/test_sha1.c',
3222 include_directories : includes)
3227 'tests/helpers/test_pathnames.c',
3228 include_directories : includes)
3233 'tests/helpers/test_strerror.c',
3234 include_directories : includes)
3239 'tests/helpers/test_sysinfo.c',
3240 include_directories : includes)
3245 'tests/helpers/test_sigreceive.c',
3246 include_directories : includes,
3247 link_with : lib_common)
3252 'tests/helpers/test_tiocsti.c',
3253 include_directories : includes)
3257 'test_uuid_namespace',
3258 'tests/helpers/test_uuid_namespace.c',
3262 include_directories : includes)
3268 'tests/helpers/test_mkfds.c',
3269 include_directories : includes)
3274 'tests/helpers/test_enosys.c',
3275 include_directories : includes)
3278 ############################################################
3282 'sample-scols-tree',
3283 'libsmartcols/samples/tree.c',
3284 include_directories : includes,
3285 link_with : [lib_smartcols, lib_common])
3286 if not is_disabler(exe)
3291 'sample-scols-title',
3292 'libsmartcols/samples/title.c',
3293 include_directories : includes,
3294 link_with : [lib_smartcols, lib_common])
3295 if not is_disabler(exe)
3300 'sample-scols-wrap',
3301 'libsmartcols/samples/wrap.c',
3302 include_directories : includes,
3303 link_with : [lib_smartcols, lib_common])
3304 if not is_disabler(exe)
3309 'sample-scols-continuous',
3310 'libsmartcols/samples/continuous.c',
3311 include_directories : includes,
3312 link_with : [lib_smartcols, lib_common])
3313 if not is_disabler(exe)
3318 'sample-scols-maxout',
3319 'libsmartcols/samples/maxout.c',
3320 include_directories : includes,
3321 link_with : [lib_smartcols, lib_common])
3322 if not is_disabler(exe)
3327 'sample-scols-fromfile',
3328 'libsmartcols/samples/fromfile.c',
3329 include_directories : includes,
3330 link_with : [lib_smartcols, lib_common])
3331 if not is_disabler(exe)
3336 'sample-scols-grouping-simple',
3337 'libsmartcols/samples/grouping-simple.c',
3338 include_directories : includes,
3339 link_with : [lib_smartcols, lib_common])
3340 if not is_disabler(exe)
3345 'sample-scols-grouping-overlay',
3346 'libsmartcols/samples/grouping-overlay.c',
3347 include_directories : includes,
3348 link_with : [lib_smartcols, lib_common])
3349 if not is_disabler(exe)
3353 ############################################################
3355 # Let the test runner know whether we're running under asan and export
3356 # some paths. We use a file on disk so that it is possible to run the
3357 # test scripts from commandline without setting any variables.
3358 configure_file(output : 'meson.conf',
3363 '''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
3366 run_sh = find_program('tests/run.sh')
3370 '--srcdir=' + meson.current_source_dir(),
3371 '--builddir=' + meson.current_build_dir(),
3377 manadocs += ['lib/terminal-colors.d.5.adoc']
3378 manadocs += ['libblkid/libblkid.3.adoc']
3382 'libuuid/man/uuid.3.adoc',
3383 'libuuid/man/uuid_clear.3.adoc',
3384 'libuuid/man/uuid_compare.3.adoc',
3385 'libuuid/man/uuid_copy.3.adoc',
3386 'libuuid/man/uuid_generate.3.adoc',
3387 'libuuid/man/uuid_is_null.3.adoc',
3388 'libuuid/man/uuid_parse.3.adoc',
3389 'libuuid/man/uuid_time.3.adoc',
3390 'libuuid/man/uuid_unparse.3.adoc']
3392 'uuid_generate_random.3': 'uuid_generate.3',
3393 'uuid_generate_time.3': 'uuid_generate.3',
3394 'uuid_generate_time_safe.3': 'uuid_generate.3',
3398 asciidoctor = find_program('asciidoctor', required : false)
3399 if asciidoctor.found()
3400 foreach adoc : manadocs
3401 name = adoc.split('/')[-1]
3402 page = name.split('.adoc')[0]
3403 section = page.split('.')[-1]
3404 mandirn = join_paths(mandir, 'man' + section)
3409 command : [ asciidoctor,
3411 '-a', 'VERSION=' + meson.project_version(),
3412 '-a', 'release-version=' + meson.project_version(),
3413 '-a', 'ADJTIME_PATH=/etc/adjtime',
3414 '-a', 'package-docdir=' + docdir,
3415 '--base-dir=' + meson.current_source_dir(),
3416 '--destination-dir=' + meson.current_build_dir(),
3417 '--load-path', '@SOURCE_ROOT@/tools',
3418 '--require', 'asciidoctor-includetracker',
3422 depfile : page + '.deps',
3424 install_dir : mandirn)
3427 foreach link_name, target : manlinks
3428 link_section = link_name.split('.')[-1]
3429 target_section = target.split('.')[-1]
3430 meson.add_install_script(meson_make_manpage_stub,
3431 join_paths('man' + target_section, target),
3432 join_paths(mandir, 'man' + link_section, link_name))
3436 if bash_completion.found()
3437 foreach completion : bashcompletions
3439 join_paths('bash-completion', completion),
3440 install_dir : bash_completion.get_variable(pkgconfig : 'completionsdir')
3443 foreach link_name, target : bashcompletionslinks
3444 meson.add_install_script(meson_make_symlink,
3446 join_paths(bash_completion.get_variable(pkgconfig : 'completionsdir'), link_name))