From b2eca4e1cc89f0468aad579d0fd4b0f2ef6d34de Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 24 Oct 2017 19:55:36 +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 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` -- cgit v1.2.3