1Upstream-Status: Pending
2
3--- ConsoleKit-0.4.6.orig/configure.ac
4+++ ConsoleKit-0.4.6/configure.ac
5@@ -56,10 +56,24 @@ PKG_CHECK_MODULES(CONSOLE_KIT,
6   gthread-2.0 >= $GLIB_REQUIRED_VERSION
7 )
8
9-PKG_CHECK_MODULES(POLKIT,
10-  polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
11-  have_polkit=yes,
12-  have_polkit=no)
13+AC_ARG_WITH([polkit],
14+  [AS_HELP_STRING([--with-polkit],
15+    [support PolicyKit @<:@default=check@:>@])],
16+  [],
17+  [with_polkit=check])
18+
19+AS_IF([test "x$with_polkit" != xno],
20+  [PKG_CHECK_MODULES(POLKIT,
21+     polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
22+     have_polkit=yes,
23+     [if test "x$with_polkit" != xcheck; then
24+       AC_MSG_FAILURE(
25+         [--with-polkit was given, but test for polkit failed])
26+      else
27+        have_polkit=no
28+      fi
29+     ])])
30+
31 if test "x$have_polkit" = "xyes" ; then
32        AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
33 fi
34