aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-10-24 19:55:36 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-10-24 19:55:36 +0200
commitb2eca4e1cc89f0468aad579d0fd4b0f2ef6d34de (patch)
tree8f8927075cb565a0f45815f0fd738b8ca609dc81
parent371130c883c42d8d33b07f351cdd59ef6f7acdb1 (diff)
downloadayatana-indicator-printers-b2eca4e1cc89f0468aad579d0fd4b0f2ef6d34de.tar.gz
ayatana-indicator-printers-b2eca4e1cc89f0468aad579d0fd4b0f2ef6d34de.tar.bz2
ayatana-indicator-printers-b2eca4e1cc89f0468aad579d0fd4b0f2ef6d34de.zip
Make systemd optional. If systemd is not available at build-time, the creation of the .service file is omitted.
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am2
2 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 35c1640..e89b6a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,8 +55,18 @@ CUPS_LIBS+=`$CUPS_CONFIG --libs`
SERVICE_CFLAGS="$SERVICE_CFLAGS $CUPS_CFLAGS"
SERVICE_LIBS="$SERVICE_LIBS $CUPS_LIBS"
-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-printers.service for systemd])
+fi
INDICATORDIR=`$PKG_CONFIG --variable=indicatordir ayatana-indicator3-0.4`
INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir ayatana-indicator3-0.4`
diff --git a/data/Makefile.am b/data/Makefile.am
index 450e31c..ad47d60 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST=
# the systemd unit file
#
+#if defined(HAVE_SYSTEMD)
systemddir = $(SYSTEMD_USERDIR)
systemd_DATA = ayatana-indicator-printers.service
systemd_in = $(systemd_DATA:.service=.service.in)
@@ -22,6 +23,7 @@ CLEANFILES += $(systemd_DATA)
upstart_overridedir = $(datadir)/upstart/systemd-session/upstart
upstart_override_DATA = ayatana-indicator-printers.override
EXTRA_DIST += $(upstart_override_DATA)
+#endif
#
# the upstart job file