diff options
Diffstat (limited to '')
-rw-r--r-- | meson.build | 457 |
1 files changed, 346 insertions, 111 deletions
diff --git a/meson.build b/meson.build index baca755..bc33570 100644 --- a/meson.build +++ b/meson.build @@ -1,13 +1,21 @@ project('util-linux', 'c', version : run_command('tools/git-version-gen', check: true).stdout(), - meson_version: '>=0.57.0', - license : 'GPLv2+') - + meson_version: '>=0.60.0', + license : 'GPLv2+', + default_options : [ + 'c_std=c99', + 'cpp_std=c++11', + ]) + +fs = import('fs') pkgconfig = import('pkgconfig') +# soname versions; This never change because we use symbols versioing. There is also +# API version (LIB*_VERSION macros) and it follow package version. libblkid_version = '1.1.0' -libblkid_date = '01-Jun-2021' +libblkid_date = '27-Mar-2024' libuuid_version = '1.3.0' +liblastlog2_version = '2.0.0' libmount_version = '1.1.0' libsmartcols_version = '1.1.0' libfdisk_version = '1.1.0' @@ -22,6 +30,7 @@ sysconfstaticdir = join_paths(prefixdir, 'lib') docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux') mandir = join_paths(prefixdir, get_option('mandir')) runstatedir = '/run' +localstatedir = '/var' execprefixdir = prefixdir sysconfdir = join_paths(prefixdir, get_option('sysconfdir')) usrbin_exec_dir = join_paths(execprefixdir, bindir) @@ -40,29 +49,29 @@ conf.set_quoted('PACKAGE_VERSION', meson.project_version()) package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version()) conf.set_quoted('PACKAGE_STRING', package_string) -codes = [''' {print $1} ''', - ''' {sub("-.*","",$2); print $2} ''', - ''' {sub("-.*","",$3); print $3 ~ /^[0-9]+$/ ? $3 : 0} '''] pc_version = [] -foreach code : codes - res = run_command('bash', '-c', - '''echo '@0@' | awk -F. '@1@' '''.format( - meson.project_version(), code), check: true) - pc_version += res.stdout().strip() -endforeach +pc_version = meson.project_version().split('-')[0].split('.') + +if pc_version.length() < 3 + pc_version += '0' +endif + pc_version = '.'.join(pc_version) -conf.set_quoted('LIBBLKID_VERSION', libblkid_version) +conf.set_quoted('LIBBLKID_VERSION', pc_version) conf.set_quoted('LIBBLKID_DATE', libblkid_date) conf.set('bindir', bindir) conf.set('sbindir', sbindir) conf.set('runstatedir', runstatedir) +conf.set('localstatedir', localstatedir) conf.set('sysconfdir', sysconfdir) +conf.set('usrbin_execdir', usrbin_exec_dir) conf.set('usrsbin_execdir', usrsbin_exec_dir) conf.set('docdir', docdir) conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir) conf.set_quoted('_PATH_RUNSTATEDIR', runstatedir) +conf.set_quoted('_PATH_LOCALSTATEDIR', localstatedir) conf.set_quoted('CONFIG_ADJTIME_PATH', '/etc/adjtime') conf.set_quoted('ADJTIME_PATH', '/etc/adjtime') # yes, both are used :( @@ -77,6 +86,10 @@ build_libuuid = not get_option('build-libuuid').disabled() conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false) summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components') +build_liblastlog2 = not get_option('build-liblastlog2').disabled() +conf.set('HAVE_LIBLASTLOG2', build_liblastlog2 ? 1 : false) +summary('liblastlog2', build_liblastlog2 ? 'enabled' : 'disabled', section : 'components') + have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false) conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false) @@ -174,6 +187,7 @@ headers = ''' linux/fiemap.h linux/gsmmux.h linux/if_alg.h + linux/landlock.h linux/kcmp.h linux/net_namespace.h linux/nsfs.h @@ -189,6 +203,7 @@ headers = ''' security/openpam.h security/pam_appl.h security/pam_misc.h + security/pam_modules.h sys/disk.h sys/disklabel.h sys/endian.h @@ -321,6 +336,11 @@ lib_systemd = dependency( conf.set('HAVE_LIBSYSTEMD', lib_systemd.found() ? 1 : false) conf.set('USE_SYSTEMD', lib_systemd.found() ? 1 : false) +have = cc.has_function( + 'sd_session_get_username', + dependencies : lib_systemd) +conf.set('HAVE_DECL_SD_SESSION_GET_USERNAME', have ? 1 : false) + lib_udev = dependency( 'libudev', required : get_option('systemd')) @@ -350,7 +370,8 @@ lib_cryptsetup = dependency( required : get_option('cryptsetup')) conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false) -if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled() +cryptsetup_dlopen = not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled() +if cryptsetup_dlopen if meson.version().version_compare('>= 0.62.0') lib_dl = dependency('dl') else @@ -374,6 +395,9 @@ conf.set('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY', have ? 1 : false) lib_cap_ng = dependency( 'libcap-ng', required : get_option('build-setpriv')) +if not lib_cap_ng.found() + lib_cap_ng = disabler() +endif lib_selinux = dependency( 'libselinux', @@ -398,6 +422,8 @@ conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false) conf.set('HAVE_SMACK', not get_option('smack').disabled()) +lib_sqlite3 = dependency('sqlite3', required : get_option('build-liblastlog2')) + foreach header : headers have = cc.has_header(header) conf.set('HAVE_' + header.underscorify().to_upper(), have ? 1 : false) @@ -437,7 +463,9 @@ conf.set10('HAVE_STRSIGNAL_DECL', have) have = cc.sizeof('union semun', prefix : '#include <sys/sem.h>') > 0 conf.set('HAVE_UNION_SEMUN', have ? 1 : false) -have = cc.has_type('loff_t', prefix : '#include <sys/types.h>') +have = cc.has_type('loff_t', + args : '-D_GNU_SOURCE', + prefix : '#include <sys/types.h>') conf.set('HAVE_LOFF_T', have ? 1 : false) have = cc.compiles(''' @@ -499,6 +527,7 @@ have = cc.compiles(''' conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false) funcs = ''' + cachestat clearenv close_range __fpurge @@ -528,6 +557,9 @@ funcs = ''' getsgnam inotify_init jrand48 + landlock_create_ruleset + landlock_add_rule + landlock_restrict_self lchown lgetxattr llistxattr @@ -546,6 +578,8 @@ funcs = ''' posix_fadvise prctl qsort_r + reallocarray + renameat2 rpmatch scandirat setprogname @@ -615,6 +649,7 @@ have_ddfd = cc.has_member('DIR', 'dd_fd', conf.set('HAVE_DECL_DDFD', have_ddfd ? 1 : false) have = cc.has_member('struct tm', 'tm_gmtoff', + args : '-D_GNU_SOURCE', prefix : ''' #include <time.h> #include <unistd.h> @@ -631,6 +666,7 @@ have = cc.has_member('struct termios', 'c_line', conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false) have = cc.has_member('struct stat', 'st_mtim.tv_nsec', + args : '-D_GNU_SOURCE', prefix : '#include <sys/stat.h>') conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false) @@ -640,6 +676,7 @@ conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false) # replacement for AC_STRUCT_TIMEZONE have = cc.has_member('struct tm', 'tm_zone', + args : '-D_GNU_SOURCE', prefix : '#include <time.h>') conf.set('HAVE_STRUCT_TM_TM_ZONE', have ? 1 : false) @@ -664,6 +701,19 @@ int main(void) { have = cc.compiles(code, name : 'using tzname[]') conf.set('HAVE_TZNAME', have ? 1 : false) +have = cc.sizeof('time_t', prefix : '#include <time.h>') +if have < 8 + add_global_arguments('-D_TIME_BITS=64', language : 'c') + have = cc.sizeof('time_t', args : '-D_TIME_BITS=64', prefix : '#include <time.h>') + if have < 8 + if get_option('allow-32bit-time') + warning('Could not make time_t 64bits wide') + else + error('Could not make time_t 64bits wide') + endif + endif +endif + socket_libs = [] if not cc.has_function('socket') socket_libs += cc.find_library('socket', required : true) @@ -727,7 +777,8 @@ int main(void) { have = cc.compiles(code, name : 'using __progname') conf.set('HAVE___PROGNAME', have ? 1 : false) -have = conf.get('HAVE_PTY_H') != false and conf.get('HAVE_SYS_SIGNALFD_H') != false +have = conf.get('HAVE_PTY_H').to_string() == '1' \ + and conf.get('HAVE_SYS_SIGNALFD_H').to_string() == '1' conf.set('HAVE_PTY', have ? 1 : false) have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS') @@ -747,6 +798,7 @@ have_sock_nonblock = cc.has_header_symbol( required : build_plymouth_support.enabled()) have_so_passcred = cc.has_header_symbol( 'sys/socket.h', 'SO_PASSCRED', + args : ['-D_GNU_SOURCE'], prefix : '#include <sys/types.h>', required : build_plymouth_support.enabled()) @@ -799,6 +851,8 @@ conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false) conf.set('PG_BELL', get_option('pg-bell') ? 1 : false) conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false) +is_glibc = cc.has_header_symbol('limits.h', '__GLIBC__') + ############################################################ @@ -817,6 +871,8 @@ endif sysvinit = get_option('sysvinit').enabled() sysvinitrcdir = sysconfdir + '/init.d' +program_tests = get_option('program-tests') + chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found() conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false) @@ -826,15 +882,15 @@ conf.set('ONLY_LISTED_SHELLS', have ? 1 : false) have = get_option('use-tty-group') conf.set('USE_TTY_GROUP', have ? 1 : false) +bison = find_program('bison') +flex = find_program('flex') + build_hwclock = not get_option('build-hwclock').disabled() -bison = find_program('bison', required: build_hwclock) bison_gen = generator( bison, output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) - - meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh' meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh' @@ -870,6 +926,8 @@ compiler_flags = [ '-Wunused-parameter', '-Wunused-result', '-Wunused-variable', + '-Wvla', + '-Walloca', ] foreach compiler_flag : compiler_flags if cc.has_argument(compiler_flag) @@ -889,7 +947,9 @@ subdir('libblkid') subdir('libmount') subdir('libsmartcols') subdir('libuuid') +subdir('liblastlog2') subdir('libfdisk') +subdir('pam_lastlog2') subdir('login-utils') subdir('sys-utils') subdir('disk-utils') @@ -904,6 +964,7 @@ includes = [dir_include, dir_libmount, dir_libfdisk, dir_libuuid, + dir_liblastlog2, dir_sys_utils] exes = [] @@ -943,7 +1004,8 @@ exe = executable( 'test_islocal', test_islocal_sources, include_directories : includes, - c_args : '-DTEST_PROGRAM') + c_args : '-DTEST_PROGRAM', + build_by_default : program_tests) exes += exe exe = executable( @@ -951,7 +1013,8 @@ exe = executable( test_consoles_sources, c_args : ['-DTEST_PROGRAM'], include_directories : includes, - link_with : lib_common) + link_with : lib_common, + build_by_default : program_tests) exes += exe opt = not get_option('build-last').disabled() @@ -1110,16 +1173,18 @@ endif ############################################################ -exe = executable( - 'col', - col_sources, - include_directories : includes, - link_with : lib_common, - install_dir : usrbin_exec_dir, - install : true) -exes += exe -manadocs += ['text-utils/col.1.adoc'] -bashcompletions += ['col'] +if is_glibc + exe = executable( + 'col', + col_sources, + include_directories : includes, + link_with : lib_common, + install_dir : usrbin_exec_dir, + install : true) + exes += exe + manadocs += ['text-utils/col.1.adoc'] + bashcompletions += ['col'] +endif exe = executable( 'colcrt', @@ -1232,7 +1297,7 @@ exe2 = executable( dependencies : [lib_tinfo, curses_libs, lib_magic], - build_by_default : opt) + build_by_default : opt and program_tests) exes += exe if opt and not is_disabler(exe) exes += [exe, exe2] @@ -1363,6 +1428,20 @@ if not is_disabler(exe) endif exe = executable( + 'setpgid', + setpgid_sources, + include_directories: includes, + link_with : [lib_common, + lib_smartcols], + install_dir : usrbin_exec_dir, + install : true) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['sys-utils/setpgid.1.adoc'] + bashcompletions += ['setpgid'] +endif + +exe = executable( 'setsid', setsid_sources, include_directories : includes, @@ -1438,7 +1517,8 @@ exe = executable( include_directories : dir_include, c_args : '-DTEST_DMESG', link_with : [lib_common, - lib_tcolors]) + lib_tcolors], + build_by_default : program_tests) if not is_disabler(exe) exes += exe endif @@ -1476,26 +1556,30 @@ exes += exe manadocs += ['sys-utils/blkdiscard.8.adoc'] bashcompletions += ['blkdiscard'] -exe = executable( - 'blkzone', - blkzone_sources, - include_directories : includes, - link_with : [lib_common], - install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/blkzone.8.adoc'] -bashcompletions += ['blkzone'] +if cc.has_header('linux/blkzoned.h') + exe = executable( + 'blkzone', + blkzone_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : sbindir, + install : true) + exes += exe + manadocs += ['sys-utils/blkzone.8.adoc'] + bashcompletions += ['blkzone'] +endif -exe = executable( - 'blkpr', - blkpr_sources, - include_directories : includes, - link_with : [lib_common], - install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/blkpr.8.adoc'] +if cc.has_header('linux/pr.h') + exe = executable( + 'blkpr', + blkpr_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : sbindir, + install : true) + exes += exe + manadocs += ['sys-utils/blkpr.8.adoc'] +endif exe = executable( 'ldattach', @@ -2030,7 +2114,7 @@ exe = executable( dependencies: [lib_selinux], install_dir : sbindir, install : true) -if opt and not is_disabler(exe) +if not is_disabler(exe) exes += exe manadocs += ['disk-utils/mkswap.8.adoc'] bashcompletions += ['mkswap'] @@ -2045,7 +2129,7 @@ exe = executable( lib_uuid], install_dir : sbindir, install : true) -if opt and not is_disabler(exe) +if not is_disabler(exe) exes += exe manadocs += ['disk-utils/swaplabel.8.adoc'] bashcompletions += ['swaplabel'] @@ -2084,7 +2168,7 @@ exe2 = executable( include_directories : includes, c_args : '-DTEST_SCRIPT', link_with : [lib_common], - build_by_default : opt) + build_by_default : opt and program_tests) exe3 = executable( 'fsck.minix', fsck_minix_sources, @@ -2153,6 +2237,7 @@ exe = executable( if opt and not is_disabler(exe) exes += exe manadocs += ['disk-utils/fdformat.8.adoc'] + bashcompletions += ['fdformat'] endif exe = executable( @@ -2329,7 +2414,8 @@ exe = executable( dependencies : [lib_util, lib_utempter, realtime_libs, - math_libs]) + math_libs], + build_by_default : program_tests) exes += exe exe = executable( @@ -2364,7 +2450,7 @@ exe = executable( agetty_sources, include_directories : includes, link_with : [lib_common, logindefs_c], - dependencies : BSD ? lib_util : [], + dependencies : [BSD ? lib_util : [], lib_systemd], install_dir : sbindir, install : opt, build_by_default : opt) @@ -2410,6 +2496,7 @@ exe = executable( wall_sources, include_directories : includes, link_with : [lib_common], + dependencies : [lib_systemd], install_dir : usrbin_exec_dir, install_mode : [ 'rwxr-sr-x', 'root', 'tty' ], install : opt, @@ -2429,6 +2516,7 @@ exe = executable( write_sources, include_directories : includes, link_with : [lib_common], + dependencies : [lib_systemd], install_dir : usrbin_exec_dir, install_mode : [ 'rwxr-sr-x', 'root', 'tty' ], install : opt, @@ -2509,7 +2597,8 @@ exe = executable( include_directories : includes, c_args : '-DTEST_LOGGER', link_with : [lib_common], - dependencies : [lib_systemd]) + dependencies : [lib_systemd], + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -2535,6 +2624,28 @@ exes += exe manadocs += ['misc-utils/mcookie.1.adoc'] bashcompletions += ['mcookie'] +if build_liblastlog2 + exe = executable( + 'lastlog2', + lastlog2_sources, + include_directories : includes, + link_with : [lib_common, lib_lastlog2], + install_dir : usrbin_exec_dir, + install : true) + exes += exe + manadocs += ['misc-utils/lastlog2.8.adoc'] + bashcompletions += ['lastlog2'] + manadocs += ['liblastlog2/man/lastlog2.3.adoc', + 'liblastlog2/man/ll2_write_entry.3.adoc', + 'liblastlog2/man/ll2_read_entry.3.adoc', + 'liblastlog2/man/ll2_import_lastlog.3.adoc', + 'liblastlog2/man/ll2_read_all.3.adoc', + 'liblastlog2/man/ll2_remove_entry.3.adoc', + 'liblastlog2/man/ll2_rename_user.3.adoc', + 'liblastlog2/man/ll2_update_login_time.3.adoc' + ] +endif + exe = executable( 'namei', namei_sources, @@ -2579,6 +2690,7 @@ exe = executable( link_with : [lib_common, lib_blkid, lib_mount, + lib_tcolors, lib_smartcols], dependencies : lib_udev, install : true) @@ -2588,12 +2700,16 @@ if not is_disabler(exe) bashcompletions += ['lsblk'] endif +mq_libs = [] +mq_libs += cc.find_library('rt', required : true) + exe = executable( 'lsfd', lsfd_sources, include_directories : includes, link_with : [lib_common, lib_smartcols], + dependencies : mq_libs, install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -2605,7 +2721,8 @@ exe = executable( 'uuidgen', uuidgen_sources, include_directories : includes, - link_with : [lib_uuid], + link_with : [lib_common, + lib_uuid], install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -2648,7 +2765,7 @@ exe2 = executable( link_with : [lib_common, lib_uuid], dependencies : thread_libs, - build_by_default : opt) + build_by_default : opt and program_tests) if not is_disabler(exe) exes += [exe, exe2] manadocs += ['misc-utils/uuidd.8.adoc'] @@ -2725,7 +2842,8 @@ exe = executable( 'test_blkid_fuzz_sample', 'libblkid/src/fuzz.c', include_directories: includes, - link_with: lib_blkid) + link_with: lib_blkid, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -2860,7 +2978,8 @@ exe = executable( c_args : '-DTEST_CAL', link_with : [lib_common, lib_tcolors], - dependencies : [curses_libs]) + dependencies : [curses_libs], + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -2878,7 +2997,7 @@ if not is_disabler(exe) bashcompletions += ['fadvise'] endif -if LINUX and conf.get('HAVE_PIDFD_OPEN') != false +if LINUX and conf.get('HAVE_PIDFD_OPEN').to_string() == '1' exe = executable( 'waitpid', waitpid_sources, @@ -2893,6 +3012,55 @@ if LINUX and conf.get('HAVE_PIDFD_OPEN') != false endif endif +syscalls_h = custom_target('syscalls.h', + input : 'tools/all_syscalls', + output : 'syscalls.h', + command : ['tools/all_syscalls', cc.cmd_array()] +) + +if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE') + exe = executable( + 'enosys', + 'misc-utils/enosys.c', syscalls_h, + include_directories : includes, + link_with : [lib_common], + install_dir : usrbin_exec_dir, + install : true) + if not is_disabler(exe) + exes += exe + manadocs += ['misc-utils/enosys.1.adoc'] + bashcompletions += ['enosys'] + endif +endif + +exe = executable( + 'lsclocks', + lsclocks_sources, + include_directories : includes, + link_with : [lib_common, lib_smartcols], + install_dir : usrbin_exec_dir, + install : true) +if not is_disabler(exe) + exes += exe + manadocs += ['misc-utils/lsclocks.1.adoc'] + bashcompletions += ['lsclocks'] +endif + +if conf.get('HAVE_RENAMEAT2').to_string() == '1' +exe = executable( + 'exch', + exch_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : usrbin_exec_dir, + install : true) +if not is_disabler(exe) + exes += exe + manadocs += ['misc-utils/exch.1.adoc'] + bashcompletions += ['exch'] +endif +endif + ############################################################ opt = not get_option('build-schedutils').disabled() @@ -2950,7 +3118,8 @@ exe = executable( 'lib/ttyutils.c', c_args : ['-DTEST_PROGRAM_TTYUTILS'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( @@ -2958,7 +3127,8 @@ exe = executable( 'lib/blkdev.c', c_args : ['-DTEST_PROGRAM_BLKDEV'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( @@ -2966,21 +3136,24 @@ exe = executable( 'lib/ismounted.c', c_args : ['-DTEST_PROGRAM_ISMOUNTED'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( 'test_mangle', 'lib/mangle.c', c_args : ['-DTEST_PROGRAM_MANGLE'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( 'test_strutils', 'lib/strutils.c', c_args : ['-DTEST_PROGRAM_STRUTILS'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( @@ -2989,23 +3162,27 @@ exe = executable( 'lib/color-names.c', c_args : ['-DTEST_PROGRAM_COLORS'], include_directories : dir_include, - link_with : [lib_common, lib_tcolors]) + link_with : [lib_common, lib_tcolors], + build_by_default: program_tests) exes += exe exe = executable( 'test_randutils', 'lib/randutils.c', c_args : ['-DTEST_PROGRAM_RANDUTILS'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe -if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false +if conf.get('HAVE_OPENAT').to_string() == '1' \ + and conf.get('HAVE_DIRFD').to_string() == '1' exe = executable( 'test_procfs', 'lib/procfs.c', c_args : ['-DTEST_PROGRAM_PROCFS'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( @@ -3015,11 +3192,12 @@ if conf.get('HAVE_OPENAT') != false and conf.get('HAVE_DIRFD') != false have_cpu_set_t ? 'lib/cpuset.c' : [], c_args : ['-DTEST_PROGRAM_PATH'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe endif -if conf.get('HAVE_PTY') != false +if conf.get('HAVE_PTY').to_string() == '1' exe = executable( 'test_pty', pty_session_c, @@ -3029,7 +3207,8 @@ if conf.get('HAVE_PTY') != false link_with : [lib_common], dependencies : [lib_m, realtime_libs, - lib_util]) + lib_util], + build_by_default: program_tests) exes += exe endif @@ -3038,7 +3217,8 @@ if LINUX 'test_cpuset', 'lib/cpuset.c', c_args : ['-DTEST_PROGRAM_CPUSET'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe endif @@ -3051,35 +3231,40 @@ exe = executable( 'lib/fileutils.c', have_cpu_set_t ? 'lib/cpuset.c' : [], c_args : ['-DTEST_PROGRAM_SYSFS'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( 'test_pager', 'lib/pager.c', c_args : ['-DTEST_PROGRAM_PAGER'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( 'test_linux_version', 'lib/linux_version.c', c_args : ['-DTEST_PROGRAM_LINUXVERSION'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( 'test_fileutils', 'lib/fileutils.c', c_args : ['-DTEST_PROGRAM_FILEUTILS'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( 'test_canonicalize', 'lib/canonicalize.c', c_args : ['-DTEST_PROGRAM_CANONICALIZE'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( @@ -3087,7 +3272,8 @@ exe = executable( 'lib/timeutils.c', 'lib/strutils.c', c_args : ['-DTEST_PROGRAM_TIMEUTILS'], - include_directories : dir_include) + include_directories : dir_include, + build_by_default: program_tests) exes += exe exe = executable( @@ -3095,7 +3281,8 @@ exe = executable( 'lib/pwdutils.c', c_args : ['-DTEST_PROGRAM'], include_directories : dir_include, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( @@ -3103,7 +3290,8 @@ exe = executable( 'lib/logindefs.c', c_args : ['-DTEST_PROGRAM'], include_directories : dir_include, - link_with : [lib_common, logindefs_c]) + link_with : [lib_common, logindefs_c], + build_by_default: program_tests) exes += exe @@ -3114,15 +3302,15 @@ exe = executable( 'libuuid/src/test_uuid.c', include_directories : [dir_include, dir_libuuid], link_with : lib_uuid, - dependencies : socket_libs) + dependencies : socket_libs, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif ############################################################ -libfdisk_tests_cflags = ['-DTEST_PROGRAM', - '-Wno-unused'] +libfdisk_tests_cflags = ['-DTEST_PROGRAM'] libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid] exe = executable( @@ -3130,7 +3318,8 @@ exe = executable( 'libfdisk/src/ask.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3140,7 +3329,8 @@ exe = executable( 'libfdisk/src/gpt.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3150,7 +3340,8 @@ exe = executable( 'libfdisk/src/utils.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3160,7 +3351,8 @@ exe = executable( 'libfdisk/src/script.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3170,7 +3362,8 @@ exe = executable( 'libfdisk/src/version.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3180,18 +3373,17 @@ exe = executable( 'libfdisk/src/item.c', c_args : libfdisk_tests_cflags, include_directories : lib_fdisk_includes, - link_with : libfdisk_tests_ldadd) + link_with : libfdisk_tests_ldadd, + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif -sample_fdisk_cflags = ['-Wno-unused'] sample_fdisk_ldadd = [lib_common, lib_fdisk] exe = executable( 'sample-fdisk-mkpart', 'libfdisk/samples/mkpart.c', - c_args : sample_fdisk_cflags, include_directories : lib_fdisk_includes, link_with : sample_fdisk_ldadd) if not is_disabler(exe) @@ -3201,7 +3393,6 @@ endif exe = executable( 'sample-fdisk-mkpart-fullspec', 'libfdisk/samples/mkpart-fullspec.c', - c_args : sample_fdisk_cflags, include_directories : lib_fdisk_includes, link_with : sample_fdisk_ldadd) if not is_disabler(exe) @@ -3211,61 +3402,80 @@ endif ############################################################ exe = executable( + 'test_cap', + 'tests/helpers/test_cap.c', + include_directories : includes, + dependencies : [lib_cap_ng], + build_by_default: program_tests) +if not is_disabler(exe) + exes += exe +endif + +exe = executable( 'test_mbsencode', 'tests/helpers/test_mbsencode.c', include_directories : includes, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( 'test_byteswap', 'tests/helpers/test_byteswap.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_md5', 'tests/helpers/test_md5.c', md5_c, - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_sha1', 'tests/helpers/test_sha1.c', sha1_c, - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_pathnames', 'tests/helpers/test_pathnames.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_strerror', 'tests/helpers/test_strerror.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_sysinfo', 'tests/helpers/test_sysinfo.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( 'test_sigreceive', 'tests/helpers/test_sigreceive.c', include_directories : includes, - link_with : lib_common) + link_with : lib_common, + build_by_default: program_tests) exes += exe exe = executable( 'test_tiocsti', 'tests/helpers/test_tiocsti.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe exe = executable( @@ -3274,31 +3484,38 @@ exe = executable( predefined_c, unpack_c, unparse_c, - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe if LINUX exe = executable( 'test_mkfds', 'tests/helpers/test_mkfds.c', - include_directories : includes) + 'tests/helpers/test_mkfds.h', + 'tests/helpers/test_mkfds_ppoll.c', + include_directories : includes, + dependencies : mq_libs, + build_by_default: program_tests) exes += exe endif exe = executable( 'test_enosys', 'tests/helpers/test_enosys.c', - include_directories : includes) + include_directories : includes, + build_by_default: program_tests) exes += exe ############################################################ -if conf.get('HAVE_OPENAT') != false +if conf.get('HAVE_OPENAT').to_string() == '1' exe = executable( 'sample-scols-tree', 'libsmartcols/samples/tree.c', include_directories : includes, - link_with : [lib_smartcols, lib_common]) + link_with : [lib_smartcols, lib_common], + build_by_default: program_tests) if not is_disabler(exe) exes += exe endif @@ -3332,6 +3549,15 @@ if not is_disabler(exe) endif exe = executable( + 'sample-scols-continuous-json', + 'libsmartcols/samples/continuous-json.c', + include_directories : includes, + link_with : [lib_smartcols, lib_common]) +if not is_disabler(exe) + exes += exe +endif + +exe = executable( 'sample-scols-maxout', 'libsmartcols/samples/maxout.c', include_directories : includes, @@ -3367,6 +3593,15 @@ if not is_disabler(exe) exes += exe endif +exe = executable( + 'test_boilerplate', + 'Documentation/boilerplate.c', + include_directories : includes, + build_by_default: program_tests) +if not is_disabler(exe) + exes += exe +endif + ############################################################ # Let the test runner know whether we're running under asan and export |