summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2013-02-19 17:31:45 +0100
committerColin Walters <walters@verbum.org>2013-04-11 13:02:34 -0400
commit80a10b589fa606930b0dab2e2613e77b734d9a6b (patch)
tree8f081a1bcfe34d4940767c8e6ec58ef5ddc0111a
parent7caa88f1eb8d01ab935f1d1e34a0db20f554448b (diff)
downloadpolkit-80a10b589fa606930b0dab2e2613e77b734d9a6b.tar.gz
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. https://bugs.freedesktop.org/show_bug.cgi?id=61127
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7d2dfcd..b1e478b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,26 @@ if test "$enable_libsystemd_login" != "no"; then
fi
fi
+AS_IF([test "x$cross_compiling" != "xyes" ], [
+ AS_IF([test "$have_libsystemd_login" = "yes"], [
+ AS_IF([test ! -d /sys/fs/cgroup/systemd/ ], [
+ AS_IF([test "$enable_libsystemd_login" = "yes"], [
+ AC_MSG_WARN([libsystemd-login requested but system does not appear to be using systemd])
+ ], [
+ AC_MSG_ERROR([libsystemd-login autoconfigured, but system does not appear to use systemd])
+ ])
+ ])
+ ], [
+ AS_IF([test -d /sys/fs/cgroup/systemd/ ], [
+ AS_IF([test "$enable_libsystemd_login" = "no" ], [
+ AC_MSG_WARN([ConsoleKit requested but system appears to use systemd])
+ ], [
+ AC_MSG_ERROR([ConsoleKit autoconfigured, but systemd is in use (missing libsystemd-login pkg-config?)])
+ ])
+ ])
+ ])
+])
+
AC_SUBST(LIBSYSTEMD_LOGIN_CFLAGS)
AC_SUBST(LIBSYSTEMD_LOGIN_LIBS)
AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, [test "$have_libsystemd_login" = "yes"], [Using libsystemd-login])