diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index 7b44f5ed0..392ce5f14 100644 --- a/configure.ac +++ b/configure.ac @@ -99,37 +99,36 @@ fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$SYSTEMD_UNIT_DIR" -a "$SYSTEMD_UNIT_DIR" != xno ]) # PolicyKit -AC_ARG_WITH(polkit, AS_HELP_STRING([--with-polkit], [Build with PolicyKit support])) -AM_CONDITIONAL(WITH_POLKIT, test "x$with_polkit" = "xyes") -case $with_polkit in - yes) - with_polkit=yes - PKG_CHECK_MODULES(POLKIT, polkit-gobject-1 >= 0.97) - AC_DEFINE(WITH_POLKIT, 1, [Define if you want to use PolicyKit]) - AC_SUBST(POLKIT_CFLAGS) - AC_SUBST(POLKIT_LIBS) - - AM_GLIB_GNU_GETTEXT - ;; - *) - with_polkit=no - ;; -esac +PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.97], [have_polkit=yes],[have_polkit=no]) +AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit], [Enable PolicyKit support]), + [enable_polkit=${enableval}], [enable_polkit=${have_polkit}]) +if (test "x$enable_polkit" = "xyes"); then + if test "x$have_polkit" = "xno"; then + AC_MSG_ERROR(PolicyKit development headers are required) + fi + AC_SUBST(POLKIT_CFLAGS) + AC_SUBST(POLKIT_LIBS) + AC_DEFINE(WITH_POLKIT, 1, [Define if you have PolicyKit support]) +else + AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support]) +fi +AM_CONDITIONAL(WITH_POLKIT, test "x$enable_polkit" = "xyes") AC_ARG_ENABLE(user-control-modem, AS_HELP_STRING([--enable-user-control-modem], [Allow users to control modems without explicitly authenticating])) if test "x$enable_user_control_modem" = "xyes"; then - if test "x$with_polkit" = "xno"; then - AC_MSG_ERROR([--enable-user-control-modem requires --with-polkit]) + if test "x$enable_polkit" = "xyes"; then + USER_CONTROL_MODEM_POLICY="yes" + polkit_policy_type="permissive" + else + AC_MSG_ERROR([--enable-user-control-modem requires --enable-polkit]) fi - USER_CONTROL_MODEM_POLICY="yes" - polkit_policy_type="permissive" else USER_CONTROL_MODEM_POLICY="auth_self_keep" - if test "x$with_polkit" = "xno"; then - polkit_policy_type="n/a" - else + if test "x$enable_polkit" = "xyes"; then polkit_policy_type="restrictive" + else + polkit_policy_type="n/a" fi fi AC_SUBST(USER_CONTROL_MODEM_POLICY) @@ -296,7 +295,7 @@ echo " systemd unit directory: ${with_systemdsystemunitdir} PPP-enabled tests: ${have_pppd_headers} - PolicyKit support: ${with_polkit} (policy: ${polkit_policy_type}) + PolicyKit support: ${enable_polkit} (policy: ${polkit_policy_type}) Documentation: ${enable_gtk_doc} MBIM support: ${with_mbim} QMI support: ${with_qmi} |