add_project_arguments('-D_GNU_SOURCE', '-fsigned-char', language : 'c')
+if host_machine.system() == 'darwin'
+ add_project_arguments('-D_DARWIN_C_SOURCE', language : 'c')
+endif
+
cc = meson.get_compiler('c')
conf = configuration_data()
unistd.h
utmp.h
utmpx.h
- asm-generic/fcntl.h
- asm/fcntl.h
asm/io.h
linux/blkzoned.h
linux/capability.h
output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
-python_module = import('python')
-python = python_module.find_installation(
- get_option('python'),
- required : true,
- disabler : true)
+python_program = find_program('python3', 'python', native : true)
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'
bashcompletions += ['ldattach']
endif
-opt = get_option('build-rtcwake').require(cc.has_header('linux/rtc.h')).allowed()
+have_linux_rtc_h = cc.has_header('linux/rtc.h')
+
+opt = get_option('build-rtcwake').require(have_linux_rtc_h).allowed()
exe = executable(
'rtcwake',
rtcwake_sources,
cc.cmd_array(), get_option('c_args')],
)
-if cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
- exe = executable(
- 'enosys',
- 'misc-utils/enosys.c', syscalls_h, errnos_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
+have_linux_audit_h = cc.has_header('linux/audit.h')
+have_audit_arch_native = cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
+
+opt = get_option('build-enosys').require(have_linux_audit_h and have_audit_arch_native).allowed()
+exe = executable(
+ 'enosys',
+ 'misc-utils/enosys.c', syscalls_h, errnos_h,
+ include_directories : includes,
+ link_with : [lib_common],
+ install_dir : usrbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['misc-utils/enosys.1.adoc']
+ bashcompletions += ['enosys']
endif
+opt = get_option('build-lsclocks').require(have_linux_rtc_h).allowed()
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)
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/lsclocks.1.adoc']
bashcompletions += ['lsclocks']
install : opt,
build_by_default : opt)
+exe5 = executable(
+ 'coresched',
+ 'schedutils/coresched.c',
+ include_directories : includes,
+ link_with : lib_common,
+ install_dir : usrbin_exec_dir,
+ install : opt,
+ build_by_default : opt)
+
if opt and not is_disabler(exe)
- exes += [exe, exe2, exe3, exe4]
+ exes += [exe, exe2, exe3, exe4, exe5]
manadocs += ['schedutils/chrt.1.adoc',
'schedutils/ionice.1.adoc',
'schedutils/taskset.1.adoc',
- 'schedutils/uclampset.1.adoc']
- bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
+ 'schedutils/uclampset.1.adoc',
+ 'schedutils/coresched.1.adoc']
+ bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset', 'coresched']
endif
############################################################
exes += exe
endif
+exe = executable(
+ 'test_uuid_time',
+ test_uuid_time_sources,
+ include_directories : [dir_include],
+ link_with : lib_uuid,
+ c_args : '-DTEST_PROGRAM',
+ build_by_default : program_tests)
+if not is_disabler(exe)
+ exes += exe
+endif
+
############################################################
libfdisk_tests_cflags = ['-DTEST_PROGRAM']
'''asan=@0@
PYTHON=@1@
'''.format(get_option('b_sanitize')=='address' ? 'yes' : '',
- python.full_path())])
+ python_program.full_path())])
run_sh = find_program('tests/run.sh')
run_target(