[PATCH] xserver: Fix configure.ac check for libsystemd/-daemon
Pekka Paalanen
ppaalanen at gmail.com
Thu Dec 3 03:39:13 PST 2015
On Fri, 27 Nov 2015 15:57:21 +0000
Bob Ham <bob.ham at collabora.com> wrote:
> 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],
This is not this patch's thing, but should there be a version check to
ensure the libsystemd actually does contain what used to be
libsystemd-daemon?
> - [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"])
>
I tested this to work both when libsystemd-daemon exists and doesn't
exist on a systemd system, and seems to configure just fine, on the
same systemd version where libsystemd-daemon.pc uses -lsystemd.
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151203/1c8655f4/attachment-0001.sig>
More information about the xorg-devel
mailing list