gd: fix pthread related static linking issue for utilities
authorPeter Korsgaard <peter@korsgaard.com>
Sun, 26 Oct 2014 23:52:45 +0000 (00:52 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 26 Oct 2014 23:54:01 +0000 (00:54 +0100)
gd forgets to link utilities with -pthread even though it uses pthreads,
causing linking errors with static linking.

Fixes http://autobuild.buildroot.net/results/156/1564b8de7785c1a756bead1a4160a2b6e2a2243e/

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/gd/gd.mk

index 906c333d44c86df68bfa5c37c4bf4d2a48999993..927dfb296135b04b765c1d627d16dc46aed3db3d 100644 (file)
@@ -14,6 +14,12 @@ GD_LICENSE_FILES = COPYING
 GD_CONFIG_SCRIPTS = gdlib-config
 GD_CONF_OPTS = --without-x --disable-rpath
 
+# gd forgets to link utilities with -pthread even though it uses
+# pthreads, causing linking errors with static linking
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
+endif
+
 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
 GD_DEPENDENCIES += fontconfig
 GD_CONF_OPTS += --with-fontconfig