]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use package-config output for -lsystemd correctly
authorNick Mathewson <nickm@torproject.org>
Tue, 6 Jan 2015 19:05:35 +0000 (14:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 6 Jan 2015 19:07:13 +0000 (14:07 -0500)
In systemd 209, they deprecated -lsystemd-daemon in favor of
-lsystemd.  So we'd better actually look at the pkg-config output,
or we'll get warnings on newer distributions.

For some as-yet-unknown-to-me reason, setting CFLAGS so early makes
it so -O2 -g doesn't get added to it later.  So, adding it myself
later.  Perhaps a better fix here can be found.

Fixes 14072; bugfix on 0.2.6.2-alpha.  Based on a patch from h.venev

changes/bug14072 [new file with mode: 0644]
configure.ac

diff --git a/changes/bug14072 b/changes/bug14072
new file mode 100644 (file)
index 0000000..c810616
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (build):
+    - Avoid warnings when building with systemd 209 or later.
+      Fixes bug 14072; bugfix on 0.2.6.2-alpha. Patch from "h.venev".
index ea8d6b601a171e6b0e1e235432fb313a376e9bd7..2c92a6c4091d1bd8e820780527ab81101e62b5b0 100644 (file)
@@ -130,7 +130,8 @@ fi
 
 if test x$have_systemd = xyes; then
     AC_DEFINE(HAVE_SYSTEMD,1,[Have systemd])
-    TOR_SYSTEMD_LIBS="-lsystemd-daemon"
+    CFLAGS="${CFLAGS} ${SYSTEMD_CFLAGS}"
+    TOR_SYSTEMD_LIBS="${SYSTEMD_LIBS}"
 fi
 AC_SUBST(TOR_SYSTEMD_LIBS)
 
@@ -1542,10 +1543,9 @@ fi
 if test "$GCC" = yes; then
   # Disable GCC's strict aliasing checks.  They are an hours-to-debug
   # accident waiting to happen.
-  CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
+  CFLAGS="$CFLAGS -Wall -fno-strict-aliasing -g -O2"
 else
-  # Autoconf sets -g -O2 by default. Override optimization level
-  # for non-gcc compilers
+  # Override optimization level for non-gcc compilers
   CFLAGS="$CFLAGS -O"
   enable_gcc_warnings=no
   enable_gcc_warnings_advisory=no