elput: Add support for non-systemd boxes using elogind

These commits allow running efl/e wayland without installing systemd
by using elogind library to provide the needed functionality.

Merge branch 'devs/devilhorns/elput'
This commit is contained in:
Christopher Michael 2018-12-06 12:08:02 -05:00
commit b09cf2cbbc
6 changed files with 29 additions and 2 deletions

View File

@ -3934,8 +3934,22 @@ EFL_INTERNAL_DEPEND_PKG([ELPUT], [eina])
EFL_DEPEND_PKG([ELPUT], [LIBINPUT], [libinput >= 1.7.0 xkbcommon >= 0.3.0 libudev])
AC_ARG_ENABLE([elogind],
[AS_HELP_STRING([--enable-elogind],[enable elogind support.@<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_elogind="yes"
else
want_elogind="no"
fi
], [
want_elogind="yes"
])
EFL_OPTIONAL_DEPEND_PKG([ELPUT], [${want_systemd}], [SYSTEMD], [libsystemd])
EFL_OPTIONAL_DEPEND_PKG([ELPUT], [${want_elogind}], [ELOGIND], [libelogind])
EFL_ADD_FEATURE([ELPUT], [systemd-logind], [${want_systemd}])
EFL_ADD_FEATURE([ELPUT], [elogind], [${want_elogind}])
EFL_ADD_LIBS([ELPUT], [-lm])

View File

@ -333,3 +333,9 @@ option('native-arch-optimization',
value: true,
description: 'Flag for enabling architecture native optimizations'
)
option('elogind',
type : 'boolean',
value : false,
description : 'use elogind support'
)

View File

@ -1,6 +1,6 @@
#include "elput_private.h"
#ifdef HAVE_SYSTEMD
#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
static void
_logind_session_active_cb_free(void *data EINA_UNUSED, void *event)

View File

@ -2,7 +2,7 @@
static Elput_Interface *_ifaces[] =
{
#ifdef HAVE_SYSTEMD
#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
&_logind_interface,
#endif
NULL,

View File

@ -28,6 +28,10 @@
# include <systemd/sd-login.h>
# endif
# ifdef HAVE_ELOGIND
# include <elogind/sd-login.h>
# endif
#ifndef ELPUT_NODEFS
# ifdef ELPUT_DEFAULT_LOG_COLOR
# undef ELPUT_DEFAULT_LOG_COLOR

View File

@ -22,6 +22,9 @@ elput_deps += dependency('libudev')
if get_option('systemd')
elput_deps += systemd
endif
if get_option('elogind')
elput_deps += dependency('libelogind')
endif
elput_lib = library('elput',
elput_src, pub_eo_file_target,