Makefile 2.0 KB

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