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