aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-31 10:38:18 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-01 12:51:39 +0100
commitb29f84ff6cd4ef6a384af4fe625d4c372a34d938 (patch)
treece42919a534ffeb613b663b272baf711e9f42922 /configure.ac
parentb96c957a22e0371978a98ca9fc991f57226a8c08 (diff)
Install systemd services with autotools
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b5468ee..f885e6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,13 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
+dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
+AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
+if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
+ AC_MSG_WARN([You need to install pkg-config])
+fi
+PKG_PROG_PKG_CONFIG([0.20])
+
dnl checks for header files
AC_HEADER_STDC
@@ -52,6 +59,21 @@ then
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
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_ARG_ENABLE([external_tests],
AC_HELP_STRING([--enable-external-tests],
[Include the VTY tests in make check [default=no]]),
@@ -122,5 +144,6 @@ AC_OUTPUT(
include/osmo-pcap/Makefile
src/Makefile
contrib/Makefile
+ contrib/systemd/Makefile
tests/Makefile
Makefile)