mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +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:
@@ -4,36 +4,34 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait gettext
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
$extra = $this->builder->getLib('ncurses') ? ('--with-libncurses-prefix=' . BUILD_ROOT_PATH . ' ') : '';
|
||||
$extra .= $this->builder->getLib('libxml2') ? ('--with-libxml2-prefix=' . BUILD_ROOT_PATH . ' ') : '';
|
||||
$autoconf = UnixAutoconfExecutor::create($this)
|
||||
->optionalLib('ncurses', "--with-libncurses-prefix={$this->getBuildRootPath()}")
|
||||
->optionalLib('libxml2', "--with-libxml2-prefix={$this->getBuildRootPath()}")
|
||||
->addConfigureArgs(
|
||||
'--disable-java',
|
||||
'--disable-c++',
|
||||
'--with-included-gettext',
|
||||
"--with-iconv-prefix={$this->getBuildRootPath()}",
|
||||
);
|
||||
|
||||
$zts = $this->builder->getOption('enable-zts') ? '--enable-threads=isoc+posix ' : '--disable-threads ';
|
||||
// zts
|
||||
if ($this->builder->getOption('enable-zts')) {
|
||||
$autoconf->addConfigureArgs('--enable-threads=isoc+posix')
|
||||
->appendEnv([
|
||||
'CFLAGS' => '-lpthread -D_REENTRANT',
|
||||
'LDFLGAS' => '-lpthread',
|
||||
]);
|
||||
} else {
|
||||
$autoconf->addConfigureArgs('--disable-threads');
|
||||
}
|
||||
|
||||
$cflags = $this->builder->getOption('enable-zts') ? '-lpthread -D_REENTRANT' : '';
|
||||
$ldflags = $this->builder->getOption('enable-zts') ? '-lpthread' : '';
|
||||
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->appendEnv(['CFLAGS' => $cflags, 'LDFLAGS' => $ldflags])
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-pic ' .
|
||||
'--disable-java ' .
|
||||
'--disable-c++ ' .
|
||||
$zts .
|
||||
$extra .
|
||||
'--with-included-gettext ' .
|
||||
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
|
||||
'--prefix=' . BUILD_ROOT_PATH
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
$autoconf->configure()->make(with_clean: true);
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user