aboutsummaryrefslogtreecommitdiff
path: root/systemd.m4
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2018-05-12 11:49:30 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2018-05-12 11:49:30 +0000
commitfbdb9ac866a647da0919b224f05cca039afc02fa (patch)
treea4ddb15b51a795c9f985e693a04d992a94f4f455 /systemd.m4
parent31f8d531e1359c7acd82cff9ab798cdeac277adc (diff)
downloadsrc-fbdb9ac866a647da0919b224f05cca039afc02fa.tar.gz
src-fbdb9ac866a647da0919b224f05cca039afc02fa.zip
Vendor import of Unbound 1.6.1.vendor/unbound/1.6.1
Notes
Notes: svn path=/vendor/unbound/dist/; revision=333529 svn path=/vendor/unbound/1.6.1/; revision=333530; tag=vendor/unbound/1.6.1
Diffstat (limited to 'systemd.m4')
-rw-r--r--systemd.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/systemd.m4 b/systemd.m4
new file mode 100644
index 000000000000..e5d4e27f6deb
--- /dev/null
+++ b/systemd.m4
@@ -0,0 +1,31 @@
+# macros for configuring systemd
+# Copyright 2015, Sami Kerola, CloudFlare.
+# BSD licensed.
+AC_ARG_ENABLE([systemd],
+ [AS_HELP_STRING([--enable-systemd], [compile with systemd support])],
+ [], [enable_systemd=no])
+have_systemd=no
+AS_IF([test "x$enable_systemd" != xno], [
+ ifdef([PKG_CHECK_MODULES], [
+ dnl systemd v209 or newer
+ PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
+ dnl old systemd library
+ AS_IF([test "x$have_systemd" != "xyes"], [
+ PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
+ [have_systemd_daemon=yes], [have_systemd_daemon=no])
+ AS_IF([test "x$have_systemd_daemon" = "xyes"],
+ [have_systemd=yes])
+ ])
+ AS_CASE([$enable_systemd:$have_systemd],
+ [yes:no],
+ [AC_MSG_ERROR([systemd enabled but libsystemd not found])],
+ [*:yes],
+ [AC_DEFINE([HAVE_SYSTEMD], [1], [Define to 1 if systemd should be used])
+ LIBS="$LIBS $SYSTEMD_LIBS"
+ ]
+ )
+ ], [
+ AC_MSG_ERROR([systemd enabled but need pkg-config to configure for it])
+ ])
+])
+AM_CONDITIONAL([USE_SYSTEMD], [test "x$have_systemd" = xyes])