xref: /OK3568_Linux_fs/buildroot/package/gd/gd.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# gd
4#
5################################################################################
6
7GD_VERSION = 2.3.3
8GD_SOURCE = libgd-$(GD_VERSION).tar.xz
9GD_SITE = https://github.com/libgd/libgd/releases/download/gd-$(GD_VERSION)
10GD_INSTALL_STAGING = YES
11GD_LICENSE = GD license
12GD_LICENSE_FILES = COPYING
13GD_CPE_ID_VENDOR = libgd
14GD_CPE_ID_PRODUCT = libgd
15GD_CONF_OPTS = --without-x --disable-rpath --disable-werror
16GD_DEPENDENCIES = host-pkgconf
17
18# gd forgets to link utilities with -pthread even though it uses
19# pthreads, causing linking errors with static linking
20ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
21GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
22endif
23
24ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
25GD_DEPENDENCIES += fontconfig
26GD_CONF_OPTS += --with-fontconfig
27endif
28
29ifeq ($(BR2_PACKAGE_FREETYPE),y)
30GD_DEPENDENCIES += freetype
31GD_CONF_OPTS += --with-freetype=$(STAGING_DIR)/usr
32else
33GD_CONF_OPTS += --without-freetype
34endif
35
36ifeq ($(BR2_PACKAGE_LIBICONV),y)
37GD_DEPENDENCIES += libiconv
38# not strictly needed for gd, but ensures -liconv ends up in gdlib.pc
39GD_CONF_ENV += LIBS_PRIVATES="-liconv"
40endif
41
42ifeq ($(BR2_PACKAGE_JPEG),y)
43GD_DEPENDENCIES += jpeg
44GD_CONF_OPTS += --with-jpeg
45endif
46
47ifeq ($(BR2_PACKAGE_LIBPNG),y)
48GD_DEPENDENCIES += libpng
49GD_CONF_OPTS += --with-png
50else
51GD_CONF_OPTS += --without-png
52endif
53
54ifeq ($(BR2_PACKAGE_WEBP),y)
55GD_DEPENDENCIES += webp
56GD_CONF_OPTS += --with-webp
57else
58GD_CONF_OPTS += --without-webp
59endif
60
61ifeq ($(BR2_PACKAGE_TIFF),y)
62GD_DEPENDENCIES += tiff
63GD_CONF_OPTS += --with-tiff
64else
65GD_CONF_OPTS += --without-tiff
66endif
67
68ifeq ($(BR2_PACKAGE_XLIB_LIBXPM),y)
69GD_DEPENDENCIES += xlib_libXpm
70GD_CONF_OPTS += --with-xpm
71endif
72
73ifeq ($(BR2_PACKAGE_ZLIB),y)
74GD_DEPENDENCIES += zlib
75endif
76
77GD_TOOLS_$(BR2_PACKAGE_GD_ANNOTATE)	+= annotate
78GD_TOOLS_$(BR2_PACKAGE_GD_BDFTOGD)	+= bdftogd
79GD_TOOLS_$(BR2_PACKAGE_GD_GD2COPYPAL)	+= gd2copypal
80GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOGIF)	+= gd2togif
81GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOPNG)	+= gd2topng
82GD_TOOLS_$(BR2_PACKAGE_GD_GDCMPGIF)	+= gdcmpgif
83GD_TOOLS_$(BR2_PACKAGE_GD_GDPARTTOPNG)	+= gdparttopng
84GD_TOOLS_$(BR2_PACKAGE_GD_GDTOPNG)	+= gdtopng
85GD_TOOLS_$(BR2_PACKAGE_GD_GIFTOGD2)	+= giftogd2
86GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD)	+= pngtogd
87GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD2)	+= pngtogd2
88GD_TOOLS_$(BR2_PACKAGE_GD_WEBPNG)	+= webpng
89
90define GD_REMOVE_TOOLS
91	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(GD_TOOLS_))
92endef
93
94GD_POST_INSTALL_TARGET_HOOKS += GD_REMOVE_TOOLS
95
96$(eval $(autotools-package))
97