aboutsummaryrefslogtreecommitdiff
path: root/package/collectd
diff options
context:
space:
mode:
authorGravatar Peter Korsgaard <peter@korsgaard.com>2014-02-15 11:49:36 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-02-15 11:49:36 +0100
commit7341eb827656208690ef7f65bd50196e6e1b05f7 (patch)
treeb57f3b32428edad85c8eb7a5936a18524894e685 /package/collectd
parent4b9a294e1c332a489298ca7ce865ea5f06d69c28 (diff)
downloadbuildroot-7341eb827656208690ef7f65bd50196e6e1b05f7.tar.gz
buildroot-7341eb827656208690ef7f65bd50196e6e1b05f7.tar.bz2
collectd: fix static linking
collectd-tg indirectly uses pthread, but forgets to link with -pthread. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/collectd')
-rw-r--r--package/collectd/collectd.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index e1fc10434b..84e17cdf68 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -6,7 +6,6 @@
COLLECTD_VERSION = 5.4.1
COLLECTD_SITE = http://collectd.org/files
-COLLECTD_MAKE_OPT = LDFLAGS="$(TARGET_LDFLAGS) -lm"
COLLECTD_CONF_ENV = ac_cv_lib_yajl_yajl_alloc=yes
COLLECTD_INSTALL_STAGING = YES
COLLECTD_LICENSE = GPLv2 LGPLv2.1
@@ -22,6 +21,16 @@ COLLECTD_PLUGINS_DISABLE = amqp apple_sensors aquaero ascent dbi email \
tokyotyrant uuid varnish vserver write_mongodb write_redis \
xmms zfs_arc
+COLLECTD_LDFLAGS = $(TARGET_LDFLAGS) -lm
+
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+# collectd-tg indirectly needs pthread but doesn't link with -pthread,
+# causing static linker errors
+COLLECTD_LDFLAGS += -lpthread
+endif
+
+COLLECTD_CONF_ENV += LDFLAGS="$(COLLECTD_LDFLAGS)"
+
COLLECTD_CONF_OPT += --with-nan-emulation --with-fp-layout=nothing \
--localstatedir=/var --with-perl-bindings=no \
$(foreach p, $(COLLECTD_PLUGINS_DISABLE), --disable-$(p)) \