only enable one of password-argon2 or openssl-argon2

This commit is contained in:
DubbleClick 2025-08-04 10:14:48 +07:00
parent 4fb4e42896
commit 3789c7c335
3 changed files with 15 additions and 4 deletions

View File

@ -531,9 +531,10 @@
},
"notes": true,
"type": "builtin",
"arg-type": "with-path",
"arg-type": "custom",
"lib-depends": [
"libargon2"
"libargon2",
"openssl"
]
},
"pcntl": {

View File

@ -28,7 +28,7 @@ class openssl extends Extension
{
$openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH;
$args = '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
if ($this->builder->getPHPVersionID() >= 80500 || !$this->builder->getOption('enable-zts')) {
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
$args .= ' --with-openssl-argon2 OPENSSL_LIBS="-lz"';
}
return $args;
@ -37,7 +37,7 @@ class openssl extends Extension
public function getWindowsConfigureArg(bool $shared = false): string
{
$args = '--with-openssl';
if ($this->builder->getPHPVersionID() >= 80500) {
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
$args .= ' --with-openssl-argon2';
}
return $args;

View File

@ -42,4 +42,14 @@ class password_argon2 extends Extension
}
return $patched;
}
public function getConfigureArg(bool $shared = false): string
{
if ($this->builder->getLib('openssl') !== null) {
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
return '--without-password-argon2'; // use --with-openssl-argon2 in openssl extension instead
}
}
return '--with-password-argon2';
}
}