mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add ignoreConfigureArgs for UnixAutoconfExecutor
This commit is contained in:
parent
9e8119e69c
commit
6cb2cdd5a2
@ -25,6 +25,10 @@ trait librdkafka
|
||||
},
|
||||
'--disable-zstd'
|
||||
)
|
||||
->ignoreConfigureArgs(
|
||||
'--with-pic',
|
||||
'--enable-pic',
|
||||
)
|
||||
->configure(
|
||||
'--disable-curl',
|
||||
'--disable-sasl',
|
||||
|
||||
@ -16,6 +16,8 @@ class UnixAutoconfExecutor extends Executor
|
||||
|
||||
protected array $configure_args = [];
|
||||
|
||||
protected array $ignore_args = [];
|
||||
|
||||
public function __construct(protected BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $library)
|
||||
{
|
||||
parent::__construct($library);
|
||||
@ -27,7 +29,10 @@ class UnixAutoconfExecutor extends Executor
|
||||
*/
|
||||
public function configure(...$args): static
|
||||
{
|
||||
$configure_args = implode(' ', array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args));
|
||||
// remove all the ignored args
|
||||
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
|
||||
$args = array_diff($args, $this->ignore_args);
|
||||
$configure_args = implode(' ', $args);
|
||||
|
||||
$this->shell->exec("./configure {$configure_args}");
|
||||
return $this;
|
||||
@ -92,6 +97,15 @@ class UnixAutoconfExecutor extends Executor
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore some configure args, to bypass the configure option checking for some libs.
|
||||
*/
|
||||
public function ignoreConfigureArgs(...$args): static
|
||||
{
|
||||
$this->ignore_args = [...$this->ignore_args, ...$args];
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function appendEnv(array $env): static
|
||||
{
|
||||
$this->shell->appendEnv($env);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user