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
have = cc.compiles(code, name : 'using __progname')
conf.set('HAVE___PROGNAME', have ? 1 : 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_pty = conf.get('HAVE_PTY_H').to_string() == '1' \
+ and conf.get('HAVE_SYS_SIGNALFD_H').to_string() == '1'
+conf.set('HAVE_PTY', have_pty ? 1 : false)
have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
bashcompletions += ['utmpdump']
endif
-opt = not get_option('build-su').disabled()
+opt = get_option('build-su').require(have_pty).allowed()
exe = executable(
'su',
'login-utils/su.c',
join_paths(mandir, 'man8/vigr.8'))
endif
-opt = not get_option('build-runuser').disabled()
+opt = get_option('build-runuser').require(have_pty).allowed()
exe = executable(
'runuser',
'login-utils/runuser.c',
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,
bashcompletions += ['lscpu']
endif
+opt = get_option('build-chcpu').require(have_cpu_set_t).allowed()
exe = executable(
'chcpu',
chcpu_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : sbindir,
- install : true)
-exes += exe
-manadocs += ['sys-utils/chcpu.8.adoc']
-bashcompletions += ['chcpu']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['sys-utils/chcpu.8.adoc']
+ bashcompletions += ['chcpu']
+endif
exe = executable(
'wdctl',
bashcompletions += ['fdformat']
endif
+opt = get_option('build-blockdev').require(LINUX).allowed()
exe = executable(
'blockdev',
blockdev_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : sbindir,
- install : true)
-manadocs += ['disk-utils/blockdev.8.adoc']
-bashcompletions += ['blockdev']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['disk-utils/blockdev.8.adoc']
+ bashcompletions += ['blockdev']
+endif
opt = not get_option('build-fdisks').disabled()
if opt and not have_dirfd and not have_ddfd
############################################################
+opt = get_option('build-script').require(have_pty).allowed()
exe = executable(
'script',
script_sources,
realtime_libs,
math_libs],
install_dir : usrbin_exec_dir,
- install : true)
-exes += exe
-manadocs += ['term-utils/script.1.adoc']
-bashcompletions += ['script']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['term-utils/script.1.adoc']
+ bashcompletions += ['script']
+endif
exe = executable(
'test_script',
lib_utempter,
realtime_libs,
math_libs],
- build_by_default : program_tests)
-exes += exe
+ build_by_default : opt and program_tests)
+if opt and not is_disabler(exe)
+ exes += exe
+endif
+opt = get_option('build-scriptlive').require(have_pty).allowed()
exe = executable(
'scriptlive',
scriptlive_sources,
realtime_libs,
math_libs],
install_dir : usrbin_exec_dir,
- install : true)
-exes += exe
-manadocs += ['term-utils/scriptlive.1.adoc']
-bashcompletions += ['scriptlive']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['term-utils/scriptlive.1.adoc']
+ bashcompletions += ['scriptlive']
+endif
exe = executable(
'scriptreplay',
bashcompletions += ['hardlink']
endif
-opt = not get_option('build-pipesz').disabled()
+opt = get_option('build-pipesz').allowed()
exe = executable(
'pipesz',
pipesz_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : usrbin_exec_dir,
- install : true)
+ install : opt,
+ build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/pipesz.1.adoc']
exes += exe
endif
+have_posix_fadvise = conf.get('HAVE_POSIX_FADVISE').to_string() == '1'
+
+opt = get_option('build-fadvise').require(have_posix_fadvise).allowed()
exe = executable(
'fadvise',
fadvise_sources,
include_directories : includes,
link_with : [lib_common],
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/fadvise.1.adoc']
bashcompletions += ['fadvise']
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
-if conf.get('HAVE_PTY').to_string() == '1'
+if have_pty
exe = executable(
'test_pty',
pty_session_c,