[libvirt PATCH 121/351] meson: add numad build option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac      |  3 ---
 m4/virt-numad.m4  | 58 -----------------------------------------------
 meson.build       | 11 +++++++++
 meson_options.txt |  1 +
 4 files changed, 12 insertions(+), 61 deletions(-)
 delete mode 100644 m4/virt-numad.m4

diff --git a/configure.ac b/configure.ac
index b1faa47f81c..82c166b760d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,12 +96,10 @@ dnl
 dnl Miscellaneous checks
 dnl
 
-LIBVIRT_ARG_NUMAD
 LIBVIRT_ARG_TLS_PRIORITY
 LIBVIRT_ARG_SYSCTL_CONFIG
 
 
-LIBVIRT_CHECK_NUMAD
 LIBVIRT_CHECK_TLS_PRIORITY
 LIBVIRT_CHECK_SYSCTL_CONFIG
 
@@ -170,6 +168,5 @@ LIBVIRT_WIN_RESULT_WINDRES
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Miscellaneous])
 AC_MSG_NOTICE([])
-LIBVIRT_RESULT_NUMAD
 LIBVIRT_RESULT_TLS_PRIORITY
 AC_MSG_NOTICE([])
diff --git a/m4/virt-numad.m4 b/m4/virt-numad.m4
deleted file mode 100644
index 378eba3c97d..00000000000
--- a/m4/virt-numad.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-dnl The numad binary 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_NUMAD], [
-  LIBVIRT_ARG_WITH([NUMAD], [use numad to manage CPU placement dynamically],
-                   [check])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_NUMAD], [
-  AC_REQUIRE([LIBVIRT_CHECK_NUMACTL])
-
-  if test "$with_numad" != "no" ; then
-    fail=0
-
-    AC_PATH_PROG([NUMAD], [numad], [], [$LIBVIRT_SBIN_PATH])
-
-    if test "$with_numad" = "check"; then
-      test "$with_numactl" = "yes" || fail=1
-      if test -z "$NUMAD" || test $fail = 1; then
-        with_numad="no"
-      else
-        with_numad="yes"
-      fi
-    else
-      test -z  "$NUMAD" &&
-        AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically])
-
-      test "$with_numactl" = "yes" || fail=1
-      test $fail = 1 &&
-        AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])
-    fi
-  fi
-  if test "$with_numad" = "yes"; then
-    AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available])
-    AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program])
-  fi
-  AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"])
-])
-
-AC_DEFUN([LIBVIRT_RESULT_NUMAD], [
-  LIBVIRT_RESULT([numad], [$with_numad])
-])
diff --git a/meson.build b/meson.build
index b1bbd0f4351..f09538bdf13 100644
--- a/meson.build
+++ b/meson.build
@@ -2146,6 +2146,16 @@ if not get_option('nss').disabled()
   endif
 endif
 
+if not get_option('numad').disabled() and numactl_dep.found()
+  numad_prog = find_program('numad', required: get_option('numad'), dirs: libvirt_sbin_path)
+  if numad_prog.found()
+    conf.set('HAVE_NUMAD', 1)
+    conf.set_quoted('NUMAD', numad_prog.path())
+  endif
+elif get_option('numad').enabled()
+  error('You must have numactl enabled for numad support.')
+endif
+
 
 # define top include directory
 
@@ -2272,6 +2282,7 @@ misc_summary = {
   'Use -Werror': cc_flags.contains('-Werror'),
   'Warning Flags': supported_cc_flags,
   'DTrace': conf.has('WITH_DTRACE_PROBES'),
+  'numad': conf.has('HAVE_NUMAD'),
   'Init script': init_script,
   'Char device locks': chrdev_lock_files,
   'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'),
diff --git a/meson_options.txt b/meson_options.txt
index b7a4fddb8a2..16acb4f3c50 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -98,3 +98,4 @@ option('host_validate', type: 'feature', value: 'auto', description: 'build virt
 option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install')
 option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell')
 option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses')
+option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically')
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux