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