mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
use little trick to order libargon2 before libsodium
This commit is contained in:
parent
fff2484529
commit
559a2909a9
@ -361,6 +361,9 @@
|
||||
"source": "libargon2",
|
||||
"static-libs-unix": [
|
||||
"libargon2.a"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libsodium"
|
||||
]
|
||||
},
|
||||
"libavif": {
|
||||
|
||||
@ -24,25 +24,6 @@ class password_argon2 extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
$patched = parent::patchBeforeMake();
|
||||
if ($this->builder->getLib('libsodium') !== null) {
|
||||
$extraLibs = getenv('SPC_EXTRA_LIBS');
|
||||
if ($extraLibs !== false) {
|
||||
$extraLibs = str_replace(
|
||||
[BUILD_LIB_PATH . '/libargon2.a', BUILD_LIB_PATH . '/libsodium.a'],
|
||||
['', BUILD_LIB_PATH . '/libargon2.a ' . BUILD_LIB_PATH . '/libsodium.a'],
|
||||
$extraLibs,
|
||||
);
|
||||
$extraLibs = trim(preg_replace('/\s+/', ' ', $extraLibs)); // normalize spacing
|
||||
f_putenv('SPC_EXTRA_LIBS=' . $extraLibs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return $patched;
|
||||
}
|
||||
|
||||
public function getConfigureArg(bool $shared = false): string
|
||||
{
|
||||
if ($this->builder->getLib('openssl') !== null) {
|
||||
|
||||
@ -80,7 +80,6 @@ class SPCConfigUtil
|
||||
$libs = $this->getLibsString($libraries, !$this->absolute_libs);
|
||||
|
||||
// additional OS-specific libraries (e.g. macOS -lresolv)
|
||||
// embed
|
||||
if ($extra_libs = SPCTarget::getRuntimeLibs()) {
|
||||
$libs .= " {$extra_libs}";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user