[PATCH weston] configure.ac: add support for new versions of systemd

Frederico Cadete frederico at cadete.eu
Mon Jul 13 09:07:35 PDT 2015


On Mon, Jul 13, 2015 at 12:14 PM, Quentin Glidic
<sardemff7+wayland at sardemff7.net> wrote:
> On 2015-07-12 22:15, Frederico Cadete wrote:
>> Starting from systemd version 209, a single libsystemd.pc is provided.
>> For previous versions, fall back on libsystemd-login.pc.
>>
>> Signed-off-by: Frederico Cadete <frederico at cadete.eu>
>
> LGTM
> Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>

Thanks!

>
> It is optional, but if you want to make a follow-up commit to add a
> configure switch for that, it would be perfect.
>

I thought of doing that, but can't think of a way to do it without
breaking someone's build.

Currently, weston enables sd-login if it finds the corresponding .pc,
and disables it if not. If I add a --enable-sd-login/--disable-sd-login,
I see two choices:

- Make --enable-sd-login the default. The build will fail if it does not
  find libsystemd. People who don't have it will have to add --disable-sd-login
  when calling configure.
- Make --disable-sd-login the default. This will silently change the
  builds of people who had libsystemd and expect it to come enabled.

I am leaning for the first option, because the breakage is louder.

Am I missing some way to do this better?

>
>> ---
>>  configure.ac | 17 +++++++++++++----
>>  1 file changed, 13 insertions(+), 4 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 404418e..5714c1c 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -343,14 +343,23 @@ AC_ARG_ENABLE(resize-optimization,
>>  AS_IF([test "x$enable_resize_optimization" = "xyes"],
>>        [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
>>
>> -PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198],
>> -                  [have_systemd_login=yes], [have_systemd_login=no])
>> +PKG_CHECK_MODULES(SYSTEMD_LOGIN,
>> +                  [libsystemd >= 209],
>> +                  [have_systemd_login_209=yes;have_systemd_login=yes],
>> +                  [have_systemd_login_209=no;have_systemd_login=no])
>> +
>> +# Older versions of systemd package systemd-login separately. Fall back on that
>> +AS_IF([test x$have_systemd_login != xyes],[
>> +      PKG_CHECK_MODULES(SYSTEMD_LOGIN,
>> +                        [libsystemd-login >= 198],
>> +                        [have_systemd_login=yes],
>> +                        [have_systemd_login=no])
>> +      ])
>> +
>>  AS_IF([test "x$have_systemd_login" = "xyes"],
>>        [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
>>  AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
>>
>> -PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209],
>> -                  [have_systemd_login_209=yes], [have_systemd_login_209=no])
>>  AS_IF([test "x$have_systemd_login_209" = "xyes"],
>>        [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
>>
>>
>
>
> --
>
> Quentin “Sardem FF7” Glidic

Regards,
Frederico Cadete


More information about the wayland-devel mailing list