mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Fix unixodbc driver config searching path
This commit is contained in:
parent
97b18e9121
commit
8c8aba2dd5
@ -4,18 +4,29 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder\unix\library;
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\util\executor\UnixAutoconfExecutor;
|
use SPC\util\executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
trait unixodbc
|
trait unixodbc
|
||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
|
$sysconf_selector = match (PHP_OS_FAMILY) {
|
||||||
|
'Darwin' => match (GNU_ARCH) {
|
||||||
|
'x86_64' => '/usr/local/etc',
|
||||||
|
'aarch64' => '/opt/homebrew/etc',
|
||||||
|
default => throw new WrongUsageException('Unsupported architecture: ' . GNU_ARCH),
|
||||||
|
},
|
||||||
|
'Linux' => '/etc',
|
||||||
|
default => throw new WrongUsageException('Unsupported OS: ' . PHP_OS_FAMILY),
|
||||||
|
};
|
||||||
UnixAutoconfExecutor::create($this)
|
UnixAutoconfExecutor::create($this)
|
||||||
->configure(
|
->configure(
|
||||||
'--disable-debug',
|
'--disable-debug',
|
||||||
'--disable-dependency-tracking',
|
'--disable-dependency-tracking',
|
||||||
"--with-libiconv-prefix={$this->getBuildRootPath()}",
|
"--with-libiconv-prefix={$this->getBuildRootPath()}",
|
||||||
'--with-included-ltdl',
|
'--with-included-ltdl',
|
||||||
|
"--sysconfdir={$sysconf_selector}",
|
||||||
'--enable-gui=no',
|
'--enable-gui=no',
|
||||||
)
|
)
|
||||||
->make();
|
->make();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user