29 lines
873 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('imagick')]
class imagick extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
2025-06-28 17:13:22 +08:00
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
2025-05-22 12:28:00 +07:00
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
}
2025-07-25 16:18:04 +07:00
protected function splitLibsIntoStaticAndShared(string $allLibs): array
{
2025-07-25 16:18:04 +07:00
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
2025-08-19 20:03:16 +07:00
if (str_contains(getenv('PATH'), 'rh/devtoolset') || str_contains(getenv('PATH'), 'rh/gcc-toolset')) {
$static .= ' -l:libstdc++.a';
$shared = str_replace('-lstdc++', '', $shared);
}
2025-07-25 10:04:06 +07:00
return [clean_spaces($static), clean_spaces($shared)];
}
}