Subject: Re: ./configure fails to link test program due to missing dependencies

From: Junio C Hamano <[email-masked]>
Date: Sun, 15 Sep 2024 09:37:34 -0700

Henrik Holst <[email-masked]> writes:

> If I set LDFLAGS to whatever pkg-config --libs libcurl says on my system (actually: -lcurl -lssl -lcrypto -lzstd -lbrotlidec -lz) then it compiles just fine. If I add LDFLAGS to the configure environment it will accept that test, and then detect, as expected, the pkg-config settings for libcurl.
>
> Should not ./configure FIRST check for a pkg-config environment without assuming that even the most trivial curl programs should compile without any additional dependencies like zstd etc?

Looking at configure.ac, pkg-config is not used for any package.
Specifically for curl, it seems that "curl-config --libs" is used.

Presumably the reason behind the current behaviour is combination of
(1) ./configure is an after-thought in the build infrastructure for
this project, (2) pkg-config was not ubiquitous back when autoconf
support was written for this project, and (3) nobody considered
"upgrading" our use of "curl-config" and our manual detection of
dependency detection for other libraries to just use "pkg-config".

Patches welcome ;-)

Thanks.