29 lines
826 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;
}
protected function getStaticAndSharedLibs(string $allLibs): array
{
[$static, $shared] = parent::getStaticAndSharedLibs($allLibs);
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
$static .= ' -l:libstdc++.a';
$shared = str_replace('-lstdc++', '', $shared);
}
return [deduplicate_spaces($static), deduplicate_spaces($shared)];
}
}