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