<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">As discussed here [1] on GitHub, 'curl-config --libs' is returning results like this:<br><br>-L/opt/local/lib -lcurl -lidn2 -lpsl -lssl -lcrypto -lssl -lcrypto -lz<br></div><div dir="ltr"><br></div><div>while 'pkg-config --libs libcurl' gives this:</div><div><br></div><div>-L/opt/local/lib -lcurl<br></div><div><br></div><div>The curl-config version results in lots of unnecessary libraries being linked against by the resulting binary. As a result, executables depending on libcurl (but not the underling lib API calls directly) can break (unnecessarily) if they use the curl-config --libs output when the underlying dependencies (like libidn2) change.</div><div><br></div><div>It looks like FreeBSD takes the approach (linked in the GitHub comments) of modifying libtool's <a href="http://libtool.mk">libtool.mk</a> to change its link_all_deplibs behavior (to "no") for a number of ports (any with 'using libtool'.)</div><div><br></div><div>Ubuntu does something similar to end up with a crow-barred clause of 'if test "Xno" = "Xyes"; then' in curl-config such that --libs returns '-lcurl' alone; I haven't tracked down their actual build scripts for this.</div><div><br></div><div>RedHat 6 (I haven't checked 7) changes curl-config --libs to just call 'pkg-config --libs libcurl' directly.</div><br>Any thoughts on how to resolve this? Take the FreeBSD/Ubuntu approach of patching <a href="http://libtool.mk">libtool.mk</a> at some point (for all ports? for just curl?) to say link_all_deplibs="no"? Every OS on upstream GNU libtool returns "yes" or "unknown" (="yes"), and you can google for link_all_deplibs Debian to see some discussions of the pros and cons of "no".</div><div dir="ltr"><br></div><div dir="ltr">I built and tested curl with this approach (patching <a href="http://libtool.mk">libtool.mk</a> post autoconf) with no issues.</div><div dir="ltr"><br></div><div dir="ltr">Thoughts? Something I've got clearly wrong?</div><div dir="ltr"><br></div><div>Thanks,</div><div>  - Eric</div><div><br></div><div>[1] <a href="https://github.com/macports/macports-ports/commit/7b23c55e903aa412f007b825e129e813a581b2ff#commitcomment-31890082">https://github.com/macports/macports-ports/commit/7b23c55e903aa412f007b825e129e813a581b2ff#commitcomment-31890082</a></div><div dir="ltr"><div><br></div></div></div></div></div></div></div></div>