2 # Copyright (C) 2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/nettle
17 PKG_MD5SUM:=46942627d5d0ca11720fec18d81fc38f7ef837ea4197c1f630e71ce0d470b11e
20 PKG_LICENSE_FILES:=COPYING
23 PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI
25 include $(INCLUDE_DIR)/package.mk
27 define Package/libnettle
30 TITLE:=GNU crypto library
31 URL:=http://www.lysator.liu.se/~nisse/nettle/
32 DEPENDS+= +!LIBNETTLE_MINI:libgmp
35 define Package/libnettle/config
36 source "$(SOURCE)/Config.in"
39 TARGET_CFLAGS += $(FPIC)
45 --disable-documentation \
48 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
49 CONFIGURE_ARGS += --enable-mini-gmp
52 ifeq ($(CONFIG_CPU_SUBTYPE),neon)
58 $(call Build/Compile/Default, \
59 DESTDIR="$(PKG_INSTALL_DIR)" \
61 libnettle.so libhogweed.so
62 +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
67 define Build/InstallDev
68 $(INSTALL_DIR) $(1)/usr/include/nettle
69 $(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
70 $(INSTALL_DIR) $(1)/usr/lib
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
73 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
75 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
76 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
77 $(1)/usr/lib/pkgconfig/
80 define Package/libnettle/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
86 $(eval $(call BuildPackage,libnettle))