Skip to content

Commit

Permalink
[curlBuild] build curl and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Haldir65 committed Apr 8, 2024
1 parent bad7356 commit 756e5b8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_curl_http3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
if: startsWith(matrix.target.id, 'linux-')
shell: bash
run: |
sudo apt install ninja-build build-essential autoconf automake tree clang coreutils libidn2-0-dev pkg-config -y
sudo apt install ninja-build build-essential autoconf automake tree clang cmake coreutils libidn2-0-dev pkg-config -y
echo "cpu core num is "
nproc
Expand Down
18 changes: 18 additions & 0 deletions scripts/build_curl_http3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,26 @@ function _build_curl(){
}

function test_curl(){
cd $now_dir
_purple "reset http_proxy since HTTP/3 is not supported over a HTTP proxy \n"
export http_proxy=""; export https_proxy=""

_purple "try grab binary using our curl \n"
${curl_http3_dir}/bin/curl -L https://github.com/fmtlib/fmt/archive/refs/tags/9.1.0.tar.gz -o fmt-9.1.0.tar.gz
tar -xzf fmt-9.1.0.tar.gz
tree -L 4 fmt-9.1.0
local BUILD_DIR=build
mkdir -p fmt_build
_orange "CC = ${CC}\n"
_orange "CXX = ${CXX}\n"
pushd fmt-9.1.0
cmake -S . -G Ninja -DCMAKE_INSTALL_PREFIX=$now_dir/fmt_build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_STANDARD=17 -DUSE_SANITIZER=address -B "$BUILD_DIR"
_green "configure cmake done \n"
cmake --build "$BUILD_DIR" --target install
_green "build and install via cmake done \n"
popd
rm -rf fmt-9.1.0

${curl_http3_dir}/bin/curl --http3-only https://www.google.com -v
${curl_http3_dir}/bin/curl --http3-only https://nghttp2.org -v
${curl_http3_dir}/bin/curl -V
Expand Down
1 change: 1 addition & 0 deletions scripts/build_curl_http3_openwrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ function _build_curl(){
PKG_CONFIG_PATH=$ngtcp_install_dir/lib/pkgconfig \
--with-zlib=$prebuilt_zlib_root \
--with-zstd=$prebuilt_zstd_root \
--with-libps=$prebuilt_psl_root \
--with-openssl=$quictls_install_dir \
--with-nghttp3=$nghttp3_install_dir \
--with-ngtcp2=$ngtcp_install_dir \
Expand Down
2 changes: 1 addition & 1 deletion scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function _download_if_not_exists(){
local url=$1
local FILE=$2
if [ ! -f "$FILE" ]; then
_blue "$FILE already exists\n"
_blue "$FILE doesn't exists\n"
wget $url -O $FILE
else
_green "$FILE already exists\n"
Expand Down

0 comments on commit 756e5b8

Please sign in to comment.