dnl
LIBVIRT_ARG_NUMAD
-LIBVIRT_ARG_INIT_SCRIPT
LIBVIRT_ARG_LOADER_NVRAM
LIBVIRT_ARG_LOGIN_SHELL
LIBVIRT_ARG_TLS_PRIORITY
LIBVIRT_CHECK_NUMAD
-LIBVIRT_CHECK_INIT_SCRIPT
LIBVIRT_CHECK_LOADER_NVRAM
LIBVIRT_CHECK_LOGIN_SHELL
LIBVIRT_CHECK_TLS_PRIORITY
AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([])
LIBVIRT_RESULT_NUMAD
-LIBVIRT_RESULT_INIT_SCRIPT
LIBVIRT_RESULT_LOADER_NVRAM
LIBVIRT_RESULT_LOGIN_SHELL
LIBVIRT_RESULT_TLS_PRIORITY
+++ /dev/null
-dnl Init script type
-dnl
-dnl Copyright (C) 2005-2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library. If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[
- LIBVIRT_ARG_WITH([INIT_SCRIPT],
- [Style of init script to install: systemd, openrc, check, none],
- [check])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[
- AC_MSG_CHECKING([for init script type])
-
- if test "$with_init_script" = check && test "$cross_compiling" = yes; then
- with_init_script=none
- fi
- if test "$with_init_script" = check && type systemctl >/dev/null 2>&1; then
- with_init_script=systemd
- fi
- if test "$with_init_script" = check && type openrc >/dev/null 2>&1; then
- with_init_script=openrc
- fi
- if test "$with_init_script" = check; then
- with_init_script=none
- fi
-
- AS_CASE([$with_init_script],
- [systemd],[],
- [openrc],[],
- [none],[],
- [*],[
- AC_MSG_ERROR([Unknown initscript flavour $with_init_script])
- ]
- )
-
- AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD],
- [test "$with_init_script" = "systemd"])
- AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_OPENRC],
- [test "$with_init_script" = "openrc"])
-
- AC_MSG_RESULT($with_init_script)
-])
-
-AC_DEFUN([LIBVIRT_RESULT_INIT_SCRIPT],[
- LIBVIRT_RESULT([Init script], [$with_init_script])
-])
error('virt-host-validate is not supported on Windows')
endif
+if get_option('init_script') == 'check'
+ if meson.is_cross_build()
+ init_script = 'none'
+ elif find_program('systemctl', required: false).found()
+ init_script = 'systemd'
+ elif find_program('openrc', required: false).found()
+ init_script = 'openrc'
+ else
+ init_script = 'none'
+ endif
+else
+ init_script = get_option('init_script')
+endif
+
# define top include directory
'Use -Werror': cc_flags.contains('-Werror'),
'Warning Flags': supported_cc_flags,
'DTrace': conf.has('WITH_DTRACE_PROBES'),
+ 'Init script': init_script,
'Char device locks': chrdev_lock_files,
'virt-host-validate': conf.has('WITH_HOST_VALIDATE'),
}
option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)')
option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing')
option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate')
+option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install')