Skip to content
Snippets Groups Projects
Commit 7dceac31 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

configure: detect systemd-journal library

refs #273
parent 2b73508d
No related branches found
No related tags found
1 merge request!262systemd journal logging support
......@@ -81,18 +81,18 @@ AM_CONDITIONAL([FAST_PARSER], [test "$enable_fastparser" = yes])
# Systemd integration
AC_ARG_ENABLE([systemd],
AS_HELP_STRING([--enable-systemd=auto|yes|no], [enable systemd notification mechanism [default=auto]]),
AS_HELP_STRING([--enable-systemd=auto|yes|no], [enable systemd integration [default=auto]]),
[enable_systemd="$enableval"], [enable_systemd=auto])
case "$enable_systemd" in
auto) PKG_CHECK_MODULES([systemd_daemon], [libsystemd-daemon], [enable_systemd=yes], [enable_systemd=no]) ;;
yes) PKG_CHECK_MODULES([systemd_daemon], [libsystemd-daemon]) ;;
auto) PKG_CHECK_MODULES([systemd], [libsystemd-daemon libsystemd-journal], [enable_systemd=yes], [enable_systemd=no]) ;;
yes) PKG_CHECK_MODULES([systemd], [libsystemd-daemon libsystemd-journal]) ;;
no) ;;
*) AC_MSG_ERROR([Invalid value of --enable-systemd.]) ;;
esac
if test "$enable_systemd" = yes; then
AC_DEFINE([ENABLE_SYSTEMD_NOTIFY], [1], [Use systemd notifications.])
AC_DEFINE([ENABLE_SYSTEMD], [1], [Use systemd integration.])
fi
# Debug modules
......@@ -404,7 +404,7 @@ AC_MSG_RESULT([
Fast zone parser: ${enable_fastparser}
Utilities with IDN: ${with_libidn}
Systemd notifications: ${enable_systemd}
Systemd integration: ${enable_systemd}
Dnstap support: ${opt_dnstap}
Code coverage: ${enable_code_coverage}
......
......@@ -325,8 +325,8 @@ libknotus_la_CFLAGS = $(libidn_CFLAGS)
# sbin programs
knotd_LDADD = libknot.la libknotd.la
knotd_CPPFLAGS = $(AM_CPPFLAGS) $(systemd_daemon_CFLAGS)
knotd_LDFLAGS = $(AM_LDFLAGS) $(systemd_daemon_LIBS)
knotd_CPPFLAGS = $(AM_CPPFLAGS) $(systemd_CFLAGS)
knotd_LDFLAGS = $(AM_LDFLAGS) $(systemd_LIBS)
knotc_LDADD = libknot.la libknotd.la
......
......@@ -25,7 +25,7 @@
#include <cap-ng.h>
#endif /* HAVE_CAP_NG_H */
#ifdef ENABLE_SYSTEMD_NOTIFY
#ifdef ENABLE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
......@@ -46,7 +46,7 @@ static volatile short sig_stopping = 0;
/* \brief Signal started state to the init system. */
static void init_signal_started(void)
{
#ifdef ENABLE_SYSTEMD_NOTIFY
#ifdef ENABLE_SYSTEMD
sd_notify(0, "READY=1");
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment