From a6f07cbb0e5f20d1033502e3e5b86fe0213e7a5a Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Fri, 7 Mar 2014 02:16:06 -0500 Subject: Add systemd .service file for redshift Add a systemd user .service file to allow users to run redshift as a daemon using systemd. Also adds a new configure option, `--with-systemduserunitdir`, which gives the install path. If set to `no`, systemd support is disabled. If not set, we use `pkg-config` to find the path. --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 550ed0f..c282e34 100644 --- a/configure.ac +++ b/configure.ac @@ -161,6 +161,25 @@ AS_IF([test "x$enable_ubuntu" != xno], [ ]) AM_CONDITIONAL([ENABLE_UBUNTU], [test "x$enable_ubuntu" != xno]) + +# Check for systemd +PKG_PROG_PKG_CONFIG +AC_MSG_CHECKING([Directory to install systemd user unit files]) +AC_ARG_WITH([systemduserunitdir], + [AS_HELP_STRING([--with-systemduserunitdir=], + [Directory for systemd user unit files])], + [], [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)]) +AS_IF([test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno], [ + AC_SUBST([systemduserunitdir], [$with_systemduserunitdir]) + AC_MSG_RESULT([$systemduserunitdir]) + enable_systemd=yes +], [ + AC_MSG_RESULT([not enabled]) + enable_systemd=no +]) +AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" != xno]) + + # Checks for header files. AC_CHECK_HEADERS([locale.h stdint.h stdlib.h string.h unistd.h signal.h]) @@ -200,4 +219,5 @@ echo " GUI: ${enable_gui} Ubuntu icons: ${enable_ubuntu} + systemd units: ${enable_systemd} ${systemduserunitdir} " -- cgit v1.2.3-70-g09d2