From 31d5c018adae5aff073edbade7a70ebb088d67ab Mon Sep 17 00:00:00 2001 From: Samuli Suominen Date: Fri, 30 Mar 2012 13:44:16 +0300 Subject: [PATCH] Configure switch for PolicyKit. 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..6a6ce01 100644 --- a/configure.ac +++ b/configure.ac @@ -56,14 +56,21 @@ 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) +have_polkit=no +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, -- 1.7.8.5