mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 18:05:39 +00:00
build: Require dbus for systemd-login
systemd-login support requires dbus (see "dbus.h" header in "launcher-logind.c") but the configure script was only checking libsystemd-login availability to define the HAVE_SYSTEMD_LOGIN macro, which results in undefined symbols in launcher-unit. Put the systemd-login checks after the dbus ones, and only run the checks if it is present. Also mention dbus in the error message if "--enable-systemd-login" was forced. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
parent
bbde643ecd
commit
f989c38a5e
66
configure.ac
66
configure.ac
|
@ -398,38 +398,6 @@ 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])])
|
||||
|
||||
AC_ARG_ENABLE(systemd-login,
|
||||
AS_HELP_STRING([--enable-systemd-login],
|
||||
[Enable logind support]),,
|
||||
enable_systemd_login=auto)
|
||||
if test x$enable_systemd_login != xno; then
|
||||
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])
|
||||
])
|
||||
else
|
||||
have_systemd_login=no
|
||||
fi
|
||||
|
||||
if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
|
||||
AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209 or libsystemd-login])
|
||||
fi
|
||||
|
||||
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])])
|
||||
|
||||
AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
|
||||
AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
|
||||
if test x$enable_weston_launch == xyes; then
|
||||
|
@ -502,6 +470,40 @@ if test "x$enable_dbus" != "xno"; then
|
|||
fi
|
||||
AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
|
||||
|
||||
# systemd-login support
|
||||
AC_ARG_ENABLE(systemd-login,
|
||||
AS_HELP_STRING([--enable-systemd-login],
|
||||
[Enable logind support]),,
|
||||
enable_systemd_login=auto)
|
||||
if test x$enable_systemd_login != xno -a x$have_dbus != xno; then
|
||||
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])
|
||||
])
|
||||
else
|
||||
have_systemd_login=no
|
||||
fi
|
||||
|
||||
if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
|
||||
AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209, libsystemd-login or dbus])
|
||||
fi
|
||||
|
||||
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])])
|
||||
|
||||
|
||||
# Note that other features might want libxml2, or this feature might use
|
||||
# alternative xml libraries at some point. Therefore the feature and
|
||||
# pre-requisite concepts are split.
|
||||
|
|
Loading…
Reference in a new issue