summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac39
1 files changed, 22 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index e24ce732f9..13bd82d203 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,27 +457,31 @@ else
fi
AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
-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 "${enable_polkit}" = "yes"); then
- if test x"$have_polkit" = x"no"; 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])
+# we usually compile with polkit support. --enable-polkit=yes|no only sets the
+# default configuration for main.auth-polkit. User can always enable/disable polkit
+# autorization via config. Only when specifying --enable-polkit=disabled, we do
+# not compile support. In this case, the user cannot enable polkit authorization via
+# configuration.
+AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit=yes|no|disabled], [set default value for auth-polkit configuration option. This value can be overwritten by NM configuration. 'disabled' compiles NM without any support]),
+ [enable_polkit=${enableval}], [enable_polkit=yes])
+if (test "${enable_polkit}" != "no" -a "${enable_polkit}" != "disabled"); then
+ enable_polkit=yes
+ AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, TRUE, [The default value of the auth-polkit configuration option])
+ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='true'
+else
+ AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, FALSE, [The default value of the auth-polkit configuration option])
+ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='false'
+fi
+if (test "${enable_polkit}" != "disabled"); then
+ AC_DEFINE(WITH_POLKIT, 1, [whether to compile polkit support])
else
- AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support])
+ AC_DEFINE(WITH_POLKIT, 0, [whether to compile polkit support])
fi
-AM_CONDITIONAL(WITH_POLKIT, test "${enable_polkit}" = "yes")
+AC_SUBST(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT)
AC_ARG_ENABLE(modify-system,
AS_HELP_STRING([--enable-modify-system], [Allow users to modify system connections]))
if test "${enable_modify_system}" = "yes"; then
- if ! test "${enable_polkit}" = "yes"; then
- AC_MSG_ERROR([--enable-modify-system requires --enable-polkit])
- fi
NM_MODIFY_SYSTEM_POLICY="yes"
else
NM_MODIFY_SYSTEM_POLICY="auth_admin_keep"
@@ -918,6 +922,7 @@ initscript/linexa/networkmanager
introspection/Makefile
introspection/all.xml
man/Makefile
+man/NetworkManager.conf.xml
man/nm-system-settings.conf.5
man/nm-online.1
man/nmcli.1
@@ -968,9 +973,9 @@ echo " session tracking: $with_session_tracking"
echo " suspend/resume: $with_suspend_resume"
if test "${enable_polkit}" = "yes"; then
if test "${enable_modify_system}" = "yes"; then
- echo " policykit: yes (permissive modify.system)"
+ echo " policykit: yes (permissive modify.system) (default=${enable_polkit})"
else
- echo " policykit: yes (restrictive modify.system)"
+ echo " policykit: yes (restrictive modify.system) (default=${enable_polkit})"
fi
else
echo " policykit: no"