################################################################################
################################################################################
GD_SOURCE = libgd-$(GD_VERSION).tar.xz
GD_SITE = https://bitbucket.org/libgd/gd-libgd/downloads
GD_LICENSE_FILES = COPYING
GD_CONFIG_SCRIPTS = gdlib-config
GD_CONF_OPTS = --without-x --disable-rpath
GD_DEPENDENCIES = host-pkgconf
# 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"
ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
GD_DEPENDENCIES += fontconfig
GD_CONF_OPTS += --with-fontconfig
ifeq ($(BR2_PACKAGE_FREETYPE),y)
GD_DEPENDENCIES += freetype
GD_CONF_OPTS += --with-freetype=$(STAGING_DIR)/usr
GD_CONF_OPTS += --without-freetype
ifeq ($(BR2_PACKAGE_LIBICONV),y)
GD_DEPENDENCIES += libiconv
# not strictly needed for gd, but ensures -liconv ends up in
# gdlib-config --libs output
GD_CONF_ENV += LIBS="-liconv"
ifeq ($(BR2_PACKAGE_JPEG),y)
GD_CONF_OPTS += --with-jpeg
ifeq ($(BR2_PACKAGE_LIBPNG),y)
GD_DEPENDENCIES += libpng
GD_CONF_OPTS += --with-png
GD_CONF_OPTS += --without-png
ifeq ($(BR2_PACKAGE_WEBP),y)
GD_CONF_OPTS += --with-webp
GD_CONF_OPTS += --without-webp
ifeq ($(BR2_PACKAGE_TIFF),y)