diff --git a/config/ext.json b/config/ext.json index 817c744a..14eabf17 100644 --- a/config/ext.json +++ b/config/ext.json @@ -531,9 +531,10 @@ }, "notes": true, "type": "builtin", - "arg-type": "with-path", + "arg-type": "custom", "lib-depends": [ - "libargon2" + "libargon2", + "openssl" ] }, "pcntl": { diff --git a/src/SPC/builder/extension/openssl.php b/src/SPC/builder/extension/openssl.php index c3c50a4f..bf61fa37 100644 --- a/src/SPC/builder/extension/openssl.php +++ b/src/SPC/builder/extension/openssl.php @@ -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; diff --git a/src/SPC/builder/extension/password_argon2.php b/src/SPC/builder/extension/password_argon2.php index 4a7fd9d0..7a3d8e0c 100644 --- a/src/SPC/builder/extension/password_argon2.php +++ b/src/SPC/builder/extension/password_argon2.php @@ -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'; + } }