Makefile 1.7 KB

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