nettle: disable mips16 support to improve performance
[openwrt/openwrt.git] / package / libs / nettle / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=nettle
11 PKG_VERSION:=2.7.1
12 PKG_RELEASE:=1
13 PKG_USE_MIPS16:=0
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/nettle
17 PKG_MD5SUM:=003d5147911317931dd453520eb234a5
18 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
19
20 PKG_LICENSE:=LGPLv2
21 PKG_LICENSE_FILES:=COPYING
22
23 PKG_FIXUP:=autoreconf
24 PKG_BUILD_PARALLEL:=0
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libnettle
29 SECTION:=libs
30 CATEGORY:=Libraries
31 TITLE:=GNU crypto library
32 URL:=http://www.lysator.liu.se/~nisse/nettle/
33 DEPENDS+= +!LIBNETTLE_MINI:libgmp
34 endef
35
36 define Package/libnettle/config
37 source "$(SOURCE)/Config.in"
38 endef
39
40 TARGET_CFLAGS += $(FPIC)
41
42 CONFIGURE_ARGS += \
43 --enable-shared \
44 --disable-openssl \
45 --disable-documentation \
46 --enable-static
47
48 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
49 CONFIGURE_ARGS += --enable-mini-gmp
50 endif
51
52 ifeq ($(CONFIG_CPU_SUBTYPE),neon)
53 CONFIGURE_ARGS += \
54 --enable-arm-neon
55 endif
56
57 define Build/Compile
58 $(call Build/Compile/Default, \
59 DESTDIR="$(PKG_INSTALL_DIR)" \
60 CC="$(TARGET_CC)" \
61 libnettle.so libhogweed.so
62 +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 install)
65 endef
66
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
74 $(CP) \
75 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
76 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
77 $(1)/usr/lib/pkgconfig/
78 endef
79
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/
84 endef
85
86 $(eval $(call BuildPackage,libnettle))