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