# SPDX-License-Identifier: LGPL-2.1-or-later
-if init_script == 'systemd'
+if 'systemd' in init_script
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
systemd_service = custom_target(
],
install: true,
install_dir: systemd_system_unit_dir)
+endif
-elif init_script == 'upstart'
+if 'upstart' in init_script
install_data('upstart/lxcfs.conf', install_dir: join_paths(sysconfdir, 'init'))
-elif init_script == 'openrc'
+endif
+
+if 'openrc' in init_script
install_data('sysvinit/lxcfs', install_dir: join_paths(sysconfdir, 'rc.d/init.d'))
-elif init_script == 'sysvinit'
+endif
+
+if 'sysvinit' in init_script
install_data('sysvinit/lxcfs', install_dir: join_paths(sysconfdir, 'init.d'))
endif
want_tests = get_option('tests')
want_docs= get_option('docs')
-
# Build flags.
possible_cc_flags = [
'-Wvla',
'lxcfs shared directory: @0@'.format(lxcfssharedir),
'lxcfs build root directory: @0@'.format(project_build_root),
'lxcfs source root directory: @0@'.format(project_source_root),
- 'init system: @0@'.format(init_script),
+ 'init system(s): @0@'.format(init_script),
'tests: @0@'.format(want_tests),
'documentation: @0@'.format(want_docs),
]
option('with-init-script', type : 'string', value : 'systemd',
description : 'the runtime directory')
-option('init-script', type : 'combo',
- choices : ['systemd', 'sysvinit', 'openrc', 'upstart'], value : 'systemd',
+option('init-script', type : 'array',
+ choices : ['systemd', 'sysvinit', 'openrc', 'upstart'], value : ['systemd'],
description : 'init script')
option('docs', type : 'boolean', value: 'true',