From 560ac2c8e71eabdad0c2fe0fba2be4a0b8ae4eb1 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Mon, 3 Jul 2017 18:21:21 +0900 Subject: [PATCH] e_main: added sd_notify for sending start-up notification, since ecore_main_loop_begin in the efl doesn't call that API any longer. Change-Id: Ie60648ef0f84472927d36ee81d4ec00a2d88b851 --- configure.ac | 28 ++++++++++++++++++++++++++++ packaging/enlightenment.spec | 1 + src/bin/Makefile.mk | 6 ++++++ src/bin/e_main.c | 9 +++++++++ 4 files changed, 44 insertions(+) diff --git a/configure.ac b/configure.ac index f6fb539..4767cf2 100755 --- a/configure.ac +++ b/configure.ac @@ -490,6 +490,34 @@ AM_CONDITIONAL([HAVE_HWC], [test "x${have_hwc}" = "xyes"]) #pixman PKG_CHECK_MODULES([PIXMAN], [pixman-1]) +# Check for systemd +want_systemd="yes" +AC_ARG_ENABLE([systemd], + [AS_HELP_STRING([--disable-systemd], [disable systemd @<:@default=enabled@:>@])], + [ + if test "x${enableval}" = "xyes"; then + want_systemd="yes" + else + want_systemd="no" + fi + ]) +AC_MSG_CHECKING([whether systemd is enabled]) +AC_MSG_RESULT([${want_systemd}]) + +have_systemd="no" +if test "x$want_systemd" = "xyes"; then + PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209], + [ + have_systemd="yes" + AC_DEFINE_UNQUOTED([HAVE_SYSTEMD], [1], [enable systemd support]) + ]) +else + have_systemd="no" +fi + +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x${have_systemd}" = "xyes"]) + + #capi-system-device PKG_CHECK_MODULES([CAPI_SYSTEM_DEVICE], [capi-system-device]) diff --git a/packaging/enlightenment.spec b/packaging/enlightenment.spec index 2ed77d1..518e28a 100755 --- a/packaging/enlightenment.spec +++ b/packaging/enlightenment.spec @@ -46,6 +46,7 @@ BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-creds-socket) BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(pixman-1) +BuildRequires: systemd-devel Requires: libwayland-extension-server %if "%{LIBGOMP}" == "use" Requires: libgomp diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index dde4c3f..fd3d5a4 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -218,6 +218,9 @@ endif if HAVE_HWC src_bin_enlightenment_CPPFLAGS += @HWC_CFLAGS@ endif +if HAVE_SYSTEMD +src_bin_enlightenment_CPPFLAGS += @SYSTEMD_CFLAGS@ +endif src_bin_enlightenment_SOURCES = \ src/bin/e_main.c \ @@ -234,6 +237,9 @@ endif if HAVE_HWC src_bin_enlightenment_LDADD += @HWC_LIBS@ endif +if HAVE_SYSTEMD +src_bin_enlightenment_LDFLAGS += @SYSTEMD_LIBS@ +endif src_bin_enlightenment_info_SOURCES = \ src/bin/e.h \ diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 716829e..dc02cab 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -2,6 +2,9 @@ #ifdef __linux__ # include #endif +#ifdef HAVE_SYSTEMD +# include +#endif #define MAX_LEVEL 80 @@ -719,6 +722,12 @@ main(int argc, char **argv) TRACE_DS_END(); +#ifdef HAVE_SYSTEMD + TS("[WM] Send start-up completion"); + sd_notify(0, "READY=1"); +#else + TS("[WM] Skip sending start-up completion. (no systemd)"); +#endif ecore_main_loop_begin(); inloop = EINA_FALSE; -- 2.7.4