[PATCH] xserver: Fix configure.ac check for libsystemd/-daemon

Bob Ham bob.ham at collabora.com
Fri Nov 27 07:57:21 PST 2015


The configure script looks for the libsystemd-daemon pkg-config
module.  If the configure script finds it, the script will add
libsystemd-daemon to a list of modules which are used to consolidate
CFLAGS and LIBS.

The check for libsystemd-daemon was altered to fallback to libsystemd
if libsystemd-daemon was not found (libsystemd-daemon was brought into
libsystemd).  Unfortunately, the configure script still adds
"libsystemd-daemon" to the list of modules to consolidate, instead of
"libsystemd".  With this patch, we set a variable depending on which
pkg-config module is found and add that to the module list instead.

Signed-off-by: Bob Ham <bob.ham at collabora.com>
---
 configure.ac | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 14a5bb8..01eabc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -837,9 +837,10 @@ AC_ARG_WITH([systemd-daemon],
 		[support systemd socket activation (default: auto)]),
 	[WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto])
 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
-                  [HAVE_SYSTEMD_DAEMON=yes],
+                  [HAVE_SYSTEMD_DAEMON=yes; systemd_daemon_lib="libsystemd-daemon"],
                   [PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
-                                     [HAVE_SYSTEMD_DAEMON=yes], [HAVE_SYSTEMD_DAEMON=no])])
+                                     [HAVE_SYSTEMD_DAEMON=yes; systemd_daemon_lib="libsystemd"],
+                                     [HAVE_SYSTEMD_DAEMON=no])])
 if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
 	WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
 fi
@@ -848,7 +849,7 @@ if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
 		AC_MSG_ERROR([systemd support requested but no library has been found])
 	fi
 	AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
-	REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
+	REQUIRED_LIBS="$REQUIRED_LIBS $systemd_daemon_lib"
 fi
 AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
 
-- 
2.1.4



More information about the xorg-devel mailing list