mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
Merge remote-tracking branch 'origin/fix/icurel' into fix/icurel
# Conflicts: # src/SPC/builder/unix/library/gettext.php # src/SPC/builder/unix/library/libiconv.php # src/SPC/builder/unix/library/libxslt.php
This commit is contained in:
@@ -10,9 +10,9 @@ class curl extends LinuxLibraryBase
|
||||
|
||||
public const NAME = 'curl';
|
||||
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true): string
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true, bool $include_self = true): string
|
||||
{
|
||||
$libs = parent::getStaticLibFiles($style, $recursive);
|
||||
$libs = parent::getStaticLibFiles($style, $recursive, $include_self);
|
||||
if ($this->builder->getLib('openssl')) {
|
||||
$libs .= ' -ldl -lpthread';
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libffi extends LinuxLibraryBase
|
||||
{
|
||||
@@ -17,24 +18,14 @@ class libffi extends LinuxLibraryBase
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
[$lib, , $destdir] = SEPARATED_PATH;
|
||||
$arch = getenv('SPC_ARCH');
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->initializeEnv($this)
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--with-pic ' .
|
||||
"--host={$arch}-unknown-linux " .
|
||||
"--target={$arch}-unknown-linux " .
|
||||
'--prefix= ' .
|
||||
"--libdir={$lib}"
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->configure(
|
||||
"--host={$arch}-unknown-linux",
|
||||
"--target={$arch}-unknown-linux",
|
||||
"--libdir={$this->getLibDir()}"
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec("make install DESTDIR={$destdir}");
|
||||
->make();
|
||||
|
||||
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
||||
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace SPC\builder\linux\library;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libpng extends LinuxLibraryBase
|
||||
{
|
||||
@@ -36,28 +37,21 @@ class libpng extends LinuxLibraryBase
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
$optimizations = match (getenv('SPC_ARCH')) {
|
||||
'x86_64' => '--enable-intel-sse ',
|
||||
'aarch64' => '--enable-arm-neon ',
|
||||
default => '',
|
||||
};
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->exec('chmod +x ./configure')
|
||||
->exec('chmod +x ./install-sh')
|
||||
->exec(
|
||||
'LDFLAGS="-L' . BUILD_LIB_PATH . '" ' .
|
||||
'./configure ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-static ' .
|
||||
'--with-pic ' .
|
||||
'--enable-hardware-optimizations ' .
|
||||
'--with-zlib-prefix="' . BUILD_ROOT_PATH . '" ' .
|
||||
$optimizations .
|
||||
'--prefix='
|
||||
->appendEnv(['LDFLAGS' => "-L{$this->getLibDir()}"])
|
||||
->configure(
|
||||
'--enable-hardware-optimizations',
|
||||
"--with-zlib-prefix={$this->getBuildRootPath()}",
|
||||
match (getenv('SPC_ARCH')) {
|
||||
'x86_64' => '--enable-intel-sse',
|
||||
'aarch64' => '--enable-arm-neon',
|
||||
default => '',
|
||||
}
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
|
||||
->exec('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
|
||||
->make('libpng16.la', 'install-libLTLIBRARIES install-data-am', after_env_vars: ['DEFAULT_INCLUDES' => "-I{$this->source_dir} -I{$this->getIncludeDir()}"]);
|
||||
|
||||
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ class openssl extends LinuxLibraryBase
|
||||
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
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true, bool $include_self = true): string
|
||||
{
|
||||
$libFiles = parent::getStaticLibFiles($style, $recursive);
|
||||
$libFiles = parent::getStaticLibFiles($style, $recursive, $include_self);
|
||||
if (!str_contains('-ldl -lpthread', $libFiles)) {
|
||||
$libFiles .= ' -ldl -lpthread';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user