]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
configure: clarify rationale for checking pkcheck
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 21 Jul 2015 16:52:03 +0000 (17:52 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 22 Jul 2015 09:50:49 +0000 (10:50 +0100)
We don't need pkcheck binary, but we must detect it in order
to see if we're preferring polkit-1 over polkit-0 when both
are installed. We should also check $with_dbus to see if we
have dbus-devel available, as that's required to talk to
polkit-1.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
configure.ac

index 70b3ef36ff038670eeefed4df05e52c2353e766c..7c2257f2ae5aa87f7bbba7cb08651470a3bc42ae 100644 (file)
@@ -1339,15 +1339,28 @@ AC_ARG_WITH([polkit],
 with_polkit0=no
 with_polkit1=no
 if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
-  dnl Check for new polkit first - just a binary
+  dnl Check for new polkit first. We directly talk over DBus
+  dnl but we use existence of pkcheck binary as a sign that
+  dnl we should prefer polkit-1 over polkit-0, so we check
+  dnl for it even though we don't ultimately use it
   AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
   if test "x$PKCHECK_PATH" != "x" ; then
-    AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
-        [use PolicyKit for UNIX socket access checks])
-    AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
-        [use PolicyKit for UNIX socket access checks])
-    with_polkit="yes"
-    with_polkit1="yes"
+    dnl Found pkcheck, so ensure dbus-devel is present
+    if test "x$with_dbus" = "xyes" ; then
+      AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
+          [use PolicyKit for UNIX socket access checks])
+      AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
+          [use PolicyKit for UNIX socket access checks])
+      with_polkit="yes"
+      with_polkit1="yes"
+    else
+      if test "x$with_polkit" = "xcheck" ; then
+        with_polkit=no
+      else
+         AC_MSG_ERROR(
+           [You must install dbus to compile libvirt with polkit-1])
+      fi
+    fi
   else
     dnl Check for old polkit second - library + binary
     PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED,