aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--coverage/bin/Makefile2
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/afb-supervision.c4
-rw-r--r--src/main-afb-daemon.c6
4 files changed, 14 insertions, 3 deletions
diff --git a/coverage/bin/Makefile b/coverage/bin/Makefile
index 3cabefa1..b851ed6c 100644
--- a/coverage/bin/Makefile
+++ b/coverage/bin/Makefile
@@ -26,7 +26,7 @@ cflags = -I$(incdir) \
-ldl -lrt -lpthread
afb_lib_src = $(shell ls $(srcdir)/*.c | egrep -v '/afs-|/main-|-fake' )
-afb_clib_src = $(shell ls $(srcdir)/*.c | egrep -v '/afs-|/main-|-fake|afb-supervision' )
+afb_clib_src = $(shell ls $(srcdir)/*.c | egrep -v '/afs-|/main-|-fake' )
afb_daemon_srcs = $(srcdir)/main-afb-daemon.c $(afb_lib_src)
afb_daemon_defs = '-DAFB_VERSION="cov"' -DAGL_DEVEL -DWITH_MONITORING_OPTION '-DBINDING_INSTALL_DIR="fake"'
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ed59ac0c..c457d235 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,7 +54,6 @@ SET(AFB_LIB_SOURCES
afb-proto-ws.c
afb-session.c
afb-stub-ws.c
- afb-supervision.c
afb-systemd.c
afb-trace.c
afb-websock.c
@@ -90,6 +89,10 @@ IF(INCLUDE_DBUS_TRANSPARENCY)
ADD_DEFINITIONS(-DWITH_DBUS_TRANSPARENCY)
SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-api-dbus.c)
ENDIF()
+IF(INCLUDE_SUPERVISOR)
+ ADD_DEFINITIONS(-DWITH_SUPERVISION)
+ SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-supervision.c)
+ENDIF()
ADD_LIBRARY(afb-lib STATIC ${AFB_LIB_SOURCES})
diff --git a/src/afb-supervision.c b/src/afb-supervision.c
index 79a9d3fd..be823b3d 100644
--- a/src/afb-supervision.c
+++ b/src/afb-supervision.c
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#if defined(WITH_SUPERVISION)
+
#define _GNU_SOURCE
#define AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO
@@ -395,3 +398,4 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq)
}
}
+#endif
diff --git a/src/main-afb-daemon.c b/src/main-afb-daemon.c
index 49eaf61c..8be78af6 100644
--- a/src/main-afb-daemon.c
+++ b/src/main-afb-daemon.c
@@ -56,7 +56,9 @@
#include "afb-hook.h"
#include "afb-debug.h"
#include "process-name.h"
-#include "afb-supervision.h"
+#if defined(WITH_SUPERVISION)
+# include "afb-supervision.h"
+#endif
/*
if SELF_PGROUP == 0 the launched command is the group leader
@@ -577,10 +579,12 @@ static void start(int signum, void *arg)
ERROR("failed to setup monitor");
goto error;
}
+#if defined(WITH_SUPERVISION)
if (afb_supervision_init() < 0) {
ERROR("failed to setup supervision");
goto error;
}
+#endif
/* install hooks */
if (main_config->tracereq)