When curl is built with rtmp support, curl-config --libs give -lrtmp for the linker line when dynamically linking. But this is wrong, it is only needed when statically linking. The problem extends to other libraries as well, eg -lgnutls. In fact, libcurl.pc has it correct:
Libs: -L${libdir} -lcurl
Libs.private: -lrtmp -lz -lgnutls -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -llber -lldap -lz
and yet
curl-config --libs gives
-lcurl -lrtmp -lz -lgnutls -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -llber -lldap -lz
This was hit on a Gentoo system. The downstream report is at
https://bugs.gentoo.org/show_bug.cgi?id=497956
by Nikoli nikoli@gmx.us.
https://bugs.gentoo.org/show_bug.cgi?id=497956
curl-config should only list the full set of libraries if libtool indicates that the target system requires that. What is the output of:
libtool --config | grep link_all_deplibs
on this system? If it's anything other than "link_all_deplibs=no" then curl is doing the right thing, according to libtool.
Actually we get
on gentoo. Interesting! I never knew this. I think the solution may be to get our other packages using libcurl.pc.