Skip to content

Commit f8b0c2c

Browse files
committed
add release thing to extension build too
1 parent 6bbb3c9 commit f8b0c2c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/SPC/builder/Extension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ protected function getSharedExtensionEnv(): array
546546
'CFLAGS' => $config['cflags'],
547547
'CXXFLAGS' => $config['cflags'],
548548
'LDFLAGS' => $config['ldflags'],
549+
'EXTRA_LDFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
549550
'LIBS' => clean_spaces("{$preStatic} {$staticLibs} {$postStatic} {$sharedLibs}"),
550551
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
551552
];

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,14 @@ protected function buildEmbed(): void
283283

284284
// process libphp.so for shared embed
285285
$libphpSo = BUILD_LIB_PATH . '/libphp.so';
286+
$libphpSoDest = BUILD_LIB_PATH . '/libphp.so';
286287
if (file_exists($libphpSo)) {
287288
// deploy libphp.so
288-
$this->deployBinary($libphpSo, $libphpSo, false);
289+
preg_match('/-release\s+(\S*)/', getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), $matches);
290+
if (!empty($matches[1])) {
291+
$libphpSoDest = str_replace('.so', '-' . $matches[1] . '.so', $libphpSo);
292+
}
293+
$this->deployBinary($libphpSo, $libphpSoDest, false);
289294
}
290295

291296
// process shared extensions build-with-php

0 commit comments

Comments
 (0)