Re: ./configure fails to link test program due to missing dependencies
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 15, 2024, 16:37 UTC
- Message-ID
- <xmqqldzsrhyp.fsf@gitster.g>
- In-Reply-To
- <GV1PR02MB848925A79A9DD733848182D58D662@GV1PR02MB8489.eurprd02.prod.outlook.com>
Henrik Holst <henrik.holst@outlook.com> 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.