summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-07-24 16:12:47 +0100
committerRichard Hughes <richard@hughsie.com>2017-07-24 16:25:04 +0100
commitc104d369fc0145fc125d96521f0aefb2b01f8af0 (patch)
tree3c7ee5ff52b02e4933c59fe70c9c2b0153ed2818
parentef97f834c9affddd1110622cc62a045558f5dd38 (diff)
downloadcolord-c104d369fc0145fc125d96521f0aefb2b01f8af0.tar.gz
Don't allow HAVE_LIBSYSTEMD_LOGIN with no systemd support
-rw-r--r--README.md2
-rw-r--r--configure.ac26
-rw-r--r--lib/colord/cd-test-daemon.c4
-rw-r--r--src/Makefile.am6
-rw-r--r--src/cd-main.c4
5 files changed, 19 insertions, 23 deletions
diff --git a/README.md b/README.md
index c55f1ca..e5f0791 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,7 @@ Compiling for Microsoft Windows
--disable-print-profiles \
--disable-sane \
--disable-session-example \
- --disable-systemd-login \
+ --disable-systemd \
--disable-udev \
--disable-unix \
--without-pic \
diff --git a/configure.ac b/configure.ac
index 198563e..64d5474 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,7 +217,6 @@ AC_ARG_WITH([systemdsystemunitdir],
if test "x$with_systemdsystemunitdir" != "xno"; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
-AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
dnl ---------------------------------------------------------------------------
dnl - Where to install tmpfiles.d snippet rules
@@ -240,23 +239,20 @@ fi
AM_CONDITIONAL(BUILD_LIBCOLORDCOMPAT, test x$build_libcolordcompat = xyes)
dnl ---------------------------------------------------------------------------
-dnl - Use systemd-login to track the process seat
+dnl - Use systemd to track the process seat
dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(systemd-login, AS_HELP_STRING([--enable-systemd-login],[Build systemd seat-tracking support]),
- enable_systemd_login=$enableval, enable_systemd_login=yes)
-AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, test x$enable_systemd_login = xyes)
-if test x$enable_systemd_login != xno; then
+AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[Build systemd seat-tracking support]),
+ enable_systemd=$enableval, enable_systemd=yes)
+AM_CONDITIONAL(HAVE_SYSTEMD, test x$enable_systemd = xyes)
+if test x$enable_systemd != xno; then
PKG_CHECK_MODULES(LIBSYSTEMD,
[libsystemd],
- [LIBSYSTEMD_LOGIN_CFLAGS=$LIBSYSTEMD_CFLAGS;
- LIBSYSTEMD_LOGIN_LIBS=$LIBSYSTEMD_LIBS],
- [PKG_CHECK_MODULES(LIBSYSTEMD_LOGIN,
- [libsystemd-login >= 44])])
- AC_DEFINE([HAVE_LIBSYSTEMD_LOGIN], 1, [Define to 1 if systemd login is available])
+ [LIBSYSTEMD_CFLAGS=$LIBSYSTEMD_CFLAGS;
+ LIBSYSTEMD_LIBS=$LIBSYSTEMD_LIBS],
+ [PKG_CHECK_MODULES(LIBSYSTEMD,
+ [libsystemd >= 44])])
+ AC_DEFINE([HAVE_SYSTEMD], 1, [Define to 1 if systemd login is available])
fi
-AC_SUBST(HAVE_LIBSYSTEMD_LOGIN)
-AC_SUBST(LIBSYSTEMD_LOGIN_CFLAGS)
-AC_SUBST(LIBSYSTEMD_LOGIN_LIBS)
dnl ---------------------------------------------------------------------------
dnl - Where to install udev rules
@@ -476,7 +472,7 @@ echo "
Vala API generator: ${has_vapigen}
Daemon user: ${daemon_user}
udev rules.d dir: ${with_udevrulesdir}
- systemd-login support: ${enable_systemd_login}
+ systemd support: ${enable_systemd}
systemd service dir: ${with_systemdsystemunitdir}
tmpfiles.d dir: ${with_tmpfilesdir}
Session helper support: ${enable_session_helper}
diff --git a/lib/colord/cd-test-daemon.c b/lib/colord/cd-test-daemon.c
index 98852e9..5aa0ebf 100644
--- a/lib/colord/cd-test-daemon.c
+++ b/lib/colord/cd-test-daemon.c
@@ -2218,7 +2218,7 @@ colord_device_seat_func (void)
{
CdClient *client;
CdDevice *device;
-#ifdef HAVE_LIBSYSTEMD_LOGIN
+#ifdef HAVE_SYSTEMD
const gchar *tmp;
#endif
gboolean ret;
@@ -2256,7 +2256,7 @@ colord_device_seat_func (void)
g_assert (ret);
/* check the seat */
-#ifdef HAVE_LIBSYSTEMD_LOGIN
+#ifdef HAVE_SYSTEMD
tmp = cd_device_get_seat (device);
if (tmp != NULL)
g_assert_cmpstr (tmp, ==, "seat0");
diff --git a/src/Makefile.am b/src/Makefile.am
index 0634ba0..28abb55 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,7 +18,7 @@ AM_CPPFLAGS = \
$(GUDEV_CFLAGS) \
$(GUSB_CFLAGS) \
$(SQLITE_CFLAGS) \
- $(LIBSYSTEMD_LOGIN_CFLAGS) \
+ $(LIBSYSTEMD_CFLAGS) \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib/colord \
@@ -102,7 +102,7 @@ colord_LDADD = \
$(LCMS_LIBS) \
$(GUDEV_LIBS) \
$(GUSB_LIBS) \
- $(LIBSYSTEMD_LOGIN_LIBS) \
+ $(LIBSYSTEMD_LIBS) \
$(COLORD_PRIVATE_LIBS) \
$(GLIB_LIBS) \
$(GLIB_UNIX_LIBS)
@@ -151,7 +151,7 @@ cd_self_test_LDADD = \
$(POLKIT_LIBS) \
$(LCMS_LIBS) \
$(SQLITE_LIBS) \
- $(LIBSYSTEMD_LOGIN_LIBS) \
+ $(LIBSYSTEMD_LIBS) \
$(GLIB_LIBS) \
$(GLIB_UNIX_LIBS)
diff --git a/src/cd-main.c b/src/cd-main.c
index 660a0a0..4574c63 100644
--- a/src/cd-main.c
+++ b/src/cd-main.c
@@ -29,7 +29,7 @@
#include <glib/gi18n.h>
#include <locale.h>
-#ifdef HAVE_LIBSYSTEMD_LOGIN
+#ifdef HAVE_SYSTEMD
#include <systemd/sd-login.h>
#endif
@@ -483,7 +483,7 @@ static gchar *
cd_main_get_seat_for_process (guint pid)
{
gchar *seat = NULL;
-#ifdef HAVE_LIBSYSTEMD_LOGIN
+#ifdef HAVE_SYSTEMD
char *sd_seat = NULL;
char *sd_session = NULL;
gint rc;