Fix missing linking libs for gnu docker

This commit is contained in:
crazywhalecc 2025-10-26 12:22:14 +08:00
parent b8854f1489
commit d5e7f00dd1
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -4,10 +4,20 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
use SPC\util\executor\UnixAutoconfExecutor;
trait net_snmp
{
public function patchBeforeBuild(): bool
{
if (PHP_OS_FAMILY === 'Linux') {
FileSystem::replaceFileStr("{$this->source_dir}/configure", 'LIBS="-lssl ${OPENSSL_LIBS}"', 'LIBS="-lssl ${OPENSSL_LIBS} -lpthread -ldl"');
return true;
}
return false;
}
protected function build(): void
{
// use --static for PKG_CONFIG