1
0

Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.11
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
  13. PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
  14. PKG_LICENSE:=Zlib
  15. PKG_LICENSE_FILES:=README
  16. PKG_CPE_ID:=cpe:/a:gnu:zlib
  17. PKG_CONFIG_DEPENDS:= CONFIG_ZLIB_OPTIMIZE_SPEED
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/zlib
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=Library implementing the deflate compression method
  24. URL:=http://www.zlib.net/
  25. endef
  26. define Package/zlib-dev
  27. SECTION:=devel
  28. CATEGORY:=Development
  29. SUBMENU:=Libraries
  30. DEPENDS:=zlib
  31. TITLE:=Development files for the zlib library
  32. endef
  33. define Package/zlib/description
  34. zlib is a lossless data-compression library.
  35. This package includes the shared library.
  36. endef
  37. define Package/zlib-dev/description
  38. zlib is a lossless data-compression library.
  39. This package includes the development support files.
  40. endef
  41. define Package/zlib/config
  42. source "$(SOURCE)/Config.in"
  43. endef
  44. TARGET_CFLAGS += $(FPIC)
  45. ifeq ($(CONFIG_ZLIB_OPTIMIZE_SPEED),y)
  46. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
  47. endif
  48. CMAKE_OPTIONS += \
  49. -DARMv8=$$$$(echo -e '\#ifdef __ARM_NEON__\nON\n\#else\nOFF\n\#endif' | $$(TARGET_CC) $$(TARGET_CFLAGS) -x c -E - | grep -xE 'ON|OFF')
  50. define Build/InstallDev
  51. mkdir -p $(1)/usr/include
  52. $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
  53. $(1)/usr/include/
  54. mkdir -p $(1)/usr/lib
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
  56. $(1)/usr/lib/
  57. mkdir -p $(1)/usr/lib/pkgconfig
  58. $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
  59. $(1)/usr/lib/pkgconfig/
  60. endef
  61. # libz.so is needed for openssl (zlib-dynamic)
  62. define Package/zlib/install
  63. $(INSTALL_DIR) $(1)/usr/lib
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
  65. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
  66. endef
  67. define Package/zlib-dev/install
  68. $(INSTALL_DIR) $(1)/usr/include
  69. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zconf.h \
  70. $(1)/usr/include/
  71. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zlib.h \
  72. $(1)/usr/include/
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/
  75. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  76. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
  77. $(1)/usr/lib/pkgconfig/
  78. endef
  79. $(eval $(call BuildPackage,zlib))
  80. $(eval $(call BuildPackage,zlib-dev))