packages/gd: various fixes
[packages.git] / libs / gd / Makefile
1
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gd
11 PKG_VERSION:=2.0.35
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.libgd.org/releases
16 PKG_MD5SUM:=6c6c3dbb7bf079e0bb5fbbfd3bb8a71c
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libgd
25   SECTION:=libs
26   CATEGORY:=Libraries
27   DEPENDS:=+libjpeg +libpng
28   TITLE:=The GD graphics library
29   URL:=http://www.libgd.org/
30 endef
31
32 define Package/libgd/description
33   GD is an open source code library for the dynamic creation of images by
34   programmers. GD creates PNG, JPEG and GIF images, among other formats.
35 endef
36
37 TARGET_CFLAGS += $(FPIC)
38
39 CONFIGURE_ARGS += \
40         --enable-shared \
41         --enable-static \
42         --disable-rpath \
43         --without-x \
44         --without-freetype \
45         --with-jpeg=$(STAGING_DIR)/usr \
46         --with-png=$(STAGING_DIR)/usr \
47         --without-xpm \
48         --without-iconv
49
50 CONFIGURE_VARS += \
51         LIBPNG12_CONFIG="$(STAGING_DIR)/host/bin/libpng12-config"
52
53 define Build/Configure
54         ( cd $(PKG_BUILD_DIR); aclocal; libtoolize --force; autoreconf; );
55         $(call Build/Configure/Default)
56 endef
57
58 define Build/InstallDev
59         $(INSTALL_DIR) $(1)/usr/bin
60         $(CP) $(PKG_INSTALL_DIR)/usr/bin/gdlib-config $(1)/usr/bin/
61         $(SED) \
62                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
63                 $(1)/usr/bin/gdlib-config
64         $(INSTALL_DIR) $(1)/usr/include
65         $(CP) $(PKG_INSTALL_DIR)/usr/include/entities.h $(1)/usr/include/
66         $(CP) $(PKG_INSTALL_DIR)/usr/include/gd{,_io,cache,fontg,fontl,fontmb,fonts,fontt,fx}.h \
67                 $(1)/usr/include/
68         $(INSTALL_DIR) $(1)/usr/lib
69         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.{a,la,so*} $(1)/usr/lib/
70         $(INSTALL_DIR) $(2)/bin
71         $(LN) ../../usr/bin/gdlib-config $(2)/bin/
72 endef
73
74 define Package/libgd/install
75         $(INSTALL_DIR) $(1)/usr/lib
76         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so.* $(1)/usr/lib/
77 endef
78
79 $(eval $(call BuildPackage,libgd))