Skip to content

Commit 6a153f9

Browse files
authored
also install-modules of course... (#933)
2 parents 8923077 + bba390d commit 6a153f9

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

config/ext.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@
341341
"ext-depends": [
342342
"xml"
343343
],
344+
"build-with-php": true,
344345
"target": [
345346
"static"
346347
]
@@ -461,13 +462,15 @@
461462
"mysqli": {
462463
"type": "builtin",
463464
"arg-type": "with",
465+
"build-with-php": true,
464466
"ext-depends": [
465467
"mysqlnd"
466468
]
467469
},
468470
"mysqlnd": {
469471
"type": "builtin",
470472
"arg-type-windows": "with",
473+
"build-with-php": true,
471474
"lib-depends": [
472475
"zlib"
473476
]
@@ -797,6 +800,7 @@
797800
"type": "builtin",
798801
"arg-type": "with-path",
799802
"arg-type-windows": "with",
803+
"build-with-php": true,
800804
"lib-depends": [
801805
"sqlite"
802806
]
@@ -1177,6 +1181,7 @@
11771181
"lib-depends": [
11781182
"zlib"
11791183
],
1184+
"build-with-php": true,
11801185
"target": [
11811186
"static"
11821187
]

config/lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@
781781
"libxml2",
782782
"openssl",
783783
"zlib",
784-
"readline"
784+
"libedit"
785785
],
786786
"lib-suggests": [
787787
"icu",

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use SPC\builder\unix\UnixBuilderBase;
88
use SPC\exception\PatchException;
99
use SPC\exception\WrongUsageException;
10+
use SPC\store\Config;
1011
use SPC\store\FileSystem;
1112
use SPC\store\SourcePatcher;
1213
use SPC\util\GlobalEnvManager;
@@ -283,12 +284,17 @@ protected function buildFpm(): void
283284
*/
284285
protected function buildEmbed(): void
285286
{
287+
$sharedExts = array_filter($this->exts, static fn ($ext) => $ext->isBuildShared());
288+
$sharedExts = array_filter($sharedExts, static function ($ext) {
289+
return Config::getExt($ext->getName(), 'build-with-php') === true;
290+
});
291+
$install_modules = $sharedExts ? 'install-modules' : '';
286292
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
287293
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
288294
shell()->cd(SOURCE_PATH . '/php-src')
289295
->exec('sed -i "s|//lib|/lib|g" Makefile')
290296
->exec('sed -i "s|^EXTENSION_DIR = .*|EXTENSION_DIR = /' . basename(BUILD_MODULES_PATH) . '|" Makefile')
291-
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi install-build install-headers install-programs");
297+
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi {$install_modules} install-build install-headers install-programs");
292298

293299
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS') ?: '';
294300
$libDir = BUILD_LIB_PATH;

src/SPC/builder/macos/MacOSBuilder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use SPC\builder\macos\library\MacOSLibraryBase;
88
use SPC\builder\unix\UnixBuilderBase;
99
use SPC\exception\WrongUsageException;
10+
use SPC\store\Config;
1011
use SPC\store\FileSystem;
1112
use SPC\store\SourcePatcher;
1213
use SPC\util\GlobalEnvManager;
@@ -264,10 +265,15 @@ protected function buildFpm(): void
264265
*/
265266
protected function buildEmbed(): void
266267
{
268+
$sharedExts = array_filter($this->exts, static fn ($ext) => $ext->isBuildShared());
269+
$sharedExts = array_filter($sharedExts, static function ($ext) {
270+
return Config::getExt($ext->getName(), 'build-with-php') === true;
271+
});
272+
$install_modules = $sharedExts ? 'install-modules' : '';
267273
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
268274
$concurrency = getenv('SPC_CONCURRENCY') ? '-j' . getenv('SPC_CONCURRENCY') : '';
269275
shell()->cd(SOURCE_PATH . '/php-src')
270-
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi install-build install-headers install-programs");
276+
->exec("make {$concurrency} INSTALL_ROOT=" . BUILD_ROOT_PATH . " {$vars} install-sapi {$install_modules} install-build install-headers install-programs");
271277

272278
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
273279
$AR = getenv('AR') ?: 'ar';

src/SPC/builder/unix/library/libzip.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ protected function build(): void
2222
'-DBUILD_EXAMPLES=OFF',
2323
'-DBUILD_REGRESS=OFF',
2424
'-DBUILD_TOOLS=OFF',
25+
'-DBUILD_OSSFUZZ=OFF',
2526
)
2627
->build();
2728
$this->patchPkgconfPrefix(['libzip.pc'], PKGCONF_PATCH_PREFIX);

src/SPC/util/shell/UnixShell.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use SPC\builder\linux\library\LinuxLibraryBase;
99
use SPC\builder\macos\library\MacOSLibraryBase;
1010
use SPC\exception\SPCInternalException;
11+
use SPC\util\SPCTarget;
1112
use ZM\Logger\ConsoleColor;
1213

1314
/**
@@ -48,7 +49,7 @@ public function initializeEnv(BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $
4849
'CFLAGS' => $library->getLibExtraCFlags(),
4950
'CXXFLAGS' => $library->getLibExtraCXXFlags(),
5051
'LDFLAGS' => $library->getLibExtraLdFlags(),
51-
'LIBS' => $library->getLibExtraLibs(),
52+
'LIBS' => $library->getLibExtraLibs() . SPCTarget::getRuntimeLibs(),
5253
]);
5354
return $this;
5455
}

src/globals/test-extensions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
5757
$shared_extensions = match (PHP_OS_FAMILY) {
58-
'Linux' => '',
59-
'Darwin' => '',
58+
'Linux' => 'mysqli',
59+
'Darwin' => 'zip',
6060
'Windows' => '',
6161
};
6262

0 commit comments

Comments
 (0)