build: drop build-time systemd dependency

On openSUSE, our packages are build in the Open Build Service which does
not have a proper systemd installation that you can query to get the
systemdunitdir.

The simplest solution is to re-add the ability to explicitly set the
systemdunitdir (as was previously possible with the autotools build
system in pre-5.0 LXC).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
Aleksa Sarai 2022-10-28 12:58:10 +11:00
parent 59f69162ca
commit 1d5c7e771c
No known key found for this signature in database
GPG Key ID: 2897FAD2B7E9446F
2 changed files with 10 additions and 2 deletions

View File

@ -8,8 +8,11 @@ lxc_apparmor_load = configure_file(
install_dir: lxclibexec)
if 'systemd' in init_script
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
systemd_system_unit_dir = get_option('systemd-unitdir')
if systemd_system_unit_dir == ''
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
endif
configure_file(
configuration: conf,

View File

@ -18,6 +18,11 @@ option('init-script', type : 'array',
choices : ['systemd', 'sysvinit', 'upstart'], value : ['systemd'],
description : 'init script')
# was --systemd-unidir in autotools
# If set to "", the value is taken from the running systemd instance.
option('systemd-unitdir', type : 'string', value: '',
description : 'systemd system unit directory')
# was --{disable,enable}-liburing in autotools
option('io-uring-event-loop', type: 'boolean', value: 'false',
description: 'Enable io-uring based event loop')