[PATCH v2] configure.ac: Use libsystemd in REQUIRED_LIBS check

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 17 17:38:18 PST 2015


On Tue, Nov 17, 2015 at 10:39:48AM +0200, Jussi Kukkonen wrote:
> REQUIRED_LIBS needs to be set to the correct systemd library,
> otherwise the later check will either fail or use the wrong
> pc file.
> 
> Signed-off-by: Jussi Kukkonen <jussi.kukkonen at intel.com>
> ---
> 
> 
> Changes since v1:
> * Set both HAVE_SYSTEMD_DAEMON and REQUIRED_SYSTEMD_DAEMON inside
>   the PKG_CHECK_MODULES as per Emils review. Note that I don't think
>   his version with commas works -- but it's autoconf so not betting
>   any money on that.
> * Check for libsystemd first: it should be preferred over the wrapper
> 
> Cheers,
>   Jussi
> 
> 
>  configure.ac | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 14a5bb8..bfc7b2e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -786,7 +786,7 @@ APPLEWMPROTO="applewmproto >= 1.4"
>  LIBXSHMFENCE="xshmfence >= 1.1"
>  
>  dnl Required modules
> -XPROTO="xproto >= 7.0.28"
> +XPROTO="xproto >= 7.0"
>  RANDRPROTO="randrproto >= 1.5.0"
>  RENDERPROTO="renderproto >= 0.11"
>  XEXTPROTO="xextproto >= 7.2.99.901"

Is this hunk intended to be here?

> @@ -836,10 +836,14 @@ 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])])
> +PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
> +                  [HAVE_SYSTEMD_DAEMON=yes
> +                   REQUIRED_SYSTEMD_DAEMON=libsystemd],
> +                  [PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
> +                                     [HAVE_SYSTEMD_DAEMON=yes
> +                                      REQUIRED_SYSTEMD_DAEMON=libsystemd-daemon],
> +                                     [HAVE_SYSTEMD_DAEMON=no])])
> +
>  if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
>  	WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
>  fi
> @@ -848,7 +852,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 $REQUIRED_SYSTEMD_DAEMON"
>  fi
>  AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])

I think the source issue here is something different anyway.
REQUIRED_LIBS is for server-wide libraries required virtually everywhere.
the systemd bits are fairly selective and narrow, so step one should be
removing it out of REQUIRED_LIBS and hooking it up to those Makefile.am
cflags where it is required.

Cheers,
   Peter


More information about the xorg-devel mailing list