mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
35 lines
872 B
PHP
35 lines
872 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
use SPC\builder\Extension;
|
|
use SPC\store\FileSystem;
|
|
use SPC\util\CustomExt;
|
|
|
|
#[CustomExt('decimal')]
|
|
class decimal extends Extension
|
|
{
|
|
// TODO: remove this when https://github.com/php-decimal/ext-decimal/issues/92 is merged
|
|
public function patchBeforeBuildconf(): bool
|
|
{
|
|
FileSystem::replaceFileStr(
|
|
$this->source_dir . '/php_decimal.c',
|
|
'zend_module_entry decimal_module_entry',
|
|
'zend_module_entry php_decimal_module_entry'
|
|
);
|
|
return true;
|
|
}
|
|
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
|
{
|
|
return '--enable-decimal --with-libmpdec-path="' . BUILD_ROOT_PATH . '"';
|
|
}
|
|
|
|
public function getWindowsConfigureArg(bool $shared = false): string
|
|
{
|
|
return '--with-decimal';
|
|
}
|
|
}
|