From a2788c77dd9f45a7251000b0767406a07cf7a3a3 Mon Sep 17 00:00:00 2001 From: Samuli Suominen Date: Fri, 30 Mar 2012 13:14:09 +0300 Subject: [PATCH] Support enable and disable configure switch for polkit to get rid of the automagic dependency. The default is still enabled so old behavior is retained. See, http://bugs.freedesktop.org/show_bug.cgi?id=47587 --- configure.ac | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 7a3b33f..cc93dee 100644 --- a/configure.ac +++ b/configure.ac @@ -56,14 +56,20 @@ PKG_CHECK_MODULES(CONSOLE_KIT, gthread-2.0 >= $GLIB_REQUIRED_VERSION ) -PKG_CHECK_MODULES(POLKIT, - polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION, - have_polkit=yes, - have_polkit=no) -if test "x$have_polkit" = "xyes" ; then - AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit]) -fi -AM_CONDITIONAL(HAVE_POLKIT, test x$have_polkit = xyes) +AC_ARG_ENABLE([polkit], + AS_HELP_STRING([--enable-polkit], [Enable PolicyKit support @<:@default=auto@:>@]), + [enable_polkit=$enableval], + [enable_polkit=auto]) +AS_IF([test "x$enable_polkit" != "xno"], [ + PKG_CHECK_MODULES([POLKIT], [polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION], [have_polkit=yes], [have_polkit=no]) + if test "x$enable_polkit" = "xyes" -a "x$have_polkit" = "xno"; then + AC_MSG_ERROR([PolicyKit support explicitly requested but dependencies not found]) + fi +]) +AS_IF([test "x$have_polkit" = "xyes"], + AC_DEFINE([HAVE_POLKIT], [], [Define if we have polkit]) +]) +AM_CONDITIONAL([HAVE_POLKIT], [test "x$have_polkit" = "xyes"]) AC_SUBST(HAVE_POLKIT) PKG_CHECK_MODULES(LIBDBUS, @@ -428,7 +434,7 @@ echo " Build udev-acl: ${enable_udev_acl} Build docs: ${enable_docbook_docs} - PolicyKit support ${have_polkit} + PolicyKit support ${enable_polkit} RBAC (Solaris) support: ${msg_rbac_shutdown} " if test x${have_polkit} = xno -a x${msg_rbac_shutdown} = xno; then -- 1.7.8.5