[PATCH xserver v2 4/5] configure.ac: enable systemd socket activation in libxtrans

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 9 22:28:55 PDT 2013


On Tue, Jul 09, 2013 at 04:24:46PM +0200, Łukasz Stelmach wrote:
 ---
>  configure.ac |   32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 89a7a9d..ab9dc0d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -832,6 +832,38 @@ AC_SUBST(SDK_REQUIRED_MODULES)
>  
>  REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES"
>  
> +#
> +# systemd socket activation
> +#
> +# activate the code in libxtrans that grabs sockets' file-descriptors
> +# instead of creating them.
> +#
> +AC_ARG_WITH([systemd],
> +	AS_HELP_STRING([--with-systemd], [support systemd socket activation]),
> +	[], [with_systemd=check])
> +have_systemd=check
> +if test "x$with_systemd" != "xno"; then
> +	PKG_CHECK_MODULES([systemd], [libsystemd-daemon],
> +		[AC_DEFINE(HAVE_SYSTEMD, 1, [Define if libsystemd-daemon is available])
> +		have_systemd=yes;],
> +		[have_systemd=no])
> +	if test "x$with_systemd" = "xyes" -a "x$have_systemd" = "xno"; then
> +		AC_MSG_ERROR([systemd support requested but no library has been found])
> +	fi
> +fi
> +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"])
> +if test "x$have_systemd" = "xyes"; then
> +	SAVE_LIBS=$LIBS
> +	SAVE_CFLAGS=$CFLAGS
> +	CFLAGS="$systemd_CFLAGS -DHAVE_SYSTEMD"

is HAVE_SYSTEMD really needed here?

> +	LIBS="$systemd_LIBS"
> +	AC_CHECK_FUNCS([sd_listen_fds], [], [AC_MSG_ERROR([sd_listen_fds() is missing from libsystemd-daemon])])

what version of systemd provides sd_listen_fds() and can we just require
this version? quick git log shows this has been in for ages, has something
changed here recently?

> +	LIBS=$SAVE_LIBS
> +	CFLAGS="$SAVE_CFLAGS"
> +	XSERVER_CFLAGS="$XSERVER_CFLAGS -DHAVE_SYSTEMD"

HAVE_SYSTEMD shouldn't be necessary, the AC_DEFINE should take care of that.

Cheers,
   Peter

> +	REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
> +fi

> +
>  if test "x$CONFIG_UDEV" = xyes &&
>   { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then
>  	AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed])
> -- 
> 1.7.9.5
> 


More information about the xorg-devel mailing list