[Spice-devel] [vdagent-linux] buildsys: Support libsystemd in addition to libsystemd-login

Christophe Fergeau cfergeau at redhat.com
Tue Mar 1 10:59:49 UTC 2016


Since systemd 209, the various systemd helper libraries are gathered in
a single libsystemd, and libsystemd-login is only built when systemd is
built with compat libraries support. Since commit
https://github.com/systemd/systemd/commit/4de282c
"build-sys: drop libsystemd-{id128,daemon,login,journal}.so compat libs"
(2016-02-12), these compat libraries are no longer available.

This commit checks for both libsystemd and libsystemd-login to ensure we
can build on both older and newer systemd versions.

https://bugs.freedesktop.org/show_bug.cgi?id=94209
---
 configure.ac | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ca9a15b..de72ea2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,9 +84,16 @@ PKG_CHECK_MODULES(ALSA, [alsa >= 1.0.22])
 
 if test "$with_session_info" = "auto" || test "$with_session_info" = "systemd"; then
     PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
-                      [libsystemd-login >= 42],
+                      [libsystemd >= 209],
                       [have_libsystemd_login="yes"],
                       [have_libsystemd_login="no"])
+    if test "$have_libsystemd_login" = "no"; then
+        # for backward compatibility with older systemd versions
+        PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
+                          [libsystemd-login >= 42],
+                          [have_libsystemd_login="yes"],
+                          [have_libsystemd_login="no"])
+    fi
     if test x"$have_libsystemd_login" = "xno" && test "$with_session_info" = "systemd"; then
         AC_MSG_ERROR([libsystemd-login support explicitly requested, but some required packages are not available])
     fi
-- 
2.5.0



More information about the Spice-devel mailing list