docs: Update documentation for spapr-vio addresses
[libvirt/ericb.git] / m4 / virt-polkit.m4
blob16889e1639e22b5df06c308c9277b27a9901af47
1 dnl The polkit library
2 dnl
3 dnl Copyright (C) 2016 Red Hat, Inc.
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library.  If not, see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
20 AC_DEFUN([LIBVIRT_ARG_POLKIT], [
21   LIBVIRT_ARG_WITH([POLKIT], [use PolicyKit for UNIX socket access checks],
22                    [check])
25 AC_DEFUN([LIBVIRT_CHECK_POLKIT], [
26   AC_REQUIRE([LIBVIRT_CHECK_DBUS])
28   if test "x$with_polkit" = "xcheck"; then
29     dnl For --with-polkit=check, also require the pkcheck binary, even
30     dnl though we talk to polkit directly over D-Bus.
31     AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [$LIBVIRT_SBIN_PATH])
32     if test "x$PKCHECK_PATH" = "x" ; then
33         with_polkit="no"
34     fi
35   fi
37   if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
38     dnl For --with-polkit=yes, all we need is D-Bus.
39     if test "x$with_dbus" = "xyes" ; then
40       AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
41           [use PolicyKit for UNIX socket access checks])
42       with_polkit="yes"
43     else
44       if test "x$with_polkit" = "xcheck" ; then
45         with_polkit=no
46       else
47          AC_MSG_ERROR(
48            [You must install dbus to compile libvirt with polkit-1])
49       fi
50     fi
51   fi
53   AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"])
56 AC_DEFUN([LIBVIRT_RESULT_POLKIT], [
57   LIBVIRT_RESULT([polkit], [$with_polkit])