new build-with-php key for extensions

This commit is contained in:
DubbleClick 2025-05-22 12:27:01 +07:00
parent c29ca9722f
commit 310be957b6
2 changed files with 27 additions and 10 deletions

View File

@ -370,6 +370,9 @@
"ext-depends": [
"zlib",
"session"
],
"shared-ext-depends": [
"session"
]
},
"memcached": {
@ -388,6 +391,9 @@
"ext-depends": [
"session",
"zlib"
],
"shared-ext-depends": [
"session"
]
},
"mongodb": {
@ -692,7 +698,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"snappy": {
"support": {
@ -912,7 +919,8 @@
]
},
"tokenizer": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"uuid": {
"support": {
@ -995,7 +1003,8 @@
],
"ext-depends-windows": [
"iconv"
]
],
"build-with-php": true
},
"xmlreader": {
"support": {
@ -1009,7 +1018,8 @@
"ext-depends-windows": [
"xml",
"dom"
]
],
"build-with-php": true
},
"xmlwriter": {
"support": {
@ -1022,7 +1032,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"xsl": {
"support": {

View File

@ -262,15 +262,17 @@ abstract class BuilderBase
if (!$ext->isBuildShared()) {
continue;
}
if (Config::getExt($ext->getName(), 'type') === 'builtin') {
if (Config::getExt($ext->getName(), 'type') === 'builtin' || Config::getExt($ext->getName(), 'build-with-php') === true) {
if (file_exists(BUILD_MODULES_PATH . '/' . $ext->getName() . '.so')) {
logger()->info('Shared extension [' . $ext->getName() . '] was already built by php-src/configure (' . $ext->getName() . '.so)');
continue;
}
logger()->warning('Shared extension [' . $ext->getName() . '] was built statically by php-src/configure');
continue;
if (Config::getExt($ext->getName(), 'build-with-php') === true) {
logger()->warning('Shared extension [' . $ext->getName() . '] did not build with php-src/configure (' . $ext->getName() . '.so)');
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
continue;
}
}
logger()->info('Building extension [' . $ext->getName() . '] as shared extension (' . $ext->getName() . '.so)');
$ext->buildShared();
}
} catch (RuntimeException $e) {
@ -293,7 +295,11 @@ abstract class BuilderBase
foreach ($this->getExts() as $ext) {
$arg = $ext->getConfigureArg();
if ($ext->isBuildShared()) {
if (Config::getExt($ext->getName(), 'type') === 'builtin') {
if (
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
Config::getExt($ext->getName(), 'build-with-php') === true
) {
$arg = $ext->getConfigureArg(true);
} else {
continue;