diff --git a/configure.ac b/configure.ac index 2105c5285b..b144062d8c 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,6 @@ dnl Miscellaneous checks dnl LIBVIRT_ARG_NUMAD -LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_ARG_LOADER_NVRAM LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_ARG_TLS_PRIORITY @@ -106,7 +105,6 @@ LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_NUMAD -LIBVIRT_CHECK_INIT_SCRIPT LIBVIRT_CHECK_LOADER_NVRAM LIBVIRT_CHECK_LOGIN_SHELL LIBVIRT_CHECK_TLS_PRIORITY @@ -180,7 +178,6 @@ AC_MSG_NOTICE([]) 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 diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 deleted file mode 100644 index 676135866f..0000000000 --- a/m4/virt-init-script.m4 +++ /dev/null @@ -1,61 +0,0 @@ -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 . -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]) -]) diff --git a/meson.build b/meson.build index 874b1e5696..135d4408c5 100644 --- a/meson.build +++ b/meson.build @@ -2098,6 +2098,20 @@ elif get_option('host_validate').enabled() 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 @@ -2222,6 +2236,7 @@ misc_summary = { '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'), } diff --git a/meson_options.txt b/meson_options.txt index 67ae7caa96..8b67aa9bc7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -94,3 +94,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend 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')