mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Revert "add cache file option to autoconf executor by default (if cflags and ldflags match default)"
This reverts commit 5577cd0fab.
This commit is contained in:
@@ -32,13 +32,6 @@ class UnixAutoconfExecutor extends Executor
|
||||
// remove all the ignored args
|
||||
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
|
||||
$args = array_diff($args, $this->ignore_args);
|
||||
$args = array_filter(
|
||||
$args,
|
||||
fn ($arg) => !array_filter(
|
||||
$this->ignore_args,
|
||||
fn ($ignore) => str_starts_with($arg, $ignore . '=')
|
||||
)
|
||||
);
|
||||
$configure_args = implode(' ', $args);
|
||||
|
||||
$this->shell->exec("./configure {$configure_args}");
|
||||
@@ -126,23 +119,13 @@ class UnixAutoconfExecutor extends Executor
|
||||
*/
|
||||
private function getDefaultConfigureArgs(): array
|
||||
{
|
||||
$args = [
|
||||
return [
|
||||
'--disable-shared',
|
||||
'--enable-static',
|
||||
"--prefix={$this->library->getBuildRootPath()}",
|
||||
'--with-pic',
|
||||
'--enable-pic',
|
||||
];
|
||||
|
||||
// only add the cache file if CFLAGS and LDFLAGS are defaulted
|
||||
$env = $this->shell->getEnv();
|
||||
$expected_cflags = '-I' . BUILD_INCLUDE_PATH . ' ' . getenv('SPC_DEFAULT_C_FLAGS');
|
||||
$expected_ldflags = '-L' . BUILD_LIB_PATH;
|
||||
|
||||
if (($env['CFLAGS'] ?? '') === $expected_cflags && ($env['LDFLAGS'] ?? '') === $expected_ldflags) {
|
||||
$args[] = '--cache-file=' . BUILD_ROOT_PATH . '/config.cache';
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user