1*5a8173caSflorian# macros for configuring systemd 2*5a8173caSflorian# Copyright 2015, Sami Kerola, CloudFlare. 3*5a8173caSflorian# BSD licensed. 4*5a8173caSflorianAC_ARG_ENABLE([systemd], 5*5a8173caSflorian [AS_HELP_STRING([--enable-systemd], [compile with systemd support])], 6*5a8173caSflorian [], [enable_systemd=no]) 7*5a8173caSflorianhave_systemd=no 8*5a8173caSflorianAS_IF([test "x$enable_systemd" != xno], [ 9*5a8173caSflorian ifdef([PKG_CHECK_MODULES], [ 10*5a8173caSflorian dnl systemd v209 or newer 11*5a8173caSflorian PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no]) 12*5a8173caSflorian dnl old systemd library 13*5a8173caSflorian AS_IF([test "x$have_systemd" != "xyes"], [ 14*5a8173caSflorian PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], 15*5a8173caSflorian [have_systemd_daemon=yes], [have_systemd_daemon=no]) 16*5a8173caSflorian AS_IF([test "x$have_systemd_daemon" = "xyes"], 17*5a8173caSflorian [have_systemd=yes]) 18*5a8173caSflorian ]) 19*5a8173caSflorian AS_CASE([$enable_systemd:$have_systemd], 20*5a8173caSflorian [yes:no], 21*5a8173caSflorian [AC_MSG_ERROR([systemd enabled but libsystemd not found])], 22*5a8173caSflorian [*:yes], 23*5a8173caSflorian [AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd should be used]) 24*5a8173caSflorian LIBS="$LIBS $SYSTEMD_LIBS" 25*5a8173caSflorian ] 26*5a8173caSflorian ) 27*5a8173caSflorian ], [ 28*5a8173caSflorian AC_MSG_ERROR([systemd enabled but need pkg-config to configure for it, also, run aclocal before autoconf, or run autoreconf to include pkgconfig macros]) 29*5a8173caSflorian ]) 30*5a8173caSflorian]) 31