Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #
  2. # Copyright (C) 2014 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:=nettle
  9. PKG_VERSION:=3.1.1
  10. PKG_RELEASE:=1
  11. PKG_USE_MIPS16:=0
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@GNU/nettle
  14. PKG_MD5SUM:=b40fa88dc32f37a182b6b42092ebb144
  15. PKG_LICENSE:=GPL-2.0+
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_BUILD_PARALLEL:=0
  18. PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/libnettle
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. TITLE:=GNU crypto library
  24. URL:=http://www.lysator.liu.se/~nisse/nettle/
  25. DEPENDS+= +!LIBNETTLE_MINI:libgmp
  26. endef
  27. define Package/libnettle/config
  28. source "$(SOURCE)/Config.in"
  29. endef
  30. TARGET_CFLAGS += $(FPIC)
  31. CONFIGURE_ARGS += \
  32. --enable-shared \
  33. --disable-openssl \
  34. --disable-documentation \
  35. --enable-static
  36. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  37. CONFIGURE_ARGS += --enable-mini-gmp
  38. endif
  39. ifeq ($(CONFIG_CPU_SUBTYPE),neon)
  40. CONFIGURE_ARGS += \
  41. --enable-arm-neon
  42. endif
  43. define Build/Compile
  44. $(call Build/Compile/Default, \
  45. DESTDIR="$(PKG_INSTALL_DIR)" \
  46. CC="$(TARGET_CC)" \
  47. libnettle.so libhogweed.so
  48. +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  49. DESTDIR="$(PKG_INSTALL_DIR)" \
  50. install)
  51. endef
  52. define Build/InstallDev
  53. $(INSTALL_DIR) $(1)/usr/include/nettle
  54. $(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
  55. $(INSTALL_DIR) $(1)/usr/lib
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
  58. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  59. $(CP) \
  60. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
  61. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
  62. $(1)/usr/lib/pkgconfig/
  63. endef
  64. define Package/libnettle/install
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
  68. endef
  69. $(eval $(call BuildPackage,libnettle))