aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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