From e2699e23f6cf0ada9cbd9f137849a6c9bad9d203 Mon Sep 17 00:00:00 2001
From: Hannu Nyman <hannu.nyman@iki.fi>
Date: Fri, 2 Oct 2015 20:31:42 +0300
Subject: [PATCH] collectd: backport parallel build fix from upstream

Backport a fix for parallel build from upstream,
where it has been commited to both trunk and 5.5 branch.

https://github.com/collectd/collectd/issues/1146
https://github.com/collectd/collectd/commit/780e6a76021a240e95007a04b723d827120afa95

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
---
 .../500-upstream-parallel-build-fix.patch       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 utils/collectd/patches/500-upstream-parallel-build-fix.patch

diff --git a/utils/collectd/patches/500-upstream-parallel-build-fix.patch b/utils/collectd/patches/500-upstream-parallel-build-fix.patch
new file mode 100644
index 000000000..a10fbbb2c
--- /dev/null
+++ b/utils/collectd/patches/500-upstream-parallel-build-fix.patch
@@ -0,0 +1,17 @@
+Backport of 780e6a76021a240e95007a04b723d827120afa95
+Subject: [PATCH] build: add libavltree, libcommon & libheap dependencies
+
+Otherwise it can break on very parallel builds since collectd link time
+arrives before one or more of these were built.
+
+--- a/src/daemon/Makefile.am
++++ b/src/daemon/Makefile.am
+@@ -49,7 +49,7 @@ collectd_CPPFLAGS =  $(AM_CPPFLAGS) $(LT
+ collectd_CFLAGS = $(AM_CFLAGS)
+ collectd_LDFLAGS = -export-dynamic
+ collectd_LDADD = libavltree.la libcommon.la libheap.la -lm
+-collectd_DEPENDENCIES =
++collectd_DEPENDENCIES = libavltree.la libcommon.la libheap.la
+ 
+ # Link to these libraries..
+ if BUILD_WITH_LIBRT