Skip to content

Commit 2277390

Browse files
committed
fix removeConfigureArgs in UnixAutoconfExecutor.php
1 parent f93ad27 commit 2277390

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/SPC/util/executor/UnixAutoconfExecutor.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,24 @@ class UnixAutoconfExecutor extends Executor
1616

1717
protected array $configure_args = [];
1818

19-
protected array $ignore_args = [];
20-
2119
public function __construct(protected BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $library)
2220
{
2321
parent::__construct($library);
2422
$this->initShell();
23+
$this->configure_args = $this->getDefaultConfigureArgs();
2524
}
2625

2726
/**
2827
* Run ./configure
2928
*/
3029
public function configure(...$args): static
3130
{
32-
// remove all the ignored args
33-
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
34-
$args = array_diff($args, $this->ignore_args);
31+
$args = array_merge($args, $this->configure_args);
3532
$configure_args = implode(' ', $args);
3633

3734
return $this->seekLogFileOnException(fn () => $this->shell->exec("./configure {$configure_args}"));
3835
}
3936

40-
public function getConfigureArgsString(): string
41-
{
42-
return implode(' ', array_merge($this->getDefaultConfigureArgs(), $this->configure_args));
43-
}
44-
4537
/**
4638
* Run make
4739
*
@@ -111,7 +103,7 @@ public function addConfigureArgs(...$args): static
111103
*/
112104
public function removeConfigureArgs(...$args): static
113105
{
114-
$this->ignore_args = [...$this->ignore_args, ...$args];
106+
$this->configure_args = array_diff($this->configure_args, $args);
115107
return $this;
116108
}
117109

@@ -133,8 +125,8 @@ public function appendEnv(array $env): static
133125
private function getDefaultConfigureArgs(): array
134126
{
135127
return [
136-
'--disable-shared',
137128
'--enable-static',
129+
'--disable-shared',
138130
"--prefix={$this->library->getBuildRootPath()}",
139131
'--with-pic',
140132
'--enable-pic',

0 commit comments

Comments
 (0)