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