Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: Some minor fixes/enhancements #270

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/mconfig.mesontemplate
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// Defines

#mesondefine USE_UTMPX
#mesondefine USE_INITGROUPS
#mesondefine SUPPORT_CGROUPS
#mesondefine DEFAULT_AUTO_RESTART
Expand Down
26 changes: 13 additions & 13 deletions doc/manpages/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ foreach man: ['dinit-service.5', 'dinit.8', 'dinitcheck.8', 'dinitctl.8', 'dinit
output: man,
command: [
'm4',
'-DVERSION='+version,
'-DMONTH='+month,
'-DYEAR='+year,
'-DSHUTDOWN_PREFIX='+shutdown_prefix,
'-DDEFAULT_AUTO_RESTART='+default_auto_restart,
'-DDEFAULT_START_TIMEOUT='+default_start_timeout,
'-DDEFAULT_STOP_TIMEOUT='+default_stop_timeout,
'-DVERSION=' + version,
'-DMONTH=' + month,
'-DYEAR=' + year,
'-DSHUTDOWN_PREFIX=' + shutdown_prefix,
'-DDEFAULT_AUTO_RESTART=' + default_auto_restart,
'-DDEFAULT_START_TIMEOUT=' + default_start_timeout,
'-DDEFAULT_STOP_TIMEOUT=' + default_stop_timeout,
'@INPUT@'
],
capture: true,
install: true,
install_dir: join_paths(get_option('mandir'), section),
install_dir: join_paths(mandir, section),
)
endforeach
if shutdown_build
if shutdown_built
foreach shutdown_man: ['shutdown.8', 'reboot.8', 'halt.8']
custom_target(
shutdown_man,
input: 'shutdown.8.m4',
output: shutdown_prefix + shutdown_man,
command: [
'm4',
'-DVERSION='+version,
'-DMONTH='+month,
'-DYEAR='+year,
'-DSHUTDOWN_PREFIX='+shutdown_prefix,
'-DVERSION=' + version,
'-DMONTH=' + month,
'-DYEAR=' + year,
'-DSHUTDOWN_PREFIX=' + shutdown_prefix,
'@INPUT@'
],
capture: true,
Expand Down
12 changes: 6 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(
'dinit',
'cpp',
version : run_command('grep', '^VERSION=', 'build/version.conf',
check : true).stdout().strip().split('=')[1],
check: true).stdout().strip().split('=')[1],
license : 'Apache-2.0',
meson_version : '>= 0.56.0',
default_options : [
Expand All @@ -14,8 +14,7 @@ project(
)

## Import variables from build/version.conf
kv = import('keyval')
version_conf = kv.load('build/version.conf')
version_conf = import('keyval').load('build/version.conf')

## General Defines
compiler = meson.get_compiler('cpp')
Expand Down Expand Up @@ -69,9 +68,10 @@ mconfig_data.set10('USE_INITGROUPS', use_initgroups)
if support_cgroups.auto() and platform == 'linux' or support_cgroups.enabled()
mconfig_data.set('SUPPORT_CGROUPS', '1')
endif
if use_utmpx.enabled()
if use_utmpx.enabled() or (use_utmpx.auto() and compiler.has_header_symbol('utmpx.h', '_PATH_UTMPX') and
compiler.has_header_symbol('utmpx.h', '_PATH_WTMPX'))
mconfig_data.set('USE_UTMPX', '1')
elif use_utmpx.disabled()
else
mconfig_data.set('USE_UTMPX', '0')
endif
configure_file(
Expand All @@ -85,7 +85,7 @@ subdir('src')
if unit_tests
subdir('src/tests/')
endif
if fuzzer
if unit_tests or fuzzer
subdir('src/tests/cptests/')
endif
if igr_tests
Expand Down
92 changes: 46 additions & 46 deletions src/igr-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,144 +33,144 @@ offlineenable_test_script = files(meson.current_source_dir() + '/offline-enable/
test(
'basic',
basic_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'environ',
environ_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'environ2',
environ2_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'ps-environ',
psenviron_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'chain-to',
chainto_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'force-stop',
forcestop_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'restart',
restart_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'check-basic',
checkbasic_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'check-cycle',
checkcycle_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'check-cycle2',
checkcycle2_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'check-lint',
checklint_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'reload1',
reload1_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'reload2',
reload2_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'no-command-error',
nocommanderror_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'add-rm-dep',
addrmdep_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'var-subst',
varsubst_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'svc-start-fail',
svcstartfail_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'dep-not-found',
depnotfound_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'pseudo-cycle',
pseudocycle_test_script,
env : igr_tests_env,
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'before-after',
beforeafter_test_script,
env : igr_tests_env,
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'before-after2',
beforeafter2_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'log-via-pipe',
logviapipe_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'catlog',
catlog_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
test(
'offline-enable',
offlineenable_test_script,
env : igr_tests_env,
suite : 'igr_tests'
env: igr_tests_env,
suite: 'igr_tests'
)
29 changes: 12 additions & 17 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ dinit_source_files = [
]

## src/'s Defines
shutdown_build = false
shutdown_built = false
misc_args = {
'include_directories': default_incdir,
'install': true,
'install_dir': sbindir
}

## src/'s defines for igr-tests/
if igr_tests
Expand All @@ -34,43 +39,33 @@ endif
executable(
'dinit',
dinit_source_files,
include_directories : default_incdir,
install : true,
install_dir : sbindir
kwargs: misc_args
)
executable(
'dinitctl',
'dinitctl.cc',
'options-processing.cc',
include_directories : default_incdir,
install : true,
install_dir : sbindir
kwargs: misc_args
)
executable(
'dinitcheck',
'dinitcheck.cc',
'options-processing.cc',
include_directories : default_incdir,
install : true,
install_dir : sbindir
kwargs: misc_args
)
executable(
'dinit-monitor',
'dinit-monitor.cc',
include_directories : default_incdir,
install : true,
install_dir : sbindir
kwargs: misc_args
)
# Shutdown/reboot/halt
if build_shutdown.auto() and platform == 'linux' or build_shutdown.enabled()
shutdown_build = true
shutdown_built = true
foreach exec: ['shutdown', 'reboot', 'halt']
executable(
shutdown_prefix + exec,
'shutdown.cc',
include_directories : default_incdir,
install : true,
install_dir : sbindir
kwargs: misc_args
)
endforeach
endif
Loading