cb1710449136587032da32df476ed643a26003a0
[openwrt/openwrt.git] / package / libs / cyassl / Makefile
1 #
2 # Copyright (C) 2006-2016 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.9.10
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
15 PKG_SOURCE_URL:=https://www.wolfssl.com/
16 PKG_HASH:=793921c0db96248be4a369cbfdf0cb7b37ee2be715b8b775b6cd32efe66f494e
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21 PKG_LICENSE:=GPL-2.0+
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libcyassl
26 SECTION:=libs
27 SUBMENU:=SSL
28 CATEGORY:=Libraries
29 TITLE:=CyaSSL library
30 URL:=http://www.wolfssl.com/
31 MENU:=1
32 endef
33
34 define Package/libcyassl/description
35 CyaSSL is an SSL library optimized for small footprint, both on disk and for
36 memory use.
37 endef
38
39 define Package/libcyassl/config
40 source "$(SOURCE)/Config.in"
41 endef
42
43 TARGET_CFLAGS += $(FPIC)
44
45 # --enable-stunnel needed for OpenSSL API compatibility bits
46 CONFIGURE_ARGS += \
47 --enable-opensslextra \
48 --enable-sni \
49 --enable-stunnel \
50 --disable-examples
51
52 ifeq ($(CONFIG_IPV6),y)
53 CONFIGURE_ARGS += \
54 --enable-ipv6
55 endif
56
57 ifeq ($(CONFIG_CYASSL_HAS_AES_CCM),y)
58 CONFIGURE_ARGS += \
59 --enable-aesccm
60 endif
61
62 ifeq ($(CONFIG_CYASSL_HAS_AES_GCM),y)
63 CONFIGURE_ARGS += \
64 --enable-aesgcm
65 endif
66
67 ifeq ($(CONFIG_CYASSL_HAS_CHACHA),y)
68 CONFIGURE_ARGS += \
69 --enable-chacha
70 endif
71
72 ifeq ($(CONFIG_CYASSL_HAS_ECC),y)
73 CONFIGURE_ARGS += \
74 --enable-ecc \
75 --enable-supportedcurves
76 endif
77
78 ifeq ($(CONFIG_CYASSL_HAS_DH),y)
79 CONFIGURE_ARGS += \
80 --enable-dh
81 endif
82
83 ifeq ($(CONFIG_CYASSL_HAS_ARC4),n)
84 CONFIGURE_ARGS += \
85 --disable-arc4
86 endif
87
88 ifeq ($(CONFIG_CYASSL_HAS_DES3),y)
89 CONFIGURE_ARGS += \
90 --disable-des3
91 endif
92
93 ifeq ($(CONFIG_CYASSL_HAS_PSK),y)
94 CONFIGURE_ARGS += \
95 --enable-psk
96 endif
97
98 ifeq ($(CONFIG_CYASSL_HAS_DTLS),y)
99 CONFIGURE_ARGS += \
100 --enable-dtls
101 endif
102
103 ifeq ($(CONFIG_CYASSL_HAS_ECC25519),y)
104 CONFIGURE_ARGS += \
105 --enable-ecc25519
106 endif
107
108 ifeq ($(CONFIG_CYASSL_HAS_POLY1305),y)
109 CONFIGURE_ARGS += \
110 --enable-poly1305
111 endif
112
113 #ifneq ($(CONFIG_TARGET_x86),)
114 # CONFIGURE_ARGS += --enable-intelasm
115 #endif
116 #ifneq ($(CONFIG_TARGET_x86_64),)
117 # CONFIGURE_ARGS += --enable-intelasm
118 #endif
119
120 define Build/InstallDev
121 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
122 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
123
124 $(INSTALL_DIR) $(1)/usr/lib
125 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.{so*,la} $(1)/usr/lib/
126 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
127 ln -s libwolfssl.la $(1)/usr/lib/libcyassl.la
128
129 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
130 endef
131
132 define Package/libcyassl/install
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/
135 ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so
136 endef
137
138 $(eval $(call BuildPackage,libcyassl))