Change the patch position for -release module suffix

This commit is contained in:
crazywhalecc 2025-06-20 18:20:58 +08:00 committed by Jerry Ma
parent 6c47065686
commit 1b4eb039ae
2 changed files with 14 additions and 13 deletions

View File

@ -215,19 +215,6 @@ abstract class LibraryBase
*/
public function tryBuild(bool $force_build = false): int
{
if (str_contains((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), '-release')) {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef CONFIGURE_COMMAND',
'#ifdef NO_CONFIGURE_COMMAND',
);
} else {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef NO_CONFIGURE_COMMAND',
'#ifdef CONFIGURE_COMMAND',
);
}
if (file_exists($this->source_dir . '/.spc.patched')) {
$this->patched = true;
}

View File

@ -278,6 +278,20 @@ class SourcePatcher
logger()->info("Library [{$lib->getName()}] patched before make");
}
}
if (str_contains((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), '-release')) {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef CONFIGURE_COMMAND',
'#ifdef NO_CONFIGURE_COMMAND',
);
} else {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef NO_CONFIGURE_COMMAND',
'#ifdef CONFIGURE_COMMAND',
);
}
}
/**