3d2a56a97f4ae05b0351f5ac65b25d6a86420c69
[openwrt/openwrt.git] / package / libs / wolfssl / Makefile
1 #
2 # Copyright (C) 2006-2017 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:=wolfssl
11 PKG_VERSION:=4.2.0-stable
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
16 PKG_HASH:=3562af485c26cd7abe94d9404fbfc0c5c9bceb4aab29b81ebf5e6c2467507e12
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20 PKG_USE_MIPS16:=0
21 PKG_BUILD_PARALLEL:=1
22 PKG_LICENSE:=GPL-2.0-or-later
23 PKG_LICENSE_FILES:=LICENSING COPYING
24 PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
25 PKG_CPE_ID:=cpe:/a:wolfssl:wolfssl
26
27 PKG_CONFIG_DEPENDS:=\
28 CONFIG_WOLFSSL_HAS_AES_CCM CONFIG_WOLFSSL_HAS_AFALG \
29 CONFIG_WOLFSSL_HAS_ARC4 CONFIG_WOLFSSL_HAS_CHACHA_POLY \
30 CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL \
31 CONFIG_WOLFSSL_HAS_DH CONFIG_WOLFSSL_HAS_DTLS \
32 CONFIG_WOLFSSL_HAS_ECC25519 CONFIG_WOLFSSL_HAS_OCSP \
33 CONFIG_WOLFSSL_HAS_SESSION_TICKET CONFIG_WOLFSSL_HAS_TLSV10 \
34 CONFIG_WOLFSSL_HAS_TLSV13 CONFIG_WOLFSSL_HAS_WPAS
35
36 include $(INCLUDE_DIR)/package.mk
37
38 define Package/libwolfssl
39 SECTION:=libs
40 SUBMENU:=SSL
41 CATEGORY:=Libraries
42 TITLE:=wolfSSL library
43 URL:=http://www.wolfssl.com/
44 MENU:=1
45 PROVIDES:=libcyassl
46 DEPENDS:=+WOLFSSL_HAS_DEVCRYPTO:kmod-cryptodev +WOLFSSL_HAS_AFALG:kmod-crypto-user
47 ABI_VERSION:=23
48 endef
49
50 define Package/libwolfssl/description
51 wolfSSL (formerly CyaSSL) is an SSL library optimized for small
52 footprint, both on disk and for memory use.
53 endef
54
55 define Package/libwolfssl/config
56 source "$(SOURCE)/Config.in"
57 endef
58
59 TARGET_CFLAGS += $(FPIC) -DFP_MAX_BITS=8192
60
61 # --enable-stunnel needed for OpenSSL API compatibility bits
62 CONFIGURE_ARGS += \
63 --enable-opensslextra \
64 --enable-sni \
65 --enable-stunnel \
66 --disable-examples \
67 --disable-jobserver \
68 --$(if $(CONFIG_IPV6),enable,disable)-ipv6 \
69 --$(if $(CONFIG_WOLFSSL_HAS_AES_CCM),enable,disable)-aesccm \
70 --$(if $(CONFIG_WOLFSSL_HAS_CHACHA_POLY),enable,disable)-chacha \
71 --$(if $(CONFIG_WOLFSSL_HAS_CHACHA_POLY),enable,disable)-poly1305 \
72 --$(if $(CONFIG_WOLFSSL_HAS_DH),enable,disable)-dh \
73 --$(if $(CONFIG_WOLFSSL_HAS_ARC4),enable,disable)-arc4 \
74 --$(if $(CONFIG_WOLFSSL_HAS_TLSV10),enable,disable)-tlsv10 \
75 --$(if $(CONFIG_WOLFSSL_HAS_TLSV13),enable,disable)-tls13 \
76 --$(if $(CONFIG_WOLFSSL_HAS_SESSION_TICKET),enable,disable)-session-ticket \
77 --$(if $(CONFIG_WOLFSSL_HAS_DTLS),enable,disable)-dtls \
78 --$(if $(CONFIG_WOLFSSL_HAS_ECC25519),enable,disable)-curve25519 \
79 --$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \
80 --enable-devcrypto=$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC),cbc\
81 ,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES),aes\
82 ,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL),yes,no)))
83
84 ifeq ($(CONFIG_WOLFSSL_HAS_OCSP),y)
85 CONFIGURE_ARGS += \
86 --enable-ocsp --enable-ocspstapling --enable-ocspstapling2
87 endif
88
89 ifeq ($(CONFIG_WOLFSSL_HAS_WPAS),y)
90 CONFIGURE_ARGS += \
91 --enable-wpas --enable-sha512 --enable-fortress --enable-fastmath
92 endif
93
94 define Build/InstallDev
95 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
96 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
97
98 $(INSTALL_DIR) $(1)/usr/lib
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
100 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
101 ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
102
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
104 endef
105
106 define Package/libwolfssl/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so.* $(1)/usr/lib/
109 endef
110
111 $(eval $(call BuildPackage,libwolfssl))