mysqli and mysqlnd can also be built shared

This commit is contained in:
DubbleClick 2025-05-22 16:48:22 +07:00
parent 835fc1e360
commit c2d5afc4e9
3 changed files with 10 additions and 10 deletions

View File

@ -430,8 +430,8 @@
"ext-depends": [ "ext-depends": [
"mysqlnd" "mysqlnd"
], ],
"target": [ "shared-ext-depends": [
"static" "mysqlnd"
] ]
}, },
"mysqlnd": { "mysqlnd": {
@ -439,9 +439,6 @@
"arg-type-windows": "with", "arg-type-windows": "with",
"lib-depends": [ "lib-depends": [
"zlib" "zlib"
],
"target": [
"static"
] ]
}, },
"oci8": { "oci8": {
@ -682,7 +679,8 @@
"build-with-php": true "build-with-php": true
}, },
"shmop": { "shmop": {
"type": "builtin" "type": "builtin",
"build-with-php": true
}, },
"simdjson": { "simdjson": {
"type": "external", "type": "external",
@ -792,6 +790,7 @@
"arg-type": "with-prefix", "arg-type": "with-prefix",
"arg-type-windows": "with", "arg-type-windows": "with",
"lib-depends": [ "lib-depends": [
"openssl",
"libssh2" "libssh2"
], ],
"ext-depends-windows": [ "ext-depends-windows": [

View File

@ -230,9 +230,9 @@ class Extension
foreach ($order as $ext) { foreach ($order as $ext) {
if ($ext instanceof Extension && $ext->isBuildShared()) { if ($ext instanceof Extension && $ext->isBuildShared()) {
if ($ext->isZendExtension()) { if ($ext->isZendExtension()) {
$ret .= ' -d "zend_extension=' . BUILD_MODULES_PATH . '/' . $ext->getName() . '.so"'; $ret .= " -d \"zend_extension={$ext->getName()}\"";
} else { } else {
$ret .= ' -d "extension=' . BUILD_MODULES_PATH . '/' . $ext->getName() . '.so"'; $ret .= " -d \"extension={$ext->getName()}\"";
} }
} }
} }
@ -249,7 +249,8 @@ class Extension
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php // If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
// If check failed, throw RuntimeException // If check failed, throw RuntimeException
$sharedExtensions = $this->getRequiredSharedExtensions(); $sharedExtensions = $this->getRequiredSharedExtensions();
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"', false); putenv('EXTENSION_DIR=' . BUILD_MODULES_PATH);
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
if ($ret !== 0) { if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret); throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
} }

View File

@ -26,7 +26,7 @@ class mbregex extends Extension
*/ */
public function runCliCheckUnix(): void public function runCliCheckUnix(): void
{ {
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=' . BUILD_MODULES_PATH . '/mbstring.so"' : ''; $sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? ' -d "extension=mbstring.so"' : '';
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false); [$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false);
if ($ret !== 0) { if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !'); throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');