mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 22:40:01 -04:00
remove wolfssl and nghttp2 entirely
This commit is contained in:
parent
c1b78e1d0c
commit
bcda300153
10 changed files with 12 additions and 77 deletions
|
@ -27,7 +27,7 @@ EXPORTED_FUNCS="${EXPORTED_FUNCS:1}"
|
|||
|
||||
#compile options
|
||||
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 -lcjson -lz -lbrotlidec -lbrotlicommon -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"
|
||||
|
||||
#clean output dir
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/* DELETE
|
||||
assert\(sock\.stream\.fd ?< ?64\);
|
||||
*/
|
||||
|
||||
|
||||
/* DELETE
|
||||
assert\(!exceptfds, ?['"]exceptfds not supported['"]\);
|
||||
*/
|
||||
|
|
|
@ -2,9 +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:
|
||||
- libcurl: curl License (https://curl.se/docs/copyright.html)
|
||||
- wolfssl: GNU GPL v2 (https://github.com/wolfSSL/wolfssl/blob/master/COPYING)
|
||||
- cjson: MIT License (https://github.com/DaveGamble/cJSON/blob/master/LICENSE)
|
||||
- zlib: zlib License (https://www.zlib.net/zlib_license.html)
|
||||
- brotli: MIT License (https://github.com/google/brotli/blob/master/LICENSE)
|
||||
- nghttp2: MIT License (https://github.com/nghttp2/nghttp2/blob/master/COPYING)
|
||||
`;
|
|
@ -14,7 +14,7 @@ void http_set_options(CURL* http_handle, const char* json_params, const char* bo
|
|||
//some default options
|
||||
curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(http_handle, CURLOPT_ACCEPT_ENCODING, "");
|
||||
curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||
|
||||
//parse json options
|
||||
cJSON* request_json = cJSON_Parse(json_params);
|
||||
|
|
|
@ -21,14 +21,10 @@ char* get_version() {
|
|||
}
|
||||
|
||||
cJSON* curl_version_item = cJSON_CreateString(version_info->version);
|
||||
cJSON* ssl_version_item = cJSON_CreateString(version_info->ssl_version);
|
||||
cJSON* brotli_version_item = cJSON_CreateString(version_info->brotli_version);
|
||||
cJSON* nghttp2_version_item = cJSON_CreateString(version_info->nghttp2_version);
|
||||
|
||||
cJSON_AddItemToObject(version_json, "curl", curl_version_item);
|
||||
cJSON_AddItemToObject(version_json, "ssl", ssl_version_item);
|
||||
cJSON_AddItemToObject(version_json, "brotli", brotli_version_item);
|
||||
cJSON_AddItemToObject(version_json, "nghttp2", nghttp2_version_item);
|
||||
cJSON_AddItemToObject(version_json, "protocols", protocols_array);
|
||||
|
||||
char* version_json_str = cJSON_Print(version_json);
|
||||
|
|
|
@ -5,16 +5,11 @@
|
|||
set -e
|
||||
mkdir -p build
|
||||
|
||||
WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm)
|
||||
CJSON_PREFIX=$(realpath build/cjson-wasm)
|
||||
CURL_PREFIX=$(realpath build/curl-wasm)
|
||||
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
||||
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
||||
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
||||
|
||||
if [ ! -d $WOLFSSL_PREFIX ]; then
|
||||
tools/wolfssl.sh
|
||||
fi
|
||||
if [ ! -d $CJSON_PREFIX ]; then
|
||||
tools/cjson.sh
|
||||
fi
|
||||
|
@ -24,15 +19,10 @@ fi
|
|||
if [ ! -d $BROTLI_PREFIX ]; then
|
||||
tools/brotli.sh
|
||||
fi
|
||||
if [ ! -d $NGHTTP2_PREFIX ]; then
|
||||
tools/nghttp2.sh
|
||||
fi
|
||||
if [ ! -d $CURL_PREFIX ]; then
|
||||
tools/curl.sh
|
||||
fi
|
||||
|
||||
cp -r $WOLFSSL_PREFIX/* $CURL_PREFIX
|
||||
cp -r $CJSON_PREFIX/* $CURL_PREFIX
|
||||
cp -r $ZLIB_PREFIX/* $CURL_PREFIX
|
||||
cp -r $BROTLI_PREFIX/* $CURL_PREFIX
|
||||
cp -r $NGHTTP2_PREFIX/* $CURL_PREFIX
|
|
@ -7,14 +7,12 @@ set -e
|
|||
|
||||
CORE_COUNT=$(nproc --all)
|
||||
PREFIX=$(realpath build/curl-wasm)
|
||||
WOLFSSL_PREFIX=$(realpath build/wolfssl-wasm)
|
||||
ZLIB_PREFIX=$(realpath build/zlib-wasm)
|
||||
BROTLI_PREFIX=$(realpath build/brotli-wasm)
|
||||
NGHTTP2_PREFIX=$(realpath build/nghttp2-wasm)
|
||||
|
||||
cd build
|
||||
rm -rf curl
|
||||
git clone -b curl-8_9_1 --depth=1 https://github.com/curl/curl
|
||||
git clone -b curl-8_10_1 --depth=1 https://github.com/curl/curl
|
||||
cd curl
|
||||
|
||||
autoreconf -fi
|
||||
|
@ -24,8 +22,8 @@ emconfigure ./configure --host i686-linux \
|
|||
--enable-websockets --disable-ftp --disable-file --disable-gopher \
|
||||
--disable-imap --disable-mqtt --disable-pop3 --disable-rtsp \
|
||||
--disable-smb --disable-smtp --disable-telnet --disable-dict \
|
||||
--with-wolfssl=$WOLFSSL_PREFIX --with-zlib=$ZLIB_PREFIX \
|
||||
--with-brotli=$BROTLI_PREFIX --with-nghttp2=$NGHTTP2_PREFIX
|
||||
--with-zlib=$ZLIB_PREFIX --with-brotli=$BROTLI_PREFIX \
|
||||
--without-ssl
|
||||
|
||||
emmake make -j$CORE_COUNT CFLAGS="-Oz" LIBS="-lbrotlicommon"
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#compile nghttp2 for use with emscripten
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
CORE_COUNT=$(nproc --all)
|
||||
PREFIX=$(realpath build/nghttp2-wasm)
|
||||
|
||||
cd build
|
||||
rm -rf nghttp2
|
||||
git clone -b v1.63.0 --depth=1 https://github.com/nghttp2/nghttp2
|
||||
cd nghttp2
|
||||
|
||||
rm -rf $PREFIX
|
||||
mkdir -p $PREFIX
|
||||
|
||||
autoreconf -fi
|
||||
emconfigure ./configure --host i686-linux --enable-static --disable-shared --enable-lib-only --prefix=$PREFIX
|
||||
emmake make -j$CORE_COUNT
|
||||
make install
|
||||
|
||||
cd ../../
|
|
@ -1,29 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#compile wolfssl for use with emscripten
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
CORE_COUNT=$(nproc --all)
|
||||
PREFIX=$(realpath build/wolfssl-wasm)
|
||||
rm -rf $PREFIX
|
||||
mkdir -p $PREFIX
|
||||
|
||||
cd build
|
||||
rm -rf wolfssl
|
||||
git clone -b v5.6.6-stable --depth=1 https://github.com/wolfSSL/wolfssl wolfssl
|
||||
cd wolfssl
|
||||
|
||||
autoreconf -fi
|
||||
export CFLAGS="-Oz -DSP_WORD_SIZE=32 -DWOLFSSL_NO_ATOMICS -DWOLFSSL_TICKET_NONCE_MALLOC"
|
||||
emconfigure ./configure --prefix=$PREFIX --enable-curl --enable-static --disable-shared --host=i686-linux --disable-examples --disable-asm --enable-sni --enable-alpn --enable-truncatedhmac --enable-oldtls --enable-tlsv12 --enable-all-crypto --disable-asyncthreads --disable-threadlocal --enable-tlsx
|
||||
emmake make -j$CORE_COUNT
|
||||
make install
|
||||
|
||||
rm -rf $PREFIX/bin
|
||||
rm -rf $PREFIX/share
|
||||
rm -rf $PREFIX/lib/pkgconfig
|
||||
rm -rf $PREFIX/lib/*.la
|
||||
|
||||
cd ../../
|
Loading…
Add table
Add a link
Reference in a new issue