]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add loader_nvram build option
authorPavel Hrdina <phrdina@redhat.com>
Fri, 24 Jul 2020 14:45:58 +0000 (16:45 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-loader-nvram.m4 [deleted file]
meson.build
meson_options.txt

index b144062d8c6ffe1c7089e558b1ec95ae56aef981..fbd0fd4d6fda43332741850d44e836c7b2050ec4 100644 (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([])
diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4
deleted file mode 100644 (file)
index ed2ae0c..0000000
+++ /dev/null
@@ -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
-])
index 135d4408c5871cca14d1c3e9b19c05c8083f761f..48f3c5603541ba979311ba968f40970252eeb841 100644 (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: ' ')
index 8b67aa9bc7a34d4a2d3cca5867fb6e071b19072f..203d87acf3eb1802f7f4bae862b9452017cf179f 100644 (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.')