Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion config/env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.

; LEGACY option to specify the target
; option to specify the target, superceded by SPC_TARGET if set
SPC_LIBC=musl
; uncomment to link libc dynamically on musl
; SPC_MUSL_DYNAMIC=true

; Recommended: specify your target here. Zig toolchain will be used.
; examples:
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/builder/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public function getLibraryDependencies(bool $recursive = false): array
*/
protected function getSharedExtensionEnv(): array
{
$config = (new SPCConfigUtil($this->builder))->getExtensionConfig($this);
$config = (new SPCConfigUtil($this->builder, ['no_php' => true]))->getExtensionConfig($this);
[$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
$preStatic = PHP_OS_FAMILY === 'Darwin' ? '' : '-Wl,--start-group ';
$postStatic = PHP_OS_FAMILY === 'Darwin' ? '' : ' -Wl,--end-group ';
Expand Down
19 changes: 0 additions & 19 deletions src/SPC/builder/extension/excimer.php

This file was deleted.

7 changes: 7 additions & 0 deletions src/SPC/builder/extension/spx.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,11 @@ public function patchBeforeBuildconf(): bool
FileSystem::copy($this->source_dir . '/src/php_spx.h', $this->source_dir . '/php_spx.h');
return true;
}

public function getSharedExtensionEnv(): array
{
$env = parent::getSharedExtensionEnv();
$env['SPX_SHARED_LIBADD'] = $env['LIBS'];
return $env;
}
}
6 changes: 5 additions & 1 deletion src/SPC/builder/unix/library/gettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ protected function build(): void
->addConfigureArgs(
'--disable-java',
'--disable-c++',
'--with-included-gettext',
'--disable-d',
'--disable-rpath',
'--disable-modula2',
'--disable-libasprintf',
'--with-included-libintl',
"--with-iconv-prefix={$this->getBuildRootPath()}",
);

Expand Down
4 changes: 2 additions & 2 deletions src/SPC/util/SPCTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public static function isStatic(): bool
return true;
}
if (ToolchainManager::getToolchainClass() === GccNativeToolchain::class) {
return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist();
return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist() && !getenv('SPC_MUSL_DYNAMIC');
}
if (ToolchainManager::getToolchainClass() === ClangNativeToolchain::class) {
return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist();
return PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist() && !getenv('SPC_MUSL_DYNAMIC');
}
// if SPC_LIBC is set, it means the target is static, remove it when 3.0 is released
if ($target = getenv('SPC_TARGET')) {
Expand Down
Loading