[PATCH weston] configure.ac: fixup systemd/systemd-login detection

Emil Velikov emil.l.velikov at gmail.com
Wed Mar 14 14:06:59 UTC 2018


From: Emil Velikov <emil.velikov at collabora.com>

Current systemd/systemd-login integration requires dbus. Although that
is far from clear the way current checks are handled.

Be explicit and clear, effectively fixing cases where the systemd
auto detection will trip when dbus is explicitly disabled.

Using git show -w will make things easier to read ;-)

Cc: Michael Tretter <m.tretter at pengutronix.de>
Reported-by: Michael Tretter <m.tretter at pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Michael, can you give this a try instead?
---
 configure.ac | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index dd344d6a..89b89d3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -524,7 +524,11 @@ AC_ARG_ENABLE(systemd-login,
               AS_HELP_STRING([--enable-systemd-login],
                              [Enable logind support]),,
               enable_systemd_login=auto)
-if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
+if test x$enable_systemd_login != xno; then
+  if test x$enable_systemd_login = xyes -a x$enable_dbus = xno; then
+    AC_MSG_ERROR([systemd-login support explicitly requested, but dbus not available])
+  fi
+
   PKG_CHECK_MODULES(SYSTEMD_LOGIN,
                     [libsystemd >= 209],
                     [have_systemd_login_209=yes;have_systemd_login=yes],
@@ -537,20 +541,21 @@ if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
                           [have_systemd_login=yes],
                           [have_systemd_login=no])
         ])
-else
-  have_systemd_login=no
-fi
 
-if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
-  AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209, libsystemd-login or dbus])
-fi
+  if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
+    AC_MSG_ERROR([systemd-login support explicitly requested, but can't find libsystemd>=209 or libsystemd-login])
+  fi
 
-AS_IF([test "x$have_systemd_login" = "xyes"],
-      [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
-AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
+  if test "x$have_systemd_login" = "xyes"; then
+    AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])]
+  else
+    have_systemd_login=no
+  fi
 
-AS_IF([test "x$have_systemd_login_209" = "xyes"],
-      [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
+  AS_IF([test "x$have_systemd_login_209" = "xyes"],
+        [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
 
 
 # Note that other features might want libxml2, or this feature might use
-- 
2.16.0



More information about the wayland-devel mailing list