summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config-scripts/cups-startup.m419
-rw-r--r--packaging/cups.spec.in1
-rw-r--r--scheduler/log.c2
3 files changed, 19 insertions, 3 deletions
diff --git a/config-scripts/cups-startup.m4 b/config-scripts/cups-startup.m4
index 2aeeac16e..223cf2bde 100644
--- a/config-scripts/cups-startup.m4
+++ b/config-scripts/cups-startup.m4
@@ -56,18 +56,33 @@ if test x$enable_systemd != xno; then
AC_MSG_ERROR(Need pkg-config to enable systemd support.)
fi
else
+ have_systemd=no
AC_MSG_CHECKING(for libsystemd)
if $PKGCONFIG --exists libsystemd; then
AC_MSG_RESULT(yes)
+ have_systemd=yes
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
+ elif $PKGCONFIG --exists libsystemd-daemon; then
+ AC_MSG_RESULT(yes - legacy)
+ have_systemd=yes
+ ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
+ ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
+
+ if $PKGCONFIG --exists libsystemd-journal; then
+ ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
+ ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ if test $have_systemd = yes; then
AC_DEFINE(HAVE_SYSTEMD)
AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
if test "x$SYSTEMD_DIR" = x; then
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
fi
- else
- AC_MSG_RESULT(no)
fi
fi
fi
diff --git a/packaging/cups.spec.in b/packaging/cups.spec.in
index b6e48a32d..481e20cfc 100644
--- a/packaging/cups.spec.in
+++ b/packaging/cups.spec.in
@@ -21,6 +21,7 @@
# dnssd - Enable/disable DNS-SD support (default = enable)
# libusb1 - Enable/disable LIBUSB 1.0 support (default = enable)
# static - Enable/disable static libraries (default = enable)
+# systemd - Enable/disable systemd support (default = enable)
%{!?_with_dbus: %{!?_without_dbus: %define _with_dbus --with-dbus}}
%{?_with_dbus: %define _dbus --enable-dbus}
diff --git a/scheduler/log.c b/scheduler/log.c
index c4ef0329f..fce8797c8 100644
--- a/scheduler/log.c
+++ b/scheduler/log.c
@@ -637,7 +637,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */
#elif defined(HAVE_SYSTEMD_SD_JOURNAL_H)
if (!strcmp(ErrorLog, "syslog"))
{
- cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest)) : NULL) : NULL;
+ cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL;
static const char * const job_states[] =
{ /* job-state strings */
"Pending",