From e486a3803d74d406d014847cc88f50cd1cef87c7 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 17 May 2015 20:16:36 +0200 Subject: [PATCH] build: don't abort configure if there's no systemd devel headers Just disable systemd-logind session tracking instead. --- configure.ac | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5f2eb2e851..442f25abd3 100644 --- a/configure.ac +++ b/configure.ac @@ -364,12 +364,19 @@ AS_IF([test "$with_session_tracking" = "none"], [use_consolekit="no" use_systemd AS_IF([test -n "$with_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"]) AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"]) # defaults -AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="yes"]) +AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="auto"]) AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"]) # output session_tracking= -if test "$use_systemd_logind" = "yes"; then - PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], , [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login])]) +if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then + PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])]) +else + have_systemd_logind=no +fi +if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then + AC_MSG_ERROR([You must have libsystemd installed to build with systemd-logind support.]) +fi +if test "$have_systemd_logind" = "yes"; then AC_SUBST(SYSTEMD_LOGIN_CFLAGS) AC_SUBST(SYSTEMD_LOGIN_LIBS) AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available])