Looks like ngtcp2 does not happy with pkg-config

This commit is contained in:
crazywhalecc 2025-07-22 22:25:46 +08:00
parent 4cdafe2497
commit dea3c4afeb
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\builder\macos\library\MacOSLibraryBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
@ -19,17 +21,23 @@ trait ngtcp2
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->optionalLib('openssl', fn ($lib) => implode(' ', [
->optionalLib('openssl', fn (LinuxLibraryBase|MacOSLibraryBase $lib) => implode(' ', [
'--with-openssl=yes',
"OPENSSL_LIBS=\"{$lib->getStaticLibFiles()}\"",
"OPENSSL_CFLAGS=\"-I{$lib->getIncludeDir()}\"",
]), '--with-openssl=no')
->optionalLib('libev', ...ac_with_args('libev', true))
->optionalLib('nghttp3', ...ac_with_args('libnghttp3', true))
->optionalLib('jemalloc', ...ac_with_args('jemalloc', true))
->optionalLib(
'brotli',
fn ($lib) => implode(' ', [
'--with-libbrotlidec=yes',
fn (LinuxLibraryBase|MacOSLibraryBase $lib) => implode(' ', [
'--with-brotlidec=yes',
"LIBBROTLIDEC_CFLAGS=\"-I{$lib->getIncludeDir()}\"",
"LIBBROTLIDEC_LIBS=\"{$lib->getStaticLibFiles()}\"",
'--with-libbrotlienc=yes',
"LIBBROTLIENC_CFLAGS=\"-I{$lib->getIncludeDir()}\"",
"LIBBROTLIENC_LIBS=\"{$lib->getStaticLibFiles()}\"",
])
)
->appendEnv(['PKG_CONFIG' => '$PKG_CONFIG --static'])