Forward-port #1089

This commit is contained in:
crazywhalecc
2026-05-06 14:43:37 +08:00
parent 90d7fe46d7
commit ecf10bec7c

View File

@@ -61,6 +61,19 @@ trait unix
}
}
#[BeforeStage('php', [self::class, 'configureForUnix'], 'php')]
#[PatchDescription('Patch configure to use -std=gnu17 instead of -std=gnu23 for PHP <= 8.2')]
public function patchBeforeConfigure(TargetPackage $package): void
{
if (SystemTarget::isUnix() && self::getPHPVersionID() < 80300) {
FileSystem::replaceFileStr(
"{$package->getSourceDir()}/configure",
"for ac_arg in '' -std=gnu23",
"for ac_arg in '' -std=gnu17",
);
}
}
#[Stage]
public function buildconfForUnix(TargetPackage $package): void
{