Skip to content

Commit a8f0932

Browse files
committed
oauth: Correct missing comma in Requires.private
I added libcurl to the Requires.private section of libpq.pc in commit b0635bf, 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 <walther@technowledgy.de> Reviewed-by: Fabrízio de Royes Mello <fabriziomello@gmail.com> Discussion: https://postgr.es/m/CAOYmi+k2z7Rqj5xiWLUT0+bSXLvdE7TYgS5gCOSqSyXyTSSXiQ@mail.gmail.com
1 parent cbc8fd0 commit a8f0932

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/interfaces/libpq/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,21 @@ SHLIB_PREREQS = submake-libpgport
9898

9999
SHLIB_EXPORTS = exports.txt
100100

101+
# Appends to a comma-separated list.
102+
comma := ,
103+
define add_to_list
104+
$(eval $1 := $(if $($1),$($1)$(comma) $2,$2))
105+
endef
106+
101107
ifeq ($(with_ssl),openssl)
102-
PKG_CONFIG_REQUIRES_PRIVATE = libssl, libcrypto
108+
$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libssl)
109+
$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libcrypto)
103110
endif
104111

105112
ifeq ($(with_libcurl),yes)
106113
# libpq.so doesn't link against libcurl, but libpq.a needs libpq-oauth, and
107114
# libpq-oauth needs libcurl. Put both into *.private.
108-
PKG_CONFIG_REQUIRES_PRIVATE += libcurl
115+
$(call add_to_list,PKG_CONFIG_REQUIRES_PRIVATE,libcurl)
109116
%.pc: override SHLIB_LINK_INTERNAL += -lpq-oauth
110117
endif
111118

0 commit comments

Comments
 (0)