e_main: added sd_notify for sending start-up notification, 83/136883/3
authorGwanglim Lee <gl77.lee@samsung.com>
Mon, 3 Jul 2017 09:21:21 +0000 (18:21 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 3 Jul 2017 09:24:33 +0000 (18:24 +0900)
since ecore_main_loop_begin in the efl doesn't call that API any longer.

Change-Id: Ie60648ef0f84472927d36ee81d4ec00a2d88b851

configure.ac
packaging/enlightenment.spec
src/bin/Makefile.mk
src/bin/e_main.c

index f6fb539..4767cf2 100755 (executable)
@@ -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])
index 2ed77d1..518e28a 100755 (executable)
@@ -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
index dde4c3f..fd3d5a4 100644 (file)
@@ -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 \
index 716829e..dc02cab 100644 (file)
@@ -2,6 +2,9 @@
 #ifdef __linux__
 # include <sys/prctl.h>
 #endif
+#ifdef HAVE_SYSTEMD
+# include <systemd/sd-daemon.h>
+#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;