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

Łukasz Stelmach l.stelmach at samsung.com
Wed Jul 10 02:10:29 PDT 2013


It was <2013-07-10 śro 07:28>, when Peter Hutterer wrote:
> 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?

Apparently not much.

>> +	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?

Nothing that I know. However, during the development I found this to be
more reliable. I kept all the bits (pc files, libraries, headers) in
different directories below my $HOME. Sometimes I didn't "make install"
them. AC_CHECK_FUNCS makes sure that the library that provides the
function is available for linking and explodes with a nice error message
if it isn't.

OK, the message isn't what I really meant how about:


    sd_listen_fds() is missing or libsystemd-daemon is not available

>> +	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.

It does indeed. I just havn't been aware of include/dix-config.h
file. Somehow I have thought do-not-use-config.h is the only config.
Fixed.

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics


More information about the xorg-devel mailing list