From 1bc633660a18f1cf0dca27d84ebab7093b519c3c Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 19 Feb 2013 17:31:45 +0100 Subject: [PATCH] build: try harder to avoid systemd/consolekit misconfiguration Check if the system is booting systemd, and fail if the automatic configuration picks the wrong value. Emit a warning if the user explicitly chose one way or the other, to account for cross-building. --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index 40f0cd7..40d54d9 100644 --- a/configure.ac +++ b/configure.ac @@ -175,6 +175,24 @@ if test "$enable_libsystemd_login" != "no"; then fi fi +if test "$have_libsystemd_login" = "yes"; then + if test ! -d /sys/fs/cgroup/systemd/ ; then + if test "$enable_libsystemd_login" = "yes"; then + AC_MSG_WARN([libsystemd-login requested but system does not appear to be using systemd]) + else + AC_MSG_ERROR([libsystemd-login autoconfigured, but system does not appear to use systemd]) + fi + fi +else + if test -d /sys/fs/cgroup/systemd/ ; then + if test "$enable_libsystemd_login" = "no"; then + AC_MSG_WARN([ConsoleKit requested but system appears to use systemd]) + else + AC_MSG_ERROR([ConsoleKit autoconfigured, but systemd is in use (missing libsystemd-login pkg-config?)]) + fi + fi +fi + AC_SUBST(LIBSYSTEMD_LOGIN_CFLAGS) AC_SUBST(LIBSYSTEMD_LOGIN_LIBS) AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, [test "$have_libsystemd_login" = "yes"], [Using libsystemd-login]) -- 1.8.1.2