Skip to content

curl-config --libs returns incorrect value on cygwin #5793

@ramsay-jones

Description

@ramsay-jones

I did this

Last night I updated my cygwin installation and (among others) my curl packages were updated.
This lead to my git build failing while linking git-imap-send.exe as the linker could not find the
libraries: -lnghttp2, -lidn2, -lssh, -lpsl, -lldap, -llber, -lbrotlidec, -lbrotlidec (yes it was noted twice).

$ cygcheck -cd | grep curl
curl 7.71.1-1
libcurl-devel 7.71.1-1
libcurl-doc 7.71.1-1
libcurl4 7.71.1-1
$

The git makefile uses 'curl-config --libs', which produces:

$ curl-config --libs
-lcurl -lnghttp2 -lidn2 -lssh -lpsl -lssl -lcrypto -lldap -llber -lbrotlidec -lbrotlidec -lz
$

Looking at the '/usr/lib/pkgconfig/libcurl.pc' file, I find:

$ cat /usr/lib/pkgconfig/libcurl.pc
...
Libs: -L${libdir} -lcurl
Libs.private: -lnghttp2 -lidn2 -lssh -lpsl -lssl -lcrypto -lldap -llber -lbrotlidec -lbrotlidec -lz
...
$

I had a quick look at the curl git repo, and this seems to be due to a recent commit 98e5904
(libcurl.pc: Merge Libs.private into Libs for static-only builds, 2020-05-11).

The git Makefile allows me to override the value returned by curl-config, by setting 'CURL_LDFLAGS=-lcurl'
in my config.mak, so I have simple solution for now - just thought you should know. ;-)

I expected the following

git to build correctly!

curl/libcurl version

$ curl -V
curl 7.71.1 (x86_64-pc-cygwin) libcurl/7.71.1 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.0.4) libssh/0.8.7/openssl/zlib nghttp2/1.37.0
Release-Date: 2020-07-01
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli Debug HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB PSL SSL TLS-SRP TrackMemory UnixSockets
$

operating system

$ uname -a
CYGWIN_NT-10.0 satellite 3.1.6(0.340/5/3) 2020-07-09 08:20 x86_64 Cygwin
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions