Skip to content

Commit e2efaab

Browse files
committed
fix attempted ar deletions when building shared libphp
1 parent 28e5e58 commit e2efaab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/SPC/builder/macos/MacOSBuilder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,12 @@ protected function buildEmbed(): void
274274
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
275275

276276
shell()->cd(SOURCE_PATH . '/php-src')
277-
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install")
278-
->exec('ar -t ' . BUILD_LIB_PATH . "/libphp.a | grep '\\.a$' | xargs -n1 ar d " . BUILD_LIB_PATH . '/libphp.a');
277+
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
278+
279+
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
280+
shell()->cd(SOURCE_PATH . '/php-src')
281+
->exec('ar -t ' . BUILD_LIB_PATH . "/libphp.a | grep '\\.a$' | xargs -n1 ar d " . BUILD_LIB_PATH . '/libphp.a');
282+
}
279283
$this->patchPhpScripts();
280284
}
281285

0 commit comments

Comments
 (0)