libwolfssl ported
[henge/webcc.git] / src / core / _rules.mk
index e69de29..f3a964c 100644 (file)
@@ -0,0 +1,27 @@
+#Core module compilation rules
+APP_RULES += wolfssl
+SCRUB_RULES += scrub_wolfssl
+
+.PHONY: wolfssl scrub_wolfssl
+wolfssl: ../extern/lib/libwolfssl.so
+       @echo "WolfSSL installed"
+
+../extern/lib/libwolfssl.so:
+       @echo "Downloading WolfSSL"
+       @mkdir -p tmp
+       @mkdir -p ../extern/include
+       @mkdir -p ../extern/lib
+       git clone git@github.com:wolfSSL/wolfssl.git tmp
+       @echo "Genearting WolfSSL Config" && cd tmp &&  emconfigure ./autogen.sh
+       @echo "Configuring WorlfSSL" && cd tmp && emconfigure ./configure --enable-singlethreaded=yes --enable-static=yes --enable-fastmath=no
+       sed -i 's/SIZEOF_LONG 0/SIZEOF_LONG 4/' tmp/config.h
+       sed -i 's/SIZEOF_LONG_LONG 0/SIZEOF_LONG_LONG 8/' tmp/config.h
+       cd tmp && emmake src/libwolfssl.la
+       cp -H tmp/src/.libs/libwolfssl.so ../extern/lib/libwolfssl.so
+       cp -r tmp/wolfssl ../extern/include
+       @rm -Rf tmp
+
+scrub_wolfssl:
+       @echo "Scrubbing WolfSSL"
+       @rm -Rf ../extern/include/wolfssl
+       @rm -f ../extern/lib/libwolfssl.so