On 06.07.21 15:13, Peter Eisentraut wrote:
This doesn't work.
This patch adds libpgcommon and libpgport to Requires.private. But they
are not pkg-config names but library names, so they should be added to
Libs.private.
Then, I must admit that I have misunderstood this patch at first
https://github.com/postgres/postgres/commit/beff361bc1edc24ee5f8b2073a1e5e4c92ea66eb
.
My impression was that PKG_CONFIG_REQUIRES_PRIVATE ends up in
Libs.private because of this line
https://github.com/postgres/postgres/blob/d9809bf8694c17e05537c5dd96cde3e67c02d52a/src/Makefile.shlib#L403
.
After taking a second look, I've noticed that
PKG_CONFIG_REQUIRES_PRIVATE is *filtered out*. But unfortunately, this
currently doesn't work as intended because PKG_CONFIG_REQUIRES_PRIVATE
seems to be unset in Makefile.shlib which leaves Requires.private empty
and doesn't filter out -lcrypto and -lssl for Libs.private.
That must be also the reason why I first believed that
PKG_CONFIG_REQUIRES_PRIVATE is used to populate Libs.private.
Anyway, this issue is orthogonal to my original patch. I'm proposing to
hardcode -lpgcommon and -lpgport in Libs.private instead. Patch is attached.
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 29a7f6d38c..d643473807 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -400,7 +400,7 @@ endif # PORTNAME == cygwin || PORTNAME == win32
# those that point inside the build or source tree. Use sort to
# remove duplicates. Also record the -l flags necessary for static
# linking, but not those already covered by Requires.private.
- echo 'Libs.private: $(sort $(filter-out -L.% -L$(top_srcdir)/%,$(filter -L%,$(LDFLAGS) $(SHLIB_LINK)))) $(filter-out $(PKG_CONFIG_REQUIRES_PRIVATE:lib%=-l%),$(filter -l%,$(SHLIB_LINK)))' >>$@
+ echo 'Libs.private: $(sort $(filter-out -L.% -L$(top_srcdir)/%,$(filter -L%,$(LDFLAGS) $(SHLIB_LINK)))) -lpgcommon -lpgport $(filter-out $(PKG_CONFIG_REQUIRES_PRIVATE:lib%=-l%),$(filter -l%,$(SHLIB_LINK)))' >>$@
##