DubbleClick 6f68d7b7f1 Revert "add cache file option to autoconf executor by default (if cflags and ldflags match default)"
This reverts commit 5577cd0fab770028fb5cad9560ac8750c4c53182.
2025-07-02 12:55:59 +07:00

38 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
trait gettext
{
protected function build(): void
{
$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
if ($this->builder->getOption('enable-zts')) {
$autoconf->addConfigureArgs('--enable-threads=isoc+posix')
->appendEnv([
'CFLAGS' => '-lpthread -D_REENTRANT',
'LDFLGAS' => '-lpthread',
]);
} else {
$autoconf->addConfigureArgs('--disable-threads');
}
$autoconf->configure()->make();
$this->patchLaDependencyPrefix();
}
}