mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add -lpthread and -ldl in openssl::getStaticLibFiles
This commit is contained in:
parent
92ad792eff
commit
617b0de31f
@ -654,7 +654,8 @@
|
|||||||
"openssl"
|
"openssl"
|
||||||
],
|
],
|
||||||
"lib-suggests": [
|
"lib-suggests": [
|
||||||
"nghttp3"
|
"nghttp3",
|
||||||
|
"brotli"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"onig": {
|
"onig": {
|
||||||
|
|||||||
@ -92,4 +92,13 @@ class openssl extends LinuxLibraryBase
|
|||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true): string
|
||||||
|
{
|
||||||
|
$libFiles = parent::getStaticLibFiles($style, $recursive);
|
||||||
|
if (!str_contains('-ldl -lpthread', $libFiles)) {
|
||||||
|
$libFiles .= ' -ldl -lpthread';
|
||||||
|
}
|
||||||
|
return $libFiles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
foreach ($lib_specs as $libName => $arr) {
|
foreach ($lib_specs as $libName => $arr) {
|
||||||
$lib = $this->getLib($libName);
|
$lib = $this->getLib($libName);
|
||||||
if ($lib === null && str_starts_with($libName, 'lib')) {
|
if ($lib === null && str_starts_with($libName, 'lib')) {
|
||||||
$lib = $this->getExt(substr($libName, 3));
|
$lib = $this->getLib(substr($libName, 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
$arr = $arr ?? [];
|
$arr = $arr ?? [];
|
||||||
|
|||||||
@ -23,8 +23,9 @@ trait ngtcp2
|
|||||||
'jemalloc' => null,
|
'jemalloc' => null,
|
||||||
'libnghttp3' => null,
|
'libnghttp3' => null,
|
||||||
]);
|
]);
|
||||||
if (PHP_OS_FAMILY === 'Linux') {
|
if ($brotli = $this->builder->getLib('brotli')) {
|
||||||
$args = preg_replace('/OPENSSL_LIBS="(.*?)"/', 'OPENSSL_LIBS="\1 -lpthread -ldl"', $args);
|
$args .= ' --with-libbrotlidec=yes LIBBROTLIDEC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIDEC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||||
|
$args .= ' --with-libbrotlienc=yes LIBBROTLIENC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIENC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
shell()->cd($this->source_dir)
|
shell()->cd($this->source_dir)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user