mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
rename COMPILER_EXTRA to SPC_COMPILER_EXTRA
This commit is contained in:
parent
94c38df1ba
commit
013a19e25b
@ -405,7 +405,7 @@ class Extension
|
|||||||
'LDFLAGS' => $config['ldflags'],
|
'LDFLAGS' => $config['ldflags'],
|
||||||
'LIBS' => $preStatic . $staticLibString . $postStatic . $sharedLibString,
|
'LIBS' => $preStatic . $staticLibString . $postStatic . $sharedLibString,
|
||||||
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
|
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
|
||||||
'COMPILER_EXTRA' => '-lstdc++',
|
'SPC_COMPILER_EXTRA' => '-lstdc++',
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($this->patchBeforeSharedPhpize()) {
|
if ($this->patchBeforeSharedPhpize()) {
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
GlobalEnvManager::afterInit();
|
GlobalEnvManager::afterInit();
|
||||||
|
|
||||||
// concurrency
|
// concurrency
|
||||||
$this->concurrency = intval(getenv('SPC_CONCURRENCY'));
|
$this->concurrency = (int) getenv('SPC_CONCURRENCY');
|
||||||
// cflags
|
// cflags
|
||||||
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||||
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
||||||
@ -94,7 +94,7 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
}
|
}
|
||||||
$disable_jit = $this->getOption('disable-opcache-jit', false) ? '--disable-opcache-jit ' : '';
|
$disable_jit = $this->getOption('disable-opcache-jit', false) ? '--disable-opcache-jit ' : '';
|
||||||
if (!$disable_jit && $this->getExt('opcache')) {
|
if (!$disable_jit && $this->getExt('opcache')) {
|
||||||
f_putenv('COMPILER_EXTRA=-fno-sanitize=undefined');
|
f_putenv('SPC_COMPILER_EXTRA=-fno-sanitize=undefined');
|
||||||
}
|
}
|
||||||
$config_file_path = $this->getOption('with-config-file-path', false) ?
|
$config_file_path = $this->getOption('with-config-file-path', false) ?
|
||||||
('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : '';
|
('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : '';
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class MacOSBuilder extends UnixBuilderBase
|
|||||||
|
|
||||||
// ---------- set necessary compile vars ----------
|
// ---------- set necessary compile vars ----------
|
||||||
// concurrency
|
// concurrency
|
||||||
$this->concurrency = intval(getenv('SPC_CONCURRENCY'));
|
$this->concurrency = (int) getenv('SPC_CONCURRENCY');
|
||||||
// cflags
|
// cflags
|
||||||
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||||
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
||||||
|
|||||||
@ -12,16 +12,16 @@ trait libaom
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
$extra = getenv('COMPILER_EXTRA');
|
$extra = getenv('SPC_COMPILER_EXTRA');
|
||||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||||
$new = trim($extra . ' -D_GNU_SOURCE');
|
$new = trim($extra . ' -D_GNU_SOURCE');
|
||||||
f_putenv("COMPILER_EXTRA={$new}");
|
f_putenv("SPC_COMPILER_EXTRA={$new}");
|
||||||
}
|
}
|
||||||
UnixCMakeExecutor::create($this)
|
UnixCMakeExecutor::create($this)
|
||||||
->setBuildDir("{$this->source_dir}/builddir")
|
->setBuildDir("{$this->source_dir}/builddir")
|
||||||
->addConfigureArgs('-DAOM_TARGET_CPU=generic')
|
->addConfigureArgs('-DAOM_TARGET_CPU=generic')
|
||||||
->build();
|
->build();
|
||||||
f_putenv("COMPILER_EXTRA={$extra}");
|
f_putenv("SPC_COMPILER_EXTRA={$extra}");
|
||||||
$this->patchPkgconfPrefix(['aom.pc']);
|
$this->patchPkgconfPrefix(['aom.pc']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class WindowsBuilder extends BuilderBase
|
|||||||
$this->zts = $this->getOption('enable-zts', false);
|
$this->zts = $this->getOption('enable-zts', false);
|
||||||
|
|
||||||
// set concurrency
|
// set concurrency
|
||||||
$this->concurrency = intval(getenv('SPC_CONCURRENCY'));
|
$this->concurrency = (int) getenv('SPC_CONCURRENCY');
|
||||||
|
|
||||||
// make cmake toolchain
|
// make cmake toolchain
|
||||||
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile();
|
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile();
|
||||||
|
|||||||
@ -29,7 +29,7 @@ done
|
|||||||
[[ -n "$SPC_TARGET" ]] && TARGET="-target $SPC_TARGET" || TARGET=""
|
[[ -n "$SPC_TARGET" ]] && TARGET="-target $SPC_TARGET" || TARGET=""
|
||||||
|
|
||||||
if [[ "$SPC_TARGET" =~ \.[0-9]+\.[0-9]+ ]]; then
|
if [[ "$SPC_TARGET" =~ \.[0-9]+\.[0-9]+ ]]; then
|
||||||
output=$(zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}" 2>&1)
|
output=$(zig cc $TARGET $SPC_COMPILER_EXTRA "${PARSED_ARGS[@]}" 2>&1)
|
||||||
status=$?
|
status=$?
|
||||||
|
|
||||||
if [[ $status -eq 0 ]]; then
|
if [[ $status -eq 0 ]]; then
|
||||||
@ -44,4 +44,4 @@ if [[ "$SPC_TARGET" =~ \.[0-9]+\.[0-9]+ ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}"
|
exec zig cc $TARGET $SPC_COMPILER_EXTRA "${PARSED_ARGS[@]}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user