dacf7a2b0639d3a2f1d73f197f03b828d4b2b78f
[openwrt/staging/mkresin.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.1.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:=b40fa88dc32f37a182b6b42092ebb144
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 --disable-openssl \
44 --disable-documentation \
45 --enable-static
46
47 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
48 CONFIGURE_ARGS += --enable-mini-gmp
49 endif
50
51 ifeq ($(CONFIG_CPU_SUBTYPE),neon)
52 CONFIGURE_ARGS += \
53 --enable-arm-neon
54 endif
55
56 define Build/Compile
57 $(call Build/Compile/Default, \
58 DESTDIR="$(PKG_INSTALL_DIR)" \
59 CC="$(TARGET_CC)" \
60 libnettle.so libhogweed.so
61 +$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
62 DESTDIR="$(PKG_INSTALL_DIR)" \
63 install)
64 endef
65
66 define Build/InstallDev
67 $(INSTALL_DIR) $(1)/usr/include/nettle
68 $(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
72 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
73 $(CP) \
74 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
75 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
76 $(1)/usr/lib/pkgconfig/
77 endef
78
79 define Package/libnettle/install
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
83 endef
84
85 $(eval $(call BuildPackage,libnettle))