nettle: enable fat build
[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:=3.3
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:=46942627d5d0ca11720fec18d81fc38f7ef837ea4197c1f630e71ce0d470b11e
18
19 PKG_LICENSE:=GPL-2.0+
20 PKG_LICENSE_FILES:=COPYING
21 PKG_BUILD_PARALLEL:=0
22
23 PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libnettle
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=GNU crypto library
31 URL:=http://www.lysator.liu.se/~nisse/nettle/
32 DEPENDS+= +!LIBNETTLE_MINI:libgmp
33 endef
34
35 define Package/libnettle/config
36 source "$(SOURCE)/Config.in"
37 endef
38
39 TARGET_CFLAGS += $(FPIC)
40
41 CONFIGURE_ARGS += \
42 --enable-shared \
43 --enable-fat \
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))