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

Emil Velikov emil.l.velikov at gmail.com
Thu Mar 15 14:20:21 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 ;-)

v2: auto disable systemd as dbus is missing

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>
---
Thanks for the review Michael!

You're right - the else hunk is only for consistency with surrounding
code.
---
 configure.ac | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0b326ccc..a3453d15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -524,7 +524,12 @@ 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 = xyes -a x$enable_dbus = xno; then
+  AC_MSG_ERROR([systemd-login support explicitly requested, but dbus not available])
+fi
+
+if test x$enable_systemd_login = xauto -a x$enable_dbus = xno; then
   PKG_CHECK_MODULES(SYSTEMD_LOGIN,
                     [libsystemd >= 209],
                     [have_systemd_login_209=yes;have_systemd_login=yes],
@@ -537,21 +542,22 @@ if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
                           [have_systemd_login=yes],
                           [have_systemd_login=no])
         ])
+
+  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
+
+  if test "x$have_systemd_login" = "xyes"; then
+    AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])]
+  fi
+
+  AS_IF([test "x$have_systemd_login_209" = "xyes"],
+        [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
 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
-
-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")
 
-AS_IF([test "x$have_systemd_login_209" = "xyes"],
-      [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
-
 
 # Note that other features might want libxml2, or this feature might use
 # alternative xml libraries at some point. Therefore the feature and
-- 
2.16.0



More information about the wayland-devel mailing list