From a8f093234d78ff2bbcf6489ac213064aa584ad2b Mon Sep 17 00:00:00 2001 From: Jacob Champion Date: Fri, 23 May 2025 13:05:38 -0700 Subject: [PATCH] oauth: Correct missing comma in Requires.private MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I added libcurl to the Requires.private section of libpq.pc in commit b0635bfda, but I missed that the Autoconf side needs commas added explicitly. Configurations which used both --with-libcurl and --with-openssl ended up with the following entry: Requires.private: libssl, libcrypto libcurl The pkg-config parser appears to be fairly lenient in this case, and accepts the whitespace as an equivalent separator, but let's not rely on that. Add an add_to_list macro (inspired by Makefile.global's add_to_path) to build up the PKG_CONFIG_REQUIRES_PRIVATE list correctly. Reported-by: Wolfgang Walther Reviewed-by: Fabrízio de Royes Mello Discussion: https://postgr.es/m/CAOYmi+k2z7Rqj5xiWLUT0+bSXLvdE7TYgS5gCOSqSyXyTSSXiQ@mail.gmail.com --- src/interfaces/libpq/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index c6fe5fec7f6..853aab4b1b8 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -98,14 +98,21 @@ SHLIB_PREREQS = submake-libpgport SHLIB_EXPORTS = exports.txt +# Appends to a comma-separated list. +comma := , +define add_to_list +$(eval $1 := $(if $($1),$($1)$(comma) $2,$2)) +endef + ifeq ($(with_ssl),openssl) -PKG_CONFIG_REQUIRES_PRIVATE = libssl, libcrypto +$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libssl) +$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libcrypto) endif ifeq ($(with_libcurl),yes) # libpq.so doesn't link against libcurl, but libpq.a needs libpq-oauth, and # libpq-oauth needs libcurl. Put both into *.private. -PKG_CONFIG_REQUIRES_PRIVATE += libcurl +$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libcurl) %.pc: override SHLIB_LINK_INTERNAL += -lpq-oauth endif -- 2.39.5