Allow to remove systemd library
[src/app-framework-binder.git] / src / main-afb-daemon.c
index a85ffc0..705c69f 100644 (file)
@@ -36,7 +36,9 @@
 
 #include <json-c/json.h>
 
-#include <systemd/sd-daemon.h>
+#if WITH_SYSTEMD
+#   include <systemd/sd-daemon.h>
+#endif
 
 #include "afb-args.h"
 #include "afb-hswitch.h"
@@ -835,9 +837,11 @@ static void start(int signum, void *arg)
 
        /* load bindings and apis */
        afb_debug("start-load");
+#if WITH_DYNAMIC_BINDING
        apiset_start_list("binding", afb_api_so_add_binding, "the binding");
        apiset_start_list("ldpaths", afb_api_so_add_pathset_fails, "the binding path set");
        apiset_start_list("weak-ldpaths", afb_api_so_add_pathset_nofails, "the weak binding path set");
+#endif
        apiset_start_list("auto-api", afb_autoset_add_any, "the automatic api path set");
 #if WITH_DBUS_TRANSPARENCY
        apiset_start_list("dbus-client", afb_api_dbus_add_client, "the afb-dbus client");
@@ -883,7 +887,9 @@ static void start(int signum, void *arg)
                goto error;
 
        /* ready */
+#if WITH_SYSTEMD
        sd_notify(1, "READY=1");
+#endif
 
        /* activate the watchdog */
 #if HAS_WATCHDOG