From 4f5177d57e794c7111733e598aa59c2e969c3cd3 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 8 Aug 2024 01:12:07 +0800 Subject: [PATCH] Add libcares support for curl --- config/lib.json | 3 ++- src/SPC/builder/unix/library/curl.php | 2 ++ src/globals/test-extensions.php | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/lib.json b/config/lib.json index 84441f52..55f1d683 100644 --- a/config/lib.json +++ b/config/lib.json @@ -53,7 +53,8 @@ "libssh2", "brotli", "nghttp2", - "zstd" + "zstd", + "libcares" ], "lib-suggests-windows": [ "brotli", diff --git a/src/SPC/builder/unix/library/curl.php b/src/SPC/builder/unix/library/curl.php index 1ace7218..e01bec2c 100644 --- a/src/SPC/builder/unix/library/curl.php +++ b/src/SPC/builder/unix/library/curl.php @@ -47,6 +47,8 @@ trait curl $extra .= $this->builder->getLib('idn2') ? '-DUSE_LIBIDN2=ON ' : '-DUSE_LIBIDN2=OFF '; // lib:psl $extra .= $this->builder->getLib('psl') ? '-DCURL_USE_LIBPSL=ON ' : '-DCURL_USE_LIBPSL=OFF '; + // lib:libcares + $extra .= $this->builder->getLib('libcares') ? '-DENABLE_ARES=ON ' : ''; FileSystem::resetDir($this->source_dir . '/build'); // compile! diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 8a803a5b..cda5e636 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -19,13 +19,13 @@ $upx = true; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'imap,swoole,openssl,rar', + 'Linux', 'Darwin' => 'curl', 'Windows' => 'amqp,apcu', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => '', + 'Linux', 'Darwin' => 'libcares', 'Windows' => '', };