aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-09-10 13:18:13 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-09-12 14:16:49 +0200
commit65d3cc77539c565215e067ff5447f6d1cbab21e4 (patch)
treee55b6c5a99a25c5f0981fdb8c24fc072da4bf04e /configure.ac
parent17577b7c00d4748d318034ca2babe54b8b8f769d (diff)
Install systemd services with autotools
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index aad55db9..38e6713c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,6 +279,22 @@ if test "$enable_litecell15" = "yes"; then
CPPFLAGS=$oldCPPFLAGS
fi
+# https://www.freedesktop.org/software/systemd/man/daemon.html
+AC_ARG_WITH([systemdsystemunitdir],
+ [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
+ [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
+ def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+
+ AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+ [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+ [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
+ with_systemdsystemunitdir=no],
+ [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
+ [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
+
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
@@ -307,4 +323,6 @@ AC_OUTPUT(
tests/meas/Makefile
doc/Makefile
doc/examples/Makefile
+ contrib/Makefile
+ contrib/systemd/Makefile
Makefile)