gd: fix static build with threads
authorBaruch Siach <baruch@tkos.co.il>
Thu, 10 Apr 2014 09:34:12 +0000 (12:34 +0300)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 10 Apr 2014 20:27:20 +0000 (22:27 +0200)
Fixes:
http://autobuild.buildroot.net/results/4b4/4b4272876385cc21dd06ee946d658b8f9e225d78/

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/gd/gd.mk

index 60c1c514375c0357f145f370233239c6f3fef8c1..146ad6f9fde98399ec329ba210d386cf51977eed 100644 (file)
@@ -16,6 +16,11 @@ GD_LICENSE_FILES = COPYING
 GD_CONFIG_SCRIPTS = gdlib-config
 GD_CONF_OPT = --without-x --disable-rpath
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_PREFER_STATIC_LIB),yy)
+# add -pthread when linking executables statically
+GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
+endif
+
 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
 GD_DEPENDENCIES += fontconfig
 GD_CONF_OPT += --with-fontconfig