1 # macros for configuring systemd
2 # Copyright 2015, Sami Kerola, CloudFlare.
4 AC_ARG_ENABLE([systemd],
5 [AS_HELP_STRING([--enable-systemd], [compile with systemd support])],
6 [], [enable_systemd=no])
8 AS_IF([test "x$enable_systemd" != xno], [
9 ifdef([PKG_CHECK_MODULES], [
10 dnl systemd v209 or newer
11 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
12 dnl old systemd library
13 AS_IF([test "x$have_systemd" != "xyes"], [
14 PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
15 [have_systemd_daemon=yes], [have_systemd_daemon=no])
16 AS_IF([test "x$have_systemd_daemon" = "xyes"],
19 AS_CASE([$enable_systemd:$have_systemd],
21 [AC_MSG_ERROR([systemd enabled but libsystemd not found])],
23 [AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd should be used])
24 LIBS="$LIBS $SYSTEMD_LIBS"
28 AC_MSG_ERROR([systemd enabled but need pkg-config to configure for it])
31 AM_CONDITIONAL([USE_SYSTEMD], [test "x$have_systemd" = xyes])