From 5bd53ed7142bfc770629e630802a81d257d3a61e Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 19 May 2025 13:23:19 +0700 Subject: [PATCH] skip php rebuild if we're only building shared libphp.so --- src/SPC/builder/linux/LinuxBuilder.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index e38714f1..c06267d7 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -106,6 +106,18 @@ class LinuxBuilder extends UnixBuilderBase */ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void { + if ($build_target === BUILD_TARGET_EMBED && + file_exists(BUILD_BIN_PATH . '/php-config') && + file_exists(BUILD_BIN_PATH . '/phpize') + ) { + $embed_type = getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') ?: 'static'; + if ($embed_type === 'shared' && file_exists(BUILD_LIB_PATH . '/libphp.so')) { + return; + } + if (file_exists(BUILD_LIB_PATH . '/libphp.a')) { + return; + } + } // ---------- Update extra-libs ---------- $extra_libs = getenv('SPC_EXTRA_LIBS') ?: ''; // bloat means force-load all static libraries, even if they are not used