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