summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-03-26 22:20:59 +0100
committerVictor Kareh <[email protected]>2019-04-04 13:12:48 -0400
commit78affe713109ebc5315cfac6d50ca677f2a945ed (patch)
treea63e89b7a31da0370eceb1d3f2e1a330fccd241c
parent09af4c546df2acec4cec75a11123d2679307e681 (diff)
downloadmate-screensaver-78affe713109ebc5315cfac6d50ca677f2a945ed.tar.bz2
mate-screensaver-78affe713109ebc5315cfac6d50ca677f2a945ed.tar.xz
Add ELOGIND support
Reuses WITH_SYSTEMD #define to reduce #ifdef mess. ELOGIND is not officially supported, but since it's a subset of systemd, it should work out of the box. Co-authored-by: Joakim Tjernlund <[email protected]>
-rw-r--r--configure.ac27
-rw-r--r--src/Makefile.am2
2 files changed, 29 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d13efd2..d675005 100644
--- a/configure.ac
+++ b/configure.ac
@@ -945,6 +945,32 @@ fi
AC_SUBST(SYSTEMD_CFLAGS)
AC_SUBST(SYSTEMD_LIBS)
+dnl ====================================================================
+dnl Check for elogind
+dnl
+dnl elogind is not officially supported, but since it's a subset of
+dnl systemd, it should work out of the box
+dnl ====================================================================
+
+AC_ARG_WITH(elogind,
+ AS_HELP_STRING([--with-elogind],
+ [Use libelogind instead of libsystemd-login]),
+ [with_elogind=$withval], [with_elogind=no])
+
+use_elogind=no
+if test "x$with_elogind" = "xyes"; then
+ PKG_CHECK_MODULES(LIBELOGIND,[libelogind], [use_elogind=yes], [use_elogind=no])
+
+ if test "x$use_elogind" = "xyes"; then
+ AC_DEFINE([WITH_ELOGIND], 1, [elogind support])
+ AC_DEFINE([WITH_SYSTEMD], 1, [Define to 1 to reduce ifdefs since elogind is a drop-in replacement for systemd])
+ AC_SUBST(LIBELOGIND_CFLAGS)
+ AC_SUBST(LIBELOGIND_LIBS)
+ fi
+fi
+AM_CONDITIONAL(WITH_ELOGIND, [test "x$use_elogind" = "xyes"])
+AC_SUBST(WITH_ELOGIND)
+
dnl ---------------------------------------------------------------------------
dnl libmatekbd
dnl ---------------------------------------------------------------------------
@@ -1163,6 +1189,7 @@ echo "
Screen locking enabled: ${enable_locking}
Show keyboard indicator: ${with_kbd_layout_indicator}
systemd support: ${use_systemd}
+ elogind support: ${use_elogind}
ConsoleKit support: ${use_console_kit}
libnotify support: ${have_libnotify}
PAM support: ${have_pam}
diff --git a/src/Makefile.am b/src/Makefile.am
index 51e09bf..37cbbca 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,6 +32,7 @@ AM_CPPFLAGS = \
$(LIBMATEKBDUI_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(SYSTEMD_CFLAGS) \
+ $(LIBELOGIND_CFLAGS) \
$(NULL)
bin_PROGRAMS = \
@@ -216,6 +217,7 @@ mate_screensaver_LDADD = \
$(MATE_SCREENSAVER_LIBS) \
$(SAVER_LIBS) \
$(SYSTEMD_LIBS) \
+ $(LIBELOGIND_LIBS) \
$(NULL)
mate_screensaver_LDFLAGS = -export-dynamic