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.

Changes since v1:
- Rearranged logic so that we do a versioned check for libsystemd
  first, then look for libsystemd-daemon.
- Cleaned up the check a bit, only performing the module checks if we
  don't have --with-systemd-daemon=no, in a similar style to
  --with-dtrace.
- Changed the variable name to LIBSYSTEMD_DAEMON as per feedback.

Signed-off-by: Bob Ham <[email protected]>
---
 configure.ac | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2e38efa..ac3bb64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -832,23 +832,26 @@ REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO 
$XTRANS $BIGREQSPROTO $S
 
 dnl systemd socket activation
 dnl activate the code in libxtrans that grabs systemd's socket fds
+dnl libsystemd-daemon was moved into libsystemd in version 209
+LIBSYSTEMD="libsystemd >= 209"
 AC_ARG_WITH([systemd-daemon],
        AS_HELP_STRING([--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],
-                  [PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
-                                     [HAVE_SYSTEMD_DAEMON=yes], 
[HAVE_SYSTEMD_DAEMON=no])])
-if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
-       WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
-fi
-if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
-       if test "x$HAVE_SYSTEMD_DAEMON" = xno; then
+if test "x$WITH_SYSTEMD_DAEMON" = "xyes" -o "x$WITH_SYSTEMD_DAEMON" = "xauto" 
; then
+       PKG_CHECK_MODULES([SYSTEMD_DAEMON], [$LIBSYSTEMD],
+                         [HAVE_SYSTEMD_DAEMON=yes;
+                          LIBSYSTEMD_DAEMON="$LIBSYSTEMD"],
+                         [PKG_CHECK_MODULES([SYSTEMD_DAEMON], 
[libsystemd-daemon],
+                                            [HAVE_SYSTEMD_DAEMON=yes;
+                                             
LIBSYSTEMD_DAEMON=libsystemd-daemon],
+                                            [HAVE_SYSTEMD_DAEMON=no])])
+       if test "x$HAVE_SYSTEMD_DAEMON" = xyes; then
+               AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if 
libsystemd-daemon is available])
+               REQUIRED_LIBS="$REQUIRED_LIBS $LIBSYSTEMD_DAEMON"
+       elif 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"
 fi
 AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
 
-- 
2.1.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to