mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-11 10:55:35 +08:00
remove SPC_ARCH
This commit is contained in:
@@ -8,6 +8,7 @@ use StaticPHP\Attribute\Package\BuildFor;
|
|||||||
use StaticPHP\Attribute\Package\Library;
|
use StaticPHP\Attribute\Package\Library;
|
||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
|
||||||
#[Library('libffi')]
|
#[Library('libffi')]
|
||||||
class libffi extends LibraryPackage
|
class libffi extends LibraryPackage
|
||||||
@@ -28,7 +29,7 @@ class libffi extends LibraryPackage
|
|||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
public function buildDarwin(): void
|
public function buildDarwin(): void
|
||||||
{
|
{
|
||||||
$arch = getenv('SPC_ARCH');
|
$arch = SystemTarget::getTargetArch();
|
||||||
UnixAutoconfExecutor::create($this)
|
UnixAutoconfExecutor::create($this)
|
||||||
->configure(
|
->configure(
|
||||||
"--host={$arch}-apple-darwin",
|
"--host={$arch}-apple-darwin",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use StaticPHP\Attribute\Package\Library;
|
|||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
#[Library('libpng')]
|
#[Library('libpng')]
|
||||||
@@ -24,7 +25,7 @@ class libpng
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Enable architecture-specific optimizations
|
// Enable architecture-specific optimizations
|
||||||
match (getenv('SPC_ARCH')) {
|
match (SystemTarget::getTargetArch()) {
|
||||||
'x86_64' => $args[] = '--enable-intel-sse',
|
'x86_64' => $args[] = '--enable-intel-sse',
|
||||||
'aarch64' => $args[] = '--enable-arm-neon',
|
'aarch64' => $args[] = '--enable-arm-neon',
|
||||||
default => null,
|
default => null,
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class openssl
|
|||||||
public function buildForDarwin(LibraryPackage $pkg): void
|
public function buildForDarwin(LibraryPackage $pkg): void
|
||||||
{
|
{
|
||||||
$zlib_libs = $pkg->getInstaller()->getLibraryPackage('zlib')->getStaticLibFiles();
|
$zlib_libs = $pkg->getInstaller()->getLibraryPackage('zlib')->getStaticLibFiles();
|
||||||
$arch = getenv('SPC_ARCH');
|
$arch = SystemTarget::getTargetArch();
|
||||||
|
|
||||||
shell()->cd($pkg->getSourceDir())->initializeEnv($pkg)
|
shell()->cd($pkg->getSourceDir())->initializeEnv($pkg)
|
||||||
->exec(
|
->exec(
|
||||||
@@ -95,12 +95,7 @@ class openssl
|
|||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
public function build(LibraryPackage $lib): void
|
public function build(LibraryPackage $lib): void
|
||||||
{
|
{
|
||||||
$arch = getenv('SPC_ARCH');
|
$arch = SystemTarget::getTargetArch();
|
||||||
|
|
||||||
$env = "CC='" . getenv('CC') . ' -idirafter ' . BUILD_INCLUDE_PATH .
|
|
||||||
' -idirafter /usr/include/ ' .
|
|
||||||
' -idirafter /usr/include/' . getenv('SPC_ARCH') . '-linux-gnu/ ' .
|
|
||||||
"' ";
|
|
||||||
|
|
||||||
$ex_lib = trim($lib->getInstaller()->getLibraryPackage('zlib')->getStaticLibFiles()) . ' -ldl -pthread';
|
$ex_lib = trim($lib->getInstaller()->getLibraryPackage('zlib')->getStaticLibFiles()) . ' -ldl -pthread';
|
||||||
$zlib_extra =
|
$zlib_extra =
|
||||||
@@ -119,7 +114,7 @@ class openssl
|
|||||||
|
|
||||||
shell()->cd($lib->getSourceDir())->initializeEnv($lib)
|
shell()->cd($lib->getSourceDir())->initializeEnv($lib)
|
||||||
->exec(
|
->exec(
|
||||||
"{$env} ./Configure no-shared zlib " .
|
'./Configure no-shared zlib ' .
|
||||||
"--prefix={$lib->getBuildRootPath()} " .
|
"--prefix={$lib->getBuildRootPath()} " .
|
||||||
"--libdir={$lib->getLibDir()} " .
|
"--libdir={$lib->getLibDir()} " .
|
||||||
"--openssldir={$openssl_dir} " .
|
"--openssldir={$openssl_dir} " .
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ putenv('PKG_ROOT_PATH=' . PKG_ROOT_PATH);
|
|||||||
putenv('SOURCE_PATH=' . SOURCE_PATH);
|
putenv('SOURCE_PATH=' . SOURCE_PATH);
|
||||||
putenv('DOWNLOAD_PATH=' . DOWNLOAD_PATH);
|
putenv('DOWNLOAD_PATH=' . DOWNLOAD_PATH);
|
||||||
putenv('CPU_COUNT=' . CPU_COUNT);
|
putenv('CPU_COUNT=' . CPU_COUNT);
|
||||||
putenv('SPC_ARCH=' . php_uname('m'));
|
|
||||||
putenv('GNU_ARCH=' . GNU_ARCH);
|
putenv('GNU_ARCH=' . GNU_ARCH);
|
||||||
putenv('MAC_ARCH=' . MAC_ARCH);
|
putenv('MAC_ARCH=' . MAC_ARCH);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user