Re: libcurl in libpq.pc

Christoph Berg <myon@debian.org>

From: Christoph Berg <myon@debian.org>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Wolfgang Walther <walther@technowledgy.de>, Timo Röhling <roehling@debian.org>
Date: 2025-09-23T14:16:19Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. oauth: Correct missing comma in Requires.private

Re: To Jacob Champion
> It turns out that pkg-config is picky when it doesn't find the .pc
> files listed in Requires.private. So, without libcurl4-openssl-dev
> installed:

What I didn't say explicitly in the last message is that I want to
avoid that all programs now build-depending on libpq-dev would have to
add libcurl4-openssl-dev, or libpq-dev would have to depend on that.

> But CFLAGS is not:
> 
> $ pkgconf --cflags libpq
> Package libcurl was not found in the pkg-config search path.

Furthermore, with libcurl4-openssl-dev installed, the pkgconf output
changes, as said in that FAQ entry:

$ pkgconf --cflags libpq
-I/usr/include/postgresql -I/usr/include/x86_64-linux-gnu -isystem /usr/include/mit-krb5 -I/usr/include/p11-kit-1

That might be harmless, but we should avoid it.


For reference, the current 18.0 behavior:

$ pkgconf --libs libpq
-lpq
$ pkgconf --cflags libpq
-I/usr/include/postgresql -I/usr/include/x86_64-linux-gnu -isystem /usr/include/mit-krb5 -I/usr/include/p11-kit-1
$ pkgconf --libs libpq
-lpq
$ pkgconf --libs --static libpq
-lpq -lpgcommon -lpgport -lpq-oauth -lssl -lcrypto -lgssapi_krb5 -lm -lldap -lssl -lz -lzstd -ldl -pthread -lcrypto -lz -lzstd -ldl -pthread -lcurl -lidn2 -llber -lldap -llber -lssh2 -lssl -lcrypto -lcrypto -lunistring -lz -lbrotlidec -lbrotlicommon -lzstd -pthread -L/usr/lib/x86_64-linux-gnu/mit-krb5 -lgssapi_krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lssl -lz -lzstd -ldl -pthread -lcrypto -lz -lzstd -ldl -pthread -lpsl -lssh2 -lssl -lcrypto -lz -lgpg-error -lcrypto -lzstd -ldl -pthread -lz -lrtmp -lz -lgmp -lgnutls -lgmp -lunistring -latomic -lnettle -lgmp -lnettle -ltasn1 -lidn2 -lunistring -lp11-kit -lhogweed -lgmp -lnettle -lnghttp2 -lnghttp3

(ugh)

And after the libpq.pc change I plan:

$ pkgconf --cflags libpq
-I/usr/include/postgresql
$ pkgconf --cflags --static libpq
-I/usr/include/postgresql
$ pkgconf --libs libpq
-lpq
$ pkgconf --libs --static libpq
-lpq -lpgcommon -lpgport -lpq-oauth -lssl -lcrypto -lgssapi_krb5 -lm -lldap -lcurl -lssl -lz -lzstd -ldl -pthread -lcrypto -lz -lzstd -ldl -pthread


Christoph