diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-09-10 13:39:02 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-09-12 14:17:26 +0200 |
commit | 5ac2cb3662602d347bdd329cd81c7e746f309402 (patch) | |
tree | d17d1ce27a5012a7df730243cc0a95251daac6ae /configure.ac | |
parent | f4ee021b8cb045947fcefa834547eed9b13131bc (diff) |
Install systemd services with autotools
Change-Id: Ia1a4fb62dee35737ece1f3501f352501eba2449e
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index daa8677..64e3b35 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,22 @@ PKG_CHECK_MODULES(FFTWF, fftw3f) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) + # 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([CPPFLAGS="$CPPFLAGS"]) AC_MSG_RESULT([CFLAGS="$CFLAGS"]) AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"]) @@ -247,6 +263,8 @@ AC_CONFIG_FILES([\ tests/Transceiver52M/Makefile \ doc/Makefile \ doc/examples/Makefile \ + contrib/Makefile \ + contrib/systemd/Makefile \ ]) AC_OUTPUT |