meson: add loader_nvram build option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-24 16:45:58 +02:00
parent c0a5b15d69
commit 1d819caacd
4 changed files with 15 additions and 52 deletions

View File

@ -98,14 +98,12 @@ dnl Miscellaneous checks
dnl
LIBVIRT_ARG_NUMAD
LIBVIRT_ARG_LOADER_NVRAM
LIBVIRT_ARG_LOGIN_SHELL
LIBVIRT_ARG_TLS_PRIORITY
LIBVIRT_ARG_SYSCTL_CONFIG
LIBVIRT_CHECK_NUMAD
LIBVIRT_CHECK_LOADER_NVRAM
LIBVIRT_CHECK_LOGIN_SHELL
LIBVIRT_CHECK_TLS_PRIORITY
LIBVIRT_CHECK_SYSCTL_CONFIG
@ -178,7 +176,6 @@ AC_MSG_NOTICE([])
AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([])
LIBVIRT_RESULT_NUMAD
LIBVIRT_RESULT_LOADER_NVRAM
LIBVIRT_RESULT_LOGIN_SHELL
LIBVIRT_RESULT_TLS_PRIORITY
AC_MSG_NOTICE([])

View File

@ -1,49 +0,0 @@
dnl The loader:nvram list check
dnl
dnl Copyright (C) 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_LOADER_NVRAM], [
LIBVIRT_ARG_WITH([LOADER_NVRAM],
[Pass list of pairs of <loader>:<nvram> paths.
Both pairs and list items are separated by a colon.],
[''])
])
AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [
if test "x$with_loader_nvram" != "xno" && \
test "x$with_loader_nvram" != "x" ; then
l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l)
if test $(expr $l % 2) -ne 0 ; then
AC_MSG_ERROR([Malformed --with-loader-nvram argument])
elif test $l -gt 0 ; then
AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon])
fi
AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"],
[List of loader:nvram pairs])
fi
])
AC_DEFUN([LIBVIRT_RESULT_LOADER_NVRAM], [
if test "x$with_loader_nvram" != "xno" && \
test "x$with_loader_nvram" != "x" ; then
LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram],
[!!! Using this configure option is strongly discouraged !!!])
else
LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram])
fi
])

View File

@ -2112,6 +2112,14 @@ else
init_script = get_option('init_script')
endif
loader_nvram = get_option('loader_nvram')
if loader_nvram != ''
if (loader_nvram.split(':').length() % 2) != 0
error('Malformed loader_nvram option')
endif
conf.set_quoted('DEFAULT_LOADER_NVRAM', loader_nvram)
endif
# define top include directory
@ -2232,12 +2240,18 @@ test_summary = {
}
summary(test_summary, section: 'Test suite', bool_yn: true)
if conf.has('DEFAULT_LOADER_NVRAM')
loader_res = '@0@ !!! Using this configure option is strongly discouraged !!!'.format(conf.get_unquoted('DEFAULT_LOADER_NVRAM'))
else
loader_res = ''
endif
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,
'Loader/NVRAM': loader_res,
'virt-host-validate': conf.has('WITH_HOST_VALIDATE'),
}
summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ')

View File

@ -95,3 +95,4 @@ option('chrdev_lock_files', type: 'string', value: '', description: 'location fo
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')
option('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of <loader>:<nvram> paths. Both pairs and list items are separated by a colon.')