2650faa139b0aeb412ef78f7a627758904c85d66
[openwrt/openwrt.git] / package / libs / zlib / Makefile
1 #
2 # Copyright (C) 2006-2013 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:=zlib
11 PKG_VERSION:=1.2.11
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
16 PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
17
18 PKG_LICENSE:=Zlib
19 PKG_LICENSE_FILES:=README
20 PKG_CPE_ID:=cpe:/a:gnu:zlib
21
22 PKG_CONFIG_DEPENDS:= CONFIG_ZLIB_OPTIMIZE_SPEED
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/cmake.mk
26
27 define Package/zlib
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=Library implementing the deflate compression method
31 URL:=http://www.zlib.net/
32 endef
33
34 define Package/zlib-dev
35 SECTION:=devel
36 CATEGORY:=Development
37 SUBMENU:=Libraries
38 DEPENDS:=zlib
39 TITLE:=Development files for the zlib library
40 endef
41
42 define Package/zlib/description
43 zlib is a lossless data-compression library.
44 This package includes the shared library.
45 endef
46
47 define Package/zlib-dev/description
48 zlib is a lossless data-compression library.
49 This package includes the development support files.
50 endef
51
52 define Package/zlib/config
53 source "$(SOURCE)/Config.in"
54 endef
55
56 TARGET_CFLAGS += $(FPIC)
57
58 ifeq ($(CONFIG_ZLIB_OPTIMIZE_SPEED),y)
59 TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
60 endif
61
62 ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
63 CMAKE_OPTIONS += \
64 -DARMv8=ON
65 endif
66
67 define Build/InstallDev
68 mkdir -p $(1)/usr/include
69 $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
70 $(1)/usr/include/
71 mkdir -p $(1)/usr/lib
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
73 $(1)/usr/lib/
74 mkdir -p $(1)/usr/lib/pkgconfig
75 $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
76 $(1)/usr/lib/pkgconfig/
77 endef
78
79 # libz.so is needed for openssl (zlib-dynamic)
80 define Package/zlib/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
84 endef
85
86 define Package/zlib-dev/install
87 $(INSTALL_DIR) $(1)/usr/include
88 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zconf.h \
89 $(1)/usr/include/
90 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zlib.h \
91 $(1)/usr/include/
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/
94 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
95 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
96 $(1)/usr/lib/pkgconfig/
97 endef
98
99 $(eval $(call BuildPackage,zlib))
100 $(eval $(call BuildPackage,zlib-dev))