summaryrefslogtreecommitdiff
path: root/m4/virt-numad.m4
blob: e760dcc579a079273376f9f2edf9da828825309a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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], [
  AC_MSG_NOTICE([             numad: $with_numad])
])