summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2012-01-03 11:29:37 -0500
committerDavid Zeuthen <davidz@redhat.com>2012-01-03 11:29:37 -0500
commitee3abef68386421b4711fc15d14be91e30134bc6 (patch)
tree35939eb4c0a9cb5d0a5b17bf3d3832e310eb096a
parent2027302e803a9569a370b429a475dae5ef8afe34 (diff)
downloadpolkit-ee3abef68386421b4711fc15d14be91e30134bc6.tar.gz
Detect whether systemd is available and default to use if so
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--configure.ac29
1 files changed, 19 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 51d6890..f1801b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,21 +151,30 @@ dnl ---------------------------------------------------------------------------
dnl - Select wether to use systemd or ConsoleKit for session tracking
dnl ---------------------------------------------------------------------------
+have_systemd=no
+SESSION_TRACKING=ConsoleKit
+
AC_ARG_ENABLE([systemd],
- AS_HELP_STRING([--enable-systemd], [Use systemd]),
- [with_systemd=$enableval],
- [with_systemd=no])
-if test "$with_systemd" = "yes" ; then
- PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login])
- SESSION_TRACKING=systemd
-else
- SESSION_TRACKING=ConsoleKit
+ AS_HELP_STRING([--enable-systemd[=@<:@auto/yes/no@:>@]], [Use systemd (auto/yes/no)]),
+ [enable_systemd=$enableval],
+ [enable_systemd=auto])
+if test "$enable_systemd" != "no"; then
+ PKG_CHECK_MODULES(SYSTEMD,
+ [libsystemd-login],
+ have_systemd=yes,
+ have_systemd=no)
+ if test "$have_systemd" = "yes"; then
+ SESSION_TRACKING=systemd
+ else
+ if test "$enable_systemd" = "yes"; then
+ AC_MSG_ERROR([systemd support requested but libsystemd-login1 library not found])
+ fi
+ fi
fi
AC_SUBST(SYSTEMD_CFLAGS)
AC_SUBST(SYSTEMD_LIBS)
-
-AM_CONDITIONAL(HAVE_SYSTEMD, [test "$with_systemd" = "yes"], [Using systemd])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_systemd" = "yes"], [Using systemd])
dnl ---------------------------------------------------------------------------
dnl - Select which authentication framework to use