[weston v2] configure.ac: Add support for new versions of systemd

sardemff7+wayland at sardemff7.net sardemff7+wayland at sardemff7.net
Fri Mar 13 01:25:49 PDT 2015


On 2015-03-13 01:56, Javier Jardón wrote:
> ... that only provide a unique libsystemd.pc file
> ---
>   configure.ac | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index d9d8d8f..5f2cbc1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -341,14 +341,21 @@ 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 >= 198],
> +                  [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])
> +PKG_CHECK_MODULES([SYSTEMD_LOGIN_209],
> +                  [libsystemd >= 209],
> +                  [have_systemd_login_209=yes],
> +                  [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])])
>
>

 From systemd 209[1], libsystemd-login is in libsystemd. The compatibility pkg-config file just makes you link against libsystemd, so checking for libsystemd >= 209 is enough.

Also, the checks should be the other way around: first, see if libsystemd >= 209 is there, then fallback to libsystemd-login >= 189.

So:


PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd >= 209],

                   [have_systemd_login_209=yes
                    have_systemd_login=yes],
                   [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")
AS_IF([test "x$have_systemd_login_209" = "xyes"],
       [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])


[1] http://cgit.freedesktop.org/systemd/systemd/tree/src/compat-libs/libsystemd-login.pc.in?id=v209

-- 

Quentin “Sardem FF7” Glidic


More information about the wayland-devel mailing list