libgd: fix missing dependency, add build options 4281/head
authorVal Kulkov <val.kulkov@gmail.com>
Thu, 20 Apr 2017 01:51:18 +0000 (21:51 -0400)
committerVal Kulkov <val.kulkov@gmail.com>
Thu, 20 Apr 2017 01:51:18 +0000 (21:51 -0400)
libgd fails to build due to missing dependency if the libtiff
package is selected. Fix the build issue and add two new
configuration options, both disabled by default:
1) enable TIFF support, and
2) enable Freetype 2.x support.

Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
libs/libgd/Makefile

index dd8d1b4def50f6a07ad51c74b35501cc715b5bf4..ec4ac1c215a1c6066fc5354ecc57827b5d66b128 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgd
 PKG_VERSION:=2.2.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/gd-$(PKG_VERSION)/
@@ -27,9 +27,10 @@ include $(INCLUDE_DIR)/package.mk
 define Package/libgd
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libjpeg +libpng
+  DEPENDS:=+libjpeg +libpng +LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
   TITLE:=The GD graphics library
   URL:=http://www.libgd.org/
+  MENU:=1
 endef
 
 define Package/libgd/description
@@ -37,6 +38,23 @@ define Package/libgd/description
   programmers. GD creates PNG, JPEG and GIF images, among other formats.
 endef
 
+define Package/libgd/config
+       if PACKAGE_libgd
+               config LIBGD_TIFF
+                       bool "TIFF image support"
+                       default n
+                       help
+                               Enable TIFF image support through libtiff
+       endif
+       if PACKAGE_libgd
+               config LIBGD_FREETYPE
+                       bool "Freetype 2.x library support"
+                       default n
+                       help
+                               Enable Freetype 2.x font engine support through libfreetype
+       endif
+endef
+
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
@@ -45,12 +63,25 @@ CONFIGURE_ARGS += \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
-       --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
-       --with-vpx=no \
-       --without-xpm \
-       --without-iconv
+       --without-xpm
+
+ifdef CONFIG_LIBGD_TIFF
+       CONFIGURE_ARGS+= \
+               --with-tiff=$(STAGING_DIR)/usr
+else
+       CONFIGURE_ARGS+= \
+               --without-tiff
+endif
+
+ifdef CONFIG_LIBGD_FREETYPE
+       CONFIGURE_ARGS+= \
+               --with-freetype=$(STAGING_DIR)/usr
+else
+       CONFIGURE_ARGS+= \
+               --without-freetype
+endif
 
 CONFIGURE_VARS += \
        ac_cv_header_iconv_h=no