diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 50d8837a..ba4ddefe 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -405,7 +405,7 @@ class Extension 'LDFLAGS' => $config['ldflags'], 'LIBS' => $preStatic . $staticLibString . $postStatic . $sharedLibString, 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, - 'COMPILER_EXTRA' => '-lstdc++', + 'SPC_COMPILER_EXTRA' => '-lstdc++', ]; if ($this->patchBeforeSharedPhpize()) { diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 9f9fd018..be856a65 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -32,7 +32,7 @@ class LinuxBuilder extends UnixBuilderBase GlobalEnvManager::afterInit(); // concurrency - $this->concurrency = intval(getenv('SPC_CONCURRENCY')); + $this->concurrency = (int) getenv('SPC_CONCURRENCY'); // cflags $this->arch_c_flags = getenv('SPC_DEFAULT_C_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 ' : ''; 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) ? ('--with-config-file-path=' . $this->getOption('with-config-file-path') . ' ') : ''; diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index 329d09e0..f6e1fb64 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -34,7 +34,7 @@ class MacOSBuilder extends UnixBuilderBase // ---------- set necessary compile vars ---------- // concurrency - $this->concurrency = intval(getenv('SPC_CONCURRENCY')); + $this->concurrency = (int) getenv('SPC_CONCURRENCY'); // cflags $this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS'); $this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS'); diff --git a/src/SPC/builder/unix/library/libaom.php b/src/SPC/builder/unix/library/libaom.php index 9c10079b..f2f50d85 100644 --- a/src/SPC/builder/unix/library/libaom.php +++ b/src/SPC/builder/unix/library/libaom.php @@ -12,16 +12,16 @@ trait libaom { protected function build(): void { - $extra = getenv('COMPILER_EXTRA'); + $extra = getenv('SPC_COMPILER_EXTRA'); if (ToolchainManager::getToolchainClass() === ZigToolchain::class) { $new = trim($extra . ' -D_GNU_SOURCE'); - f_putenv("COMPILER_EXTRA={$new}"); + f_putenv("SPC_COMPILER_EXTRA={$new}"); } UnixCMakeExecutor::create($this) ->setBuildDir("{$this->source_dir}/builddir") ->addConfigureArgs('-DAOM_TARGET_CPU=generic') ->build(); - f_putenv("COMPILER_EXTRA={$extra}"); + f_putenv("SPC_COMPILER_EXTRA={$extra}"); $this->patchPkgconfPrefix(['aom.pc']); } } diff --git a/src/SPC/builder/windows/WindowsBuilder.php b/src/SPC/builder/windows/WindowsBuilder.php index 25a503eb..618d7238 100644 --- a/src/SPC/builder/windows/WindowsBuilder.php +++ b/src/SPC/builder/windows/WindowsBuilder.php @@ -45,7 +45,7 @@ class WindowsBuilder extends BuilderBase $this->zts = $this->getOption('enable-zts', false); // set concurrency - $this->concurrency = intval(getenv('SPC_CONCURRENCY')); + $this->concurrency = (int) getenv('SPC_CONCURRENCY'); // make cmake toolchain $this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile(); diff --git a/src/SPC/store/scripts/zig-cc.sh b/src/SPC/store/scripts/zig-cc.sh index 4dd0f6c9..d162a369 100644 --- a/src/SPC/store/scripts/zig-cc.sh +++ b/src/SPC/store/scripts/zig-cc.sh @@ -29,7 +29,7 @@ done [[ -n "$SPC_TARGET" ]] && TARGET="-target $SPC_TARGET" || TARGET="" 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=$? if [[ $status -eq 0 ]]; then @@ -44,4 +44,4 @@ if [[ "$SPC_TARGET" =~ \.[0-9]+\.[0-9]+ ]]; then fi fi -exec zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}" +exec zig cc $TARGET $SPC_COMPILER_EXTRA "${PARSED_ARGS[@]}"