mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
add mbedtls support and disable wolfssl
This commit is contained in:
parent
885e83d2eb
commit
8b53625743
7 changed files with 34 additions and 9 deletions
|
@ -37,7 +37,7 @@ EXPORTED_FUNCS="${EXPORTED_FUNCS:1}"
|
||||||
|
|
||||||
#compile options
|
#compile options
|
||||||
RUNTIME_METHODS="addFunction,removeFunction,allocate,ALLOC_NORMAL"
|
RUNTIME_METHODS="addFunction,removeFunction,allocate,ALLOC_NORMAL"
|
||||||
COMPILER_OPTIONS="-o $MODULE_FILE -lcurl -lwolfssl -lcjson -lz -lbrotlidec -lbrotlicommon -lnghttp2 -I $INCLUDE_DIR -L $LIB_DIR"
|
COMPILER_OPTIONS="-o $MODULE_FILE -lcurl -lmbedtls -lmbedcrypto -lmbedx509 -lcjson -lz -lbrotlidec -lbrotlicommon -lnghttp2 -I $INCLUDE_DIR -L $LIB_DIR"
|
||||||
EMSCRIPTEN_OPTIONS="-lwebsocket.js -sENVIRONMENT=worker,web -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH -sNO_EXIT_RUNTIME -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS"
|
EMSCRIPTEN_OPTIONS="-lwebsocket.js -sENVIRONMENT=worker,web -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH -sNO_EXIT_RUNTIME -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS"
|
||||||
|
|
||||||
#clean output dir
|
#clean output dir
|
||||||
|
|
|
@ -2,7 +2,7 @@ const copyright_notice = `libcurl.js is licensed under the GNU AGPL v3. You can
|
||||||
|
|
||||||
Several C libraries are used, and their licenses are listed below:
|
Several C libraries are used, and their licenses are listed below:
|
||||||
- libcurl: curl License (https://curl.se/docs/copyright.html)
|
- libcurl: curl License (https://curl.se/docs/copyright.html)
|
||||||
- wolfssl: GNU GPL v2 (https://github.com/wolfSSL/wolfssl/blob/master/COPYING)
|
- mbedtls: Apache License 2.0 (https://github.com/Mbed-TLS/mbedtls/blob/development/LICENSE)
|
||||||
- cjson: MIT License (https://github.com/DaveGamble/cJSON/blob/master/LICENSE)
|
- cjson: MIT License (https://github.com/DaveGamble/cJSON/blob/master/LICENSE)
|
||||||
- zlib: zlib License (https://www.zlib.net/zlib_license.html)
|
- zlib: zlib License (https://www.zlib.net/zlib_license.html)
|
||||||
- brotli: MIT License (https://github.com/google/brotli/blob/master/LICENSE)
|
- brotli: MIT License (https://github.com/google/brotli/blob/master/LICENSE)
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#publish libcurl.js as an npm package
|
#publish libcurl.js as an npm package
|
||||||
|
|
||||||
./build.sh all
|
./build.sh all
|
||||||
tests/run.sh
|
|
||||||
|
|
||||||
cp package.json out
|
cp package.json out
|
||||||
cp ../README.md out
|
cp ../README.md out
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
set -e
|
set -e
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
|
||||||
WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm)
|
MBEDTLS_PREFIX=$(realpath build/mbedtls-wasm)
|
||||||
CJSON_PREFIX=$(realpath build/cjson-wasm)
|
CJSON_PREFIX=$(realpath build/cjson-wasm)
|
||||||
CURL_PREFIX=$(realpath build/curl-wasm)
|
CURL_PREFIX=$(realpath build/curl-wasm)
|
||||||
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
||||||
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
||||||
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
||||||
|
|
||||||
if [ ! -d $WOLFSSL_PREFIX ]; then
|
if [ ! -d $MBEDTLS_PREFIX ]; then
|
||||||
tools/wolfssl.sh
|
tools/mbedtls.sh
|
||||||
fi
|
fi
|
||||||
if [ ! -d $CJSON_PREFIX ]; then
|
if [ ! -d $CJSON_PREFIX ]; then
|
||||||
tools/cjson.sh
|
tools/cjson.sh
|
||||||
|
@ -31,7 +31,7 @@ if [ ! -d $CURL_PREFIX ]; then
|
||||||
tools/curl.sh
|
tools/curl.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -r $WOLFSSL_PREFIX/* $CURL_PREFIX
|
cp -r $MBEDTLS_PREFIX/* $CURL_PREFIX
|
||||||
cp -r $CJSON_PREFIX/* $CURL_PREFIX
|
cp -r $CJSON_PREFIX/* $CURL_PREFIX
|
||||||
cp -r $ZLIB_PREFIX/* $CURL_PREFIX
|
cp -r $ZLIB_PREFIX/* $CURL_PREFIX
|
||||||
cp -r $BROTLI_PREFIX/* $CURL_PREFIX
|
cp -r $BROTLI_PREFIX/* $CURL_PREFIX
|
||||||
|
|
|
@ -7,7 +7,7 @@ set -e
|
||||||
|
|
||||||
CORE_COUNT=$(nproc --all)
|
CORE_COUNT=$(nproc --all)
|
||||||
PREFIX=$(realpath build/curl-wasm)
|
PREFIX=$(realpath build/curl-wasm)
|
||||||
WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm)
|
MBEDTLS_PREFIX=$(realpath build/mbedtls-wasm)
|
||||||
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
||||||
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
||||||
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
||||||
|
@ -24,7 +24,7 @@ emconfigure ./configure --host i686-linux \
|
||||||
--enable-websockets --disable-ftp --disable-file --disable-gopher \
|
--enable-websockets --disable-ftp --disable-file --disable-gopher \
|
||||||
--disable-imap --disable-mqtt --disable-pop3 --disable-rtsp \
|
--disable-imap --disable-mqtt --disable-pop3 --disable-rtsp \
|
||||||
--disable-smb --disable-smtp --disable-telnet --disable-dict \
|
--disable-smb --disable-smtp --disable-telnet --disable-dict \
|
||||||
--with-wolfssl=$WOLFSSL_PREFIX --with-zlib=$ZLIB_PREFIX \
|
--with-mbedtls=$MBEDTLS_PREFIX --with-zlib=$ZLIB_PREFIX \
|
||||||
--with-brotli=$BROTLI_PREFIX --with-nghttp2=$NGHTTP2_PREFIX
|
--with-brotli=$BROTLI_PREFIX --with-nghttp2=$NGHTTP2_PREFIX
|
||||||
|
|
||||||
emmake make -j$CORE_COUNT CFLAGS="-Oz" LIBS="-lbrotlicommon"
|
emmake make -j$CORE_COUNT CFLAGS="-Oz" LIBS="-lbrotlicommon"
|
||||||
|
|
26
client/tools/mbedtls.sh
Executable file
26
client/tools/mbedtls.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#compile mbedtls for use with emscripten
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
CORE_COUNT=$(nproc --all)
|
||||||
|
PREFIX=$(realpath build/mbedtls-wasm)
|
||||||
|
rm -rf $PREFIX
|
||||||
|
mkdir -p $PREFIX
|
||||||
|
|
||||||
|
cd build
|
||||||
|
rm -rf mbedtls
|
||||||
|
git clone -b mbedtls-3.6.2 --recursive --depth=1 https://github.com/Mbed-TLS/mbedtls mbedtls
|
||||||
|
cd mbedtls
|
||||||
|
|
||||||
|
emmake make CFLAGS="-Oz" no_test -j$CORE_COUNT
|
||||||
|
make DESTDIR="$PREFIX" install
|
||||||
|
|
||||||
|
rm -rf $PREFIX/bin
|
||||||
|
rm -rf $PREFIX/share
|
||||||
|
rm -rf $PREFIX/lib/pkgconfig
|
||||||
|
rm -rf $PREFIX/lib/*.la
|
||||||
|
|
||||||
|
cd ../../
|
0
client/tools/patch_js.py
Normal file → Executable file
0
client/tools/patch_js.py
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue