From d58ddb2c4e6534c4d3db90beb2692b67e3a9b83a Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 10 Sep 2018 13:00:44 +0200 Subject: Install systemd services with autotools Change-Id: I015ac3fbe5adc551b76bac5c15ad93d30d0d2b6e --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 54d6a83d2..c6fa9a1c0 100644 --- a/configure.ac +++ b/configure.ac @@ -157,6 +157,22 @@ AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) AC_MSG_RESULT([$enable_ext_tests]) AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") +# 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"]) @@ -183,4 +199,6 @@ AC_OUTPUT( tests/handover/Makefile doc/Makefile doc/examples/Makefile + contrib/Makefile + contrib/systemd/Makefile Makefile) -- cgit v1.2.3