Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.5.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_HASH:=75cca1998761b02e16f2db56da52992aef622bf55a3b45ec538bc2eedadc9419
  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. ABI_VERSION:=7
  27. endef
  28. define Package/libnettle/config
  29. source "$(SOURCE)/Config.in"
  30. endef
  31. TARGET_CFLAGS += $(FPIC)
  32. CONFIGURE_ARGS += \
  33. --enable-shared \
  34. --enable-fat \
  35. --disable-openssl \
  36. --disable-documentation \
  37. --enable-static
  38. ifeq ($(CONFIG_LIBNETTLE_MINI),y)
  39. CONFIGURE_ARGS += --enable-mini-gmp
  40. endif
  41. ifeq ($(CONFIG_CPU_SUBTYPE),neon)
  42. CONFIGURE_ARGS += \
  43. --enable-arm-neon
  44. endif
  45. define Build/Compile
  46. $(call Build/Compile/Default, \
  47. DESTDIR="$(PKG_INSTALL_DIR)" \
  48. CC="$(TARGET_CC)" \
  49. libnettle.so libhogweed.so
  50. +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  51. DESTDIR="$(PKG_INSTALL_DIR)" \
  52. install)
  53. endef
  54. define Build/InstallDev
  55. $(INSTALL_DIR) $(1)/usr/include/nettle
  56. $(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
  57. $(INSTALL_DIR) $(1)/usr/lib
  58. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
  60. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  61. $(CP) \
  62. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
  63. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
  64. $(1)/usr/lib/pkgconfig/
  65. endef
  66. define Package/libnettle/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
  70. endef
  71. $(eval $(call BuildPackage,libnettle))