Root/package/zlib/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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=zlib
11PKG_VERSION:=1.2.3
12PKG_RELEASE:=5
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://www.zlib.net @SF/zlib
16PKG_MD5SUM:=dee233bf288ee795ac96a98cc2e369b6
17
18include $(INCLUDE_DIR)/package.mk
19
20define Package/zlib
21  SECTION:=libs
22  CATEGORY:=Libraries
23  TITLE:=Library implementing the deflate compression method
24  URL:=http://www.zlib.net/
25endef
26
27define Build/Configure
28    (cd $(PKG_BUILD_DIR); \
29        $(TARGET_CONFIGURE_OPTS) \
30        LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
31        CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
32        UNAME_S="Linux" \
33        ./configure \
34            --prefix=/usr \
35            --shared \
36    );
37endef
38
39define Build/Compile
40    $(MAKE) -C $(PKG_BUILD_DIR) \
41        $(TARGET_CONFIGURE_OPTS) \
42        LDSHARED="$(TARGET_CROSS)ld -shared" \
43        CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
44        libz.a libz.so
45    mkdir -p $(PKG_INSTALL_DIR)
46    $(MAKE) -C $(PKG_BUILD_DIR) \
47        DESTDIR="$(PKG_INSTALL_DIR)" \
48        install
49endef
50
51define Build/InstallDev
52    mkdir -p $(1)/usr/include
53    $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
54        $(1)/usr/include/
55    mkdir -p $(1)/usr/lib
56    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
57        $(1)/usr/lib/
58endef
59
60# libz.so is needed for openssl (zlib-dynamic)
61define Package/zlib/install
62    $(INSTALL_DIR) $(1)/usr/lib
63    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
64    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
65endef
66
67$(eval $(call BuildPackage,zlib))
68

Archive Download this file



interactive