3940630044c32356d4a6fb5d9e540057ff95778d
[henge/webcc.git] / .make / wolfssl.mk
1 ################################################################################
2 # Desc: WolfSSL Build Data
3 # Author: Mihrtec LLC
4 # Date: 2016
5 ################################################################################
6 # Wolfssl is built for static linking, and only builds its crypt library
7 ################################################################################
8 # Download location
9 GITADDR := git@github.com:wolfSSL/wolfssl.git
10 # Typical Configuration to allow static linking on a tiny crypt-only lib
11 CONFIGURE += --enable-static=yes
12 CONFIGURE += --enable-cryptonly=yes
13 # Wolfssl has some badly indented text somewhere and a weird distribution system
14 CONFIGURE += CFLAGS=-w
15 MKCMD := export CFLAGS=-w
16 # Only build libwolfssl.la for a minimal distribution (speeds up build)
17 MKCMD += && make -k src/libwolfssl.la
18
19 # Modifications to the build process when using specific compilers
20 define emccMOD =
21 $(eval CONFIGURE += --enable-fastmath=no)
22 $(eval CONFIGURE += --enable-singlethreaded=yes)
23 # Wolfssl doesn't properly detect sizeof long and longlong when compiling with
24 # emscripten
25 $(eval CONFIGURE += && sed -i 's@SIZEOF_LONG 0@SIZEOF_LONG 4@' config.h)
26 $(eval CONFIGURE += && sed -i 's@SIZEOF_LONG_LONG 0@SIZEOF_LONG_LONG 8@' config.h)
27 $(eval MKCMD := $(subst make , emmake make ,$(MKCMD)))
28 $(eval CONFIGURE := $(subst ./configure , emconfigure ./configure ,$(CONFIGURE)))
29 endef
30 define em++MOD =
31 $(call EMCCMOD)
32 endef
33 $(eval $(call $(c_C)MOD))