2024-02-16 01:28:10 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
|
|
|
|
|
2024-02-16 01:28:10 +08:00
|
|
|
trait gettext
|
|
|
|
|
{
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2025-06-09 19:32:31 +08:00
|
|
|
$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()}",
|
|
|
|
|
);
|
2025-02-10 21:28:00 +09:00
|
|
|
|
2025-06-09 19:32:31 +08:00
|
|
|
// 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');
|
|
|
|
|
}
|
2025-02-10 21:28:00 +09:00
|
|
|
|
2025-06-24 13:17:43 +07:00
|
|
|
$autoconf->configure()->make();
|
2025-06-10 19:46:55 +07:00
|
|
|
$this->patchLaDependencyPrefix();
|
2024-02-16 01:28:10 +08:00
|
|
|
}
|
|
|
|
|
}
|