]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix another journald issue, and partially revert the systemd change so that
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 31 Aug 2015 15:00:45 +0000 (15:00 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 31 Aug 2015 15:00:45 +0000 (15:00 +0000)
CUPS 2.1 builds with systemd support on RHEL 7.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12857 a1ca3aef-8c08-0410-bb20-df032aa958be

config-scripts/cups-startup.m4
packaging/cups.spec.in
scheduler/log.c

index 2aeeac16e42dac235d9c5f95f6b31e40b81dabe9..223cf2bdede23e1f30233fdc388d983a0853a3bf 100644 (file)
@@ -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
index b6e48a32da3489be36fe8f794527dc7764d38def..481e20cfcc9c0d394de118da4b241dad6a1602c2 100644 (file)
@@ -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}
index c4ef0329fb4c7899cb92fa493328ba83588c898a..fce8797c84b39b703ad5556bf996a133e45f7eef 100644 (file)
@@ -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",