fix xz shared build

This commit is contained in:
henderkes 2026-02-20 13:05:49 +07:00
parent fa670cce4a
commit 17d699d4a5
2 changed files with 9 additions and 2 deletions

View File

@ -10,7 +10,14 @@ trait xz
{
public function build(): void
{
UnixAutoconfExecutor::create($this)
$make = UnixAutoconfExecutor::create($this);
if (!getenv('SPC_LINK_STATIC')) {
// liblzma can only build one of static or shared at a time
$make
->removeConfigureArgs('--enable-static')
->addConfigureArgs('--disable-static');
}
$make
->configure(
'--disable-scripts',
'--disable-doc',

View File

@ -283,7 +283,7 @@ class SPCConfigUtil
$libs = array_reverse(Config::getLib($library, 'static-libs', []));
foreach ($libs as $lib) {
// check file existence
if (!file_exists(BUILD_LIB_PATH . "/{$lib}")) {
if (!file_exists(BUILD_LIB_PATH . "/{$lib}") && getenv('SPC_LINK_STATIC')) {
throw new WrongUsageException("Library file '{$lib}' for lib [{$library}] does not exist in '" . BUILD_LIB_PATH . "'. Please build it first.");
}
$lib_names[] = $this->getShortLibName($lib);