Commit 297d5556 authored by DJ Lucas's avatar DJ Lucas

Add elogind support

parent 0e541b10
Pipeline #12771 passed with stage
in 1 minute and 33 seconds
......@@ -574,6 +574,7 @@ AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg
AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
AC_ARG_ENABLE(linux_acpi, AS_HELP_STRING([--disable-linux-acpi], [Disable building ACPI support on Linux (if available).]), [enable_linux_acpi=$enableval], [enable_linux_acpi=yes])
AC_ARG_ENABLE(linux_apm, AS_HELP_STRING([--disable-linux-apm], [Disable building APM support on Linux (if available).]), [enable_linux_apm=$enableval], [enable_linux_apm=yes])
AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind], [Build elogind support (default: auto)]), [ELOGIND_LOGIND=$enableval], [ELOGIND_LOGIND=auto])
AC_ARG_ENABLE(systemd-logind, AS_HELP_STRING([--enable-systemd-logind], [Build systemd-logind support (default: auto)]), [SYSTEMD_LOGIND=$enableval], [SYSTEMD_LOGIND=auto])
AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid-root wrapper for legacy driver support on rootless xserver systems (default: no)]), [SUID_WRAPPER=$enableval], [SUID_WRAPPER=no])
......@@ -898,6 +899,27 @@ if test "x$CONFIG_HAL" = xyes; then
fi
AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
PKG_CHECK_MODULES(ELOGIND, [libelogind >= 209], [HAVE_ELOGIND=yes], [HAVE_ELOGIND=no])
if test "x$ELOGIND_LOGIND" = xauto; then
if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes -a "x$HAVE_ELOGIND" = xyes; then
ELOGIND_LOGIND=yes
else
ELOGIND_LOGIND=no
fi
fi
if test "x$ELOGIND_LOGIND" = xyes; then
if ! test "x$HAVE_DBUS" = xyes; then
AC_MSG_ERROR([elogind requested, but D-Bus is not installed.])
fi
if ! test "x$CONFIG_UDEV" = xyes ; then
AC_MSG_ERROR([elogind is only supported in combination with udev configuration.])
fi
AC_DEFINE(ELOGIND_LOGIND, 1, [Enable elogind integration])
NEED_DBUS="yes"
fi
AM_CONDITIONAL(ELOGIND_LOGIND, [test "x$ELOGIND_LOGIND" = xyes])
if test "x$SYSTEMD_LOGIND" = xauto; then
if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
SYSTEMD_LOGIND=yes
......
......@@ -1001,7 +1001,7 @@ xf86_find_platform_device_by_devnum(int major, int minor)
return NULL;
}
#ifdef SYSTEMD_LOGIND
#if defined(SYSTEMD_LOGIND) || defined(ELOGIND_LOGIND)
void
systemd_logind_vtenter(void)
{
......
......@@ -24,6 +24,11 @@ LOGIND_SRCS = systemd-logind.c
XORG_CFLAGS += $(DBUS_CFLAGS)
endif
if ELOGIND_LOGIND
LOGIND_SRCS = systemd-logind.c
XORG_CFLAGS += $(DBUS_CFLAGS)
endif
liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \
lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \
$(srcdir)/../shared/VTsw_usl.c \
......
......@@ -418,6 +418,9 @@
/* Enable systemd-logind integration */
#undef SYSTEMD_LOGIND 1
/* Enale elogind integration */
#undef ELOGIND_LOGIND 1
/* Have a monotonic clock from clock_gettime() */
#undef MONOTONIC_CLOCK
......
......@@ -87,6 +87,7 @@ conf_data.set('CONFIG_UDEV', build_udev)
conf_data.set('CONFIG_UDEV_KMS', build_udev)
conf_data.set('HAVE_DBUS', build_dbus)
conf_data.set('CONFIG_HAL', build_hal)
conf_data.set('ELOGIND_LOGIND', build_systemd_logind)
conf_data.set('SYSTEMD_LOGIND', build_systemd_logind)
conf_data.set('NEED_DBUS', build_systemd_logind or build_hal)
conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd')
......
......@@ -26,7 +26,7 @@
#ifndef SYSTEMD_LOGIND_H
#define SYSTEMD_LOGIND_H
#ifdef SYSTEMD_LOGIND
#if defined(SYSTEMD_LOGIND) || defined(ELOGIND_LOGIND)
int systemd_logind_init(void);
void systemd_logind_fini(void);
int systemd_logind_take_fd(int major, int minor, const char *path, Bool *paus);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment