From 2c6c3adc1871735f72eb48bda3fdf600d79b6d0a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 6 Oct 2017 11:53:45 +0200 Subject: Make systemd optional. If systemd is not available at build-time, the creation of the .service file is omitted. --- configure.ac | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6bbb300..ac4b7c4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,8 +50,18 @@ PKG_CHECK_MODULES(INDICATOR, glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) PKG_CHECK_MODULES(APPINDICATOR, ayatana-appindicator3-0.1 >= $LIBAPPINDICATOR_REQUIRED_VERSION) -SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` -AC_SUBST(SYSTEMD_USERDIR) +######################### +# Check for systemd +######################### +PKG_CHECK_MODULES(SYSTEMD, systemd, + [has_systemd=yes], + [] +) +if test "x$has_systemd" = "xyes"; then + SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` + AC_SUBST(SYSTEMD_USERDIR) + AC_DEFINE(HAVE_SYSTEMD, 1, [create ayatana-indicator-application.service for systemd]) +fi ########################### # gcov coverage reporting -- cgit v1.2.3