better cross compile compatibility

This commit is contained in:
henderkes
2026-05-17 19:52:22 +07:00
parent 07aae79cae
commit 19d1379f7d
6 changed files with 58 additions and 13 deletions

View File

@@ -128,6 +128,10 @@ trait unix
$args[] = $installer->isPackageResolved('php-cgi') ? '--enable-cgi' : '--disable-cgi';
$embed_type = getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') ?: 'static';
$args[] = $installer->isPackageResolved('php-embed') ? "--enable-embed={$embed_type}" : '--disable-embed';
// Cross-compile: pass --host so configure picks the correct fiber asm file and host_cpu logic
if ($host_triple = SystemTarget::getAutoconfHostTriple()) {
$args[] = "--host={$host_triple}";
}
$args[] = getenv('SPC_EXTRA_PHP_VARS') ?: null;
$args = implode(' ', array_filter($args));