[libvirt PATCH 113/351] meson: add debug_logs build option

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:55:49 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac      |  3 ---
 m4/virt-debug.m4  | 33 ---------------------------------
 meson.build       |  5 +++++
 meson_options.txt |  1 +
 4 files changed, 6 insertions(+), 36 deletions(-)
 delete mode 100644 m4/virt-debug.m4

diff --git a/configure.ac b/configure.ac
index 3a4d98f1dd9..2ecdd30d48f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,7 +101,6 @@ dnl
 dnl Miscellaneous checks
 dnl
 
-LIBVIRT_ARG_DEBUG
 LIBVIRT_ARG_DTRACE
 LIBVIRT_ARG_NUMAD
 LIBVIRT_ARG_INIT_SCRIPT
@@ -112,7 +111,6 @@ LIBVIRT_ARG_TLS_PRIORITY
 LIBVIRT_ARG_SYSCTL_CONFIG
 
 
-LIBVIRT_CHECK_DEBUG
 LIBVIRT_CHECK_DTRACE
 LIBVIRT_CHECK_NUMAD
 LIBVIRT_CHECK_INIT_SCRIPT
@@ -197,7 +195,6 @@ LIBVIRT_WIN_RESULT_WINDRES
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Miscellaneous])
 AC_MSG_NOTICE([])
-LIBVIRT_RESULT_DEBUG
 LIBVIRT_RESULT_DTRACE
 LIBVIRT_RESULT_NUMAD
 LIBVIRT_RESULT_INIT_SCRIPT
diff --git a/m4/virt-debug.m4 b/m4/virt-debug.m4
deleted file mode 100644
index d3ac0564f2e..00000000000
--- a/m4/virt-debug.m4
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl The debug 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_DEBUG], [
-  LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_DEBUG], [
-  AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes")
-  if test x"$enable_debug" = x"yes"; then
-    AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
-  fi
-])
-
-AC_DEFUN([LIBVIRT_RESULT_DEBUG], [
-  LIBVIRT_RESULT([Debug], [$enable_debug])
-])
diff --git a/meson.build b/meson.build
index 9d80aec8fd3..1a7cc483595 100644
--- a/meson.build
+++ b/meson.build
@@ -2059,6 +2059,10 @@ if chrdev_lock_files != ''
   conf.set_quoted('VIR_CHRDEV_LOCK_FILE_PATH', chrdev_lock_files)
 endif
 
+if get_option('debug_logs')
+  conf.set('ENABLE_DEBUG', 1)
+endif
+
 
 # define top include directory
 
@@ -2175,6 +2179,7 @@ test_summary = {
 summary(test_summary, section: 'Test suite', bool_yn: true)
 
 misc_summary = {
+  'Debug': conf.has('ENABLE_DEBUG'),
   'Use -Werror': cc_flags.contains('-Werror'),
   'Warning Flags': supported_cc_flags,
   'Char device locks': chrdev_lock_files,
diff --git a/meson_options.txt b/meson_options.txt
index 1f32533f0f5..a09dad02875 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -91,3 +91,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend
 
 # build feature options
 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('debug_logs', type: 'boolean', value: true, description: 'enable debugging output')
-- 
2.26.2




More information about the libvir-list mailing list