[package] update libpng to 1.2.37 (#5359)
[openwrt/svn-archive/archive.git] / libs / libpng / Makefile
1 #
2 # Copyright (C) 2006 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:=libpng
11 PKG_VERSION:=1.2.37
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/libpng
16 PKG_MD5SUM:=6d1ee0888dbb711214943cb19c294b49
17
18 PKG_FIXUP = libtool
19
20 include $(INCLUDE_DIR)/host-build.mk
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libpng
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+zlib
27 TITLE:=A PNG format files handling library
28 URL:=http://www.libpng.org/pub/png/libpng.html
29 endef
30
31 define Build/Configure
32 $(call Build/Configure/Default, \
33 --enable-shared \
34 --enable-static \
35 --with-zlib="$(STAGING_DIR)/usr" \
36 )
37 endef
38
39 TARGET_CFLAGS += $(FPIC)
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 DESTDIR="$(PKG_INSTALL_DIR)" \
44 all install
45 endef
46
47 define Host/Install
48 $(MAKE) -C "$(HOST_BUILD_DIR)" install
49 endef
50
51 define Build/InstallDev
52 mkdir -p $(2)/bin
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(2)/bin/
54 mkdir -p $(1)/usr/include
55 $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(1)/usr/include/
56 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng12 $(1)/usr/include/
57 mkdir -p $(1)/usr/lib
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,so*} $(1)/usr/lib/
59 mkdir -p $(1)/usr/lib/pkgconfig
60 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(1)/usr/lib/pkgconfig/
61 $(SED) 's,^[ILR]_opts=".\+",,g' $(2)/bin/libpng*-config
62 endef
63
64 define Package/libpng/install
65 $(INSTALL_DIR) $(1)/usr/lib
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(1)/usr/lib/
67 endef
68
69 $(eval $(call HostBuild))
70 $(eval $(call BuildPackage,libpng))