mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Revert "add cache file option to autoconf executor by default (if cflags and ldflags match default)"
This reverts commit 5577cd0fab770028fb5cad9560ac8750c4c53182.
This commit is contained in:
parent
abe27598de
commit
6f68d7b7f1
@ -18,8 +18,13 @@ class libffi extends LinuxLibraryBase
|
|||||||
*/
|
*/
|
||||||
public function build(): void
|
public function build(): void
|
||||||
{
|
{
|
||||||
|
$arch = getenv('SPC_ARCH');
|
||||||
UnixAutoconfExecutor::create($this)
|
UnixAutoconfExecutor::create($this)
|
||||||
->configure()
|
->configure(
|
||||||
|
"--host={$arch}-unknown-linux",
|
||||||
|
"--target={$arch}-unknown-linux",
|
||||||
|
"--libdir={$this->getLibDir()}"
|
||||||
|
)
|
||||||
->make();
|
->make();
|
||||||
|
|
||||||
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ trait gettext
|
|||||||
if ($this->builder->getOption('enable-zts')) {
|
if ($this->builder->getOption('enable-zts')) {
|
||||||
$autoconf->addConfigureArgs('--enable-threads=isoc+posix')
|
$autoconf->addConfigureArgs('--enable-threads=isoc+posix')
|
||||||
->appendEnv([
|
->appendEnv([
|
||||||
'CFLAGS' => '-D_REENTRANT',
|
'CFLAGS' => '-lpthread -D_REENTRANT',
|
||||||
'LDFLGAS' => '-lpthread',
|
'LDFLGAS' => '-lpthread',
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -17,7 +17,6 @@ trait unixodbc
|
|||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
UnixAutoconfExecutor::create($this)
|
UnixAutoconfExecutor::create($this)
|
||||||
->removeConfigureArgs('--cache-file')
|
|
||||||
->configure(
|
->configure(
|
||||||
'--disable-debug',
|
'--disable-debug',
|
||||||
'--disable-dependency-tracking',
|
'--disable-dependency-tracking',
|
||||||
|
|||||||
@ -32,13 +32,6 @@ class UnixAutoconfExecutor extends Executor
|
|||||||
// remove all the ignored args
|
// remove all the ignored args
|
||||||
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
|
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
|
||||||
$args = array_diff($args, $this->ignore_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);
|
$configure_args = implode(' ', $args);
|
||||||
|
|
||||||
$this->shell->exec("./configure {$configure_args}");
|
$this->shell->exec("./configure {$configure_args}");
|
||||||
@ -126,23 +119,13 @@ class UnixAutoconfExecutor extends Executor
|
|||||||
*/
|
*/
|
||||||
private function getDefaultConfigureArgs(): array
|
private function getDefaultConfigureArgs(): array
|
||||||
{
|
{
|
||||||
$args = [
|
return [
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--enable-static',
|
'--enable-static',
|
||||||
"--prefix={$this->library->getBuildRootPath()}",
|
"--prefix={$this->library->getBuildRootPath()}",
|
||||||
'--with-pic',
|
'--with-pic',
|
||||||
'--enable-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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user