e08b6f392949903aa223f80d346ee95804695012
[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:=3.14.4
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
15 # PKG_SOURCE_URL:=https://www.wolfssl.com/
16 PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
17 PKG_HASH:=1da1b45dec4a455716c8547074ad883c737865225f69443bb173c0dc21683fd1
18
19 PKG_FIXUP:=libtool
20 PKG_INSTALL:=1
21 PKG_USE_MIPS16:=0
22 PKG_BUILD_PARALLEL:=1
23 PKG_LICENSE:=GPL-2.0+
24 PKG_CPE_ID:=cpe:/a:yassl:cyassl
25
26 PKG_CONFIG_DEPENDS:=\
27 CONFIG_WOLFSSL_HAS_AES_CCM CONFIG_WOLFSSL_HAS_AES_GCM \
28 CONFIG_WOLFSSL_HAS_ARC4 CONFIG_WOLFSSL_HAS_CHACHA \
29 CONFIG_WOLFSSL_HAS_DES3 CONFIG_WOLFSSL_HAS_DH CONFIG_WOLFSSL_HAS_DTLS \
30 CONFIG_WOLFSSL_HAS_ECC CONFIG_WOLFSSL_HAS_ECC25519 \
31 CONFIG_WOLFSSL_HAS_OCSP CONFIG_WOLFSSL_HAS_POLY_1305 \
32 CONFIG_WOLFSSL_HAS_PSK CONFIG_WOLFSSL_HAS_SESSION_TICKET \
33 CONFIG_WOLFSSL_HAS_WPAS
34
35 include $(INCLUDE_DIR)/package.mk
36
37 define Package/libwolfssl
38 SECTION:=libs
39 SUBMENU:=SSL
40 CATEGORY:=Libraries
41 TITLE:=wolfSSL library
42 URL:=http://www.wolfssl.com/
43 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
44 MENU:=1
45 PROVIDES:=libcyassl
46 endef
47
48 define Package/libwolfssl/description
49 wolfSSL (formerly CyaSSL) is an SSL library optimized for small
50 footprint, both on disk and for memory use.
51 endef
52
53 define Package/libwolfssl/config
54 source "$(SOURCE)/Config.in"
55 endef
56
57 TARGET_CFLAGS += $(FPIC)
58
59 # --enable-stunnel needed for OpenSSL API compatibility bits
60 CONFIGURE_ARGS += \
61 --enable-opensslextra \
62 --enable-sni \
63 --enable-stunnel \
64 --disable-examples \
65 --disable-leanpsk \
66 --disable-leantls \
67
68 ifeq ($(CONFIG_IPV6),y)
69 CONFIGURE_ARGS += \
70 --enable-ipv6
71 endif
72
73 ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y)
74 CONFIGURE_ARGS += \
75 --enable-aesccm
76 endif
77
78 ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y)
79 CONFIGURE_ARGS += \
80 --disable-aesgcm
81 endif
82
83 ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y)
84 CONFIGURE_ARGS += \
85 --disable-chacha
86 endif
87
88 ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y)
89 CONFIGURE_ARGS += \
90 --enable-ecc \
91 --enable-supportedcurves
92 endif
93
94 ifeq ($(CONFIG_WOLFSSL_HAS_DH),y)
95 CONFIGURE_ARGS += \
96 --enable-dh
97 endif
98
99 ifneq ($(CONFIG_WOLFSSL_HAS_ARC4),y)
100 CONFIGURE_ARGS += \
101 --disable-arc4
102 else
103 CONFIGURE_ARGS += \
104 --enable-arc4
105 endif
106
107 ifneq ($(CONFIG_WOLFSSL_HAS_DES3),y)
108 CONFIGURE_ARGS += \
109 --disable-des3
110 else
111 CONFIGURE_ARGS += \
112 --enable-des3
113 endif
114
115 ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y)
116 CONFIGURE_ARGS += \
117 --enable-psk
118 endif
119
120 ifeq ($(CONFIG_WOLFSSL_HAS_SESSION_TICKET),y)
121 CONFIGURE_ARGS += \
122 --enable-session-ticket
123 endif
124
125 ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y)
126 CONFIGURE_ARGS += \
127 --enable-dtls
128 endif
129
130 ifeq ($(CONFIG_WOLFSSL_HAS_OCSP),y)
131 CONFIGURE_ARGS += \
132 --enable-ocsp --enable-ocspstapling --enable-ocspstapling2
133 endif
134
135 ifeq ($(CONFIG_WOLFSSL_HAS_WPAS),y)
136 CONFIGURE_ARGS += \
137 --enable-wpas --enable-sha512 --enable-fortress --enable-fastmath
138 endif
139
140 ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y)
141 CONFIGURE_ARGS += \
142 --enable-curve25519
143 endif
144
145 ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y)
146 CONFIGURE_ARGS += \
147 --enable-poly1305
148 endif
149
150 #ifneq ($(CONFIG_TARGET_x86),)
151 # CONFIGURE_ARGS += --enable-intelasm
152 #endif
153 #ifneq ($(CONFIG_TARGET_x86_64),)
154 # CONFIGURE_ARGS += --enable-intelasm
155 #endif
156
157 define Build/InstallDev
158 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
159 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
160
161 $(INSTALL_DIR) $(1)/usr/lib
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
163 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
164 ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
165
166 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
167 endef
168
169 define Package/libwolfssl/install
170 $(INSTALL_DIR) $(1)/usr/lib
171 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/
172 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
173 endef
174
175 $(eval $(call BuildPackage,libwolfssl))