summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2010-08-10 15:51:35 +0100
committerRichard Hughes <richard@hughsie.com>2010-08-10 15:51:35 +0100
commit0660e5d20788ba0876400236965df87d8a789be3 (patch)
treef195359ca3a86ba011e82ebac812aec2e310e354 /configure.ac
parent23a1694d69d700d339881b6680f022a60f4c1c8a (diff)
Fix compile with the latest PolicyKit release
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 14 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 51933be..a9461f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,9 +150,20 @@ PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.76])
AC_SUBST(DBUS_GLIB_CFLAGS)
AC_SUBST(DBUS_GLIB_LIBS)
-PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.91])
-AC_SUBST(POLKIT_CFLAGS)
-AC_SUBST(POLKIT_LIBS)
+# polkit >= 0.97 uses polkit_authority_get_sync() rather than
+# polkit_authority_get
+PKG_CHECK_MODULES(POLKIT, \
+ polkit-gobject-1 >= 0.97,
+ has_new_polkit=yes,
+ has_new_polkit=no)
+if test x$has_new_polkit = xno; then
+ PKG_CHECK_MODULES(POLKIT, \
+ polkit-backend-1 \
+ polkit-gobject-1 >= 0.91)
+else
+ AC_DEFINE(USE_SECURITY_POLKIT_NEW, 1, [if we should use PolicyKit's new API])
+fi
+
PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.16.1])
AC_SUBST(GIO_CFLAGS)