]>
Commit | Line | Data |
---|---|---|
d4bb55ac AM |
1 | From c26cd1cb6a60ff196ef13c00e82576d3bfeb2e30 Mon Sep 17 00:00:00 2001 |
2 | From: Alex Rousskov <rousskov@measurement-factory.com> | |
3 | Date: Thu, 23 Apr 2020 05:56:35 -0600 | |
4 | Subject: [PATCH] Bug 5041: Missing Debug::Extra breaks build on hosts with | |
5 | systemd (#611) | |
6 | ||
7 | * Bug 5041: Missing Debug::Extra breaks build on hosts with systemd | |
8 | ||
9 | Master commit 6fa8c66 (i.e. Bug 5016 fix) relied on Debug::Extra added | |
10 | by master commit (ccfbe8f) that was not ported to v4. The port of the | |
11 | former master commit lacked the required piece of the latter commit. | |
12 | ||
13 | The problem is invisible on hosts without a systemd package (that Squid | |
14 | can find/use) and with Squids explicitly ./configured --without-systemd. | |
15 | ||
16 | * "Minimum features" build test should be --without-systemd | |
17 | ||
18 | * LDFLAGS were missing SYSTEMD_LIBS in builds with systemd support | |
19 | ||
20 | Co-authored-by: Amos Jeffries <yadij@users.noreply.github.com> | |
21 | --- | |
22 | configure.ac | 1 + | |
23 | src/Debug.h | 4 ++++ | |
24 | test-suite/buildtests/layer-01-minimal.opts | 1 + | |
25 | 3 files changed, 6 insertions(+) | |
26 | ||
27 | diff --git a/configure.ac b/configure.ac | |
28 | index 9d1a38c4f8..281d237bc5 100644 | |
29 | --- a/configure.ac | |
30 | +++ b/configure.ac | |
31 | @@ -2162,6 +2162,7 @@ if test "x$with_systemd" != "xno" -a "x$squid_host_os" = "xlinux"; then | |
32 | fi | |
33 | if test "x$SYSTEMD_LIBS" != "x" ; then | |
34 | CXXFLAGS="$SYSTEMD_CFLAGS $CXXFLAGS" | |
35 | + LDFLAGS="$SYSTEMD_LIBS $LDFLAGS" | |
36 | AC_DEFINE(USE_SYSTEMD,1,[systemd support is available]) | |
37 | else | |
38 | with_systemd=no | |
39 | diff --git a/src/Debug.h b/src/Debug.h | |
40 | index 6eecd01bf9..ddd9e38f8f 100644 | |
41 | --- a/src/Debug.h | |
42 | +++ b/src/Debug.h | |
43 | @@ -99,6 +99,10 @@ class Debug | |
44 | ||
45 | /// configures the active debugging context to write syslog ALERT | |
46 | static void ForceAlert(); | |
47 | + | |
48 | + /// prefixes each grouped debugs() line after the first one in the group | |
49 | + static std::ostream& Extra(std::ostream &os) { return os << "\n "; } | |
50 | + | |
51 | private: | |
52 | static Context *Current; ///< deepest active context; nil outside debugs() | |
53 | }; | |
54 |