2023-05-10 02:04:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
2025-12-01 17:28:59 +01:00
|
|
|
use SPC\toolchain\ToolchainManager;
|
|
|
|
|
use SPC\toolchain\ZigToolchain;
|
2023-05-10 02:04:08 +08:00
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('imagick')]
|
|
|
|
|
class imagick extends Extension
|
|
|
|
|
{
|
2025-03-27 11:12:19 +07:00
|
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
2023-05-10 02:04:08 +08:00
|
|
|
{
|
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;
|
2023-05-10 02:04:08 +08:00
|
|
|
}
|
2025-07-25 09:59:24 +07:00
|
|
|
|
2025-07-25 16:18:04 +07:00
|
|
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
2025-07-25 09:59:24 +07:00
|
|
|
{
|
2025-07-25 16:18:04 +07:00
|
|
|
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
|
2025-12-01 19:12:43 +01:00
|
|
|
if (ToolchainManager::getToolchainClass() !== ZigToolchain::class &&
|
|
|
|
|
(str_contains(getenv('PATH'), 'rh/devtoolset') || str_contains(getenv('PATH'), 'rh/gcc-toolset'))
|
|
|
|
|
) {
|
2025-07-25 09:59:24 +07:00
|
|
|
$static .= ' -l:libstdc++.a';
|
|
|
|
|
$shared = str_replace('-lstdc++', '', $shared);
|
|
|
|
|
}
|
2025-07-25 10:04:06 +07:00
|
|
|
return [clean_spaces($static), clean_spaces($shared)];
|
2025-07-25 09:59:24 +07:00
|
|
|
}
|
2023-05-10 02:04:08 +08:00
|
|
|
}
|