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=enabled@:>@]), + [enable_polkit=$enableval], + [enable_polkit=yes]) +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