diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-06 11:53:45 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-10-06 11:53:45 +0200 |
commit | 2c6c3adc1871735f72eb48bda3fdf600d79b6d0a (patch) | |
tree | 313521fc1b4112c2a2a9b0ce37395b1355f193b8 | |
parent | c21840eac4a4147e0eca930d8814ab6569cc1262 (diff) | |
download | ayatana-indicator-application-2c6c3adc1871735f72eb48bda3fdf600d79b6d0a.tar.gz ayatana-indicator-application-2c6c3adc1871735f72eb48bda3fdf600d79b6d0a.tar.bz2 ayatana-indicator-application-2c6c3adc1871735f72eb48bda3fdf600d79b6d0a.zip |
Make systemd optional. If systemd is not available at build-time, the creation of the .service file is omitted.
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | data/Makefile.am | 4 |
2 files changed, 15 insertions, 3 deletions
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 diff --git a/data/Makefile.am b/data/Makefile.am index f7cc652..96abc17 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -16,11 +16,13 @@ xdg_autostart_DATA = ayatana-indicator-application.desktop overridedir = $(pkgdatadir) override_DATA = ordering-override.keyfile +#if defined(HAVE_SYSTEMD) %.service: %.service.in $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ - + systemddir = $(SYSTEMD_USERDIR) systemd_DATA = ayatana-indicator-application.service +#endif upstartsystemdoverridedir = $(datadir)/upstart/systemd-session/upstart upstartsystemdoverride_DATA = ayatana-indicator-application.override |