2023-05-10 02:04:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
2025-07-01 15:58:04 +07:00
|
|
|
use SPC\builder\linux\SystemUtil;
|
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-01 15:58:04 +07:00
|
|
|
|
|
|
|
|
protected function getStaticAndSharedLibs(): array
|
|
|
|
|
{
|
|
|
|
|
[$static, $shared] = parent::getStaticAndSharedLibs();
|
|
|
|
|
if (SystemUtil::getLibcVersionIfExists('glibc') && SystemUtil::getLibcVersionIfExists('glibc') <= '2.17') {
|
|
|
|
|
$static .= ' -lstdc++';
|
|
|
|
|
$shared = str_replace('-lstdc++', '', $shared);
|
|
|
|
|
}
|
|
|
|
|
return [$static, $shared];
|
|
|
|
|
}
|
2023-05-10 02:04:08 +08:00
|
|
|
}
|