On 2020-07-10 21:47, Peter Eisentraut wrote:
On 2020-04-08 11:38, Sandro Mani wrote:
The following patch, which we added to build mingw-postgresql on Fedora,
adds some missing libraries to Libs.private of libpq.pc, discovered when
attempting to statically link with libpq:

-lz: is required by -lcrypto

I think the correct fix for that would be to add libssl to libpq's
Requires.private.

For that, I propose the attached patch.

-liconv: is required by -lintl (though possibly depends on whether
gettext was compiled with iconv support)

I think the solution here would be to have gettext provide a pkg-config file.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From 358e23268fbd42989a64d3326678c2c83326aa77 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Fri, 4 Sep 2020 22:03:49 +0200
Subject: [PATCH] Add libpq's openssl dependencies to pkg-config file

Add libssl and libcrypto to libpq.pc's Requires.private.  This allow
static linking to work if those libssl or libcrypto themselves have
dependencies in their *.private fields, such as -lz in some cases.

Reported-by: Sandro Mani <manisan...@gmail.com>
Discussion: 
https://www.postgresql.org/message-id/flat/837d1dcf-2fca-ee6e-0d7e-6bce1a1ba...@gmail.com
---
 src/interfaces/libpq/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index d4919970f8..4ac5f4b340 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -89,6 +89,8 @@ SHLIB_PREREQS = submake-libpgport
 
 SHLIB_EXPORTS = exports.txt
 
+PKG_CONFIG_REQUIRES_PRIVATE = libssl libcrypto
+
 all: all-lib
 
 # Shared library stuff
-- 
2.28.0

Reply via email to