From b1958ea0c4a9e8ec1f9ca50b3f2e2216280b58f7 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 30 Nov 2023 12:37:20 +0800 Subject: [PATCH] test libpq build --- src/SPC/builder/unix/library/postgresql.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/unix/library/postgresql.php b/src/SPC/builder/unix/library/postgresql.php index 0e52224b..6b7478ef 100644 --- a/src/SPC/builder/unix/library/postgresql.php +++ b/src/SPC/builder/unix/library/postgresql.php @@ -28,13 +28,14 @@ trait postgresql 'icu' => 'icu-i18n', ]; + f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config'); + f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig'); + foreach ($optional_packages as $lib => $pkg) { if ($this->getBuilder()->getLib($lib)) { $packages .= ' ' . $pkg; - $output = shell()->execWithResult("pkg-config --cflags --libs --static {$pkg}")[1][0]; - if (!empty($output[1][0])) { - logger()->info($output[1][0]); - } + $output = shell()->execWithResult("pkg-config --static {$pkg}"); + logger()->info($output[1][0]); } }