Re: [PATCH 1/2] Makefile: use curl-config to determine curl flags
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 15, 2014, 16:50 UTC
- Message-ID
- <xmqqa9bmleoq.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAD0k6qQJE6a5DmRnpiFpOc_MFjSn9eFyiJ2nFaL63rctvxwt5Q@mail.gmail.com>
Dave Borowitz <dborowitz@google.com> writes:
Show 23 quoted lines
> My end goal is to statically link git on Mac OS X (10.9) against a > newer version of libcurl than ships with the OS. The normal CURLDIR > approach should work with system libcurl: > > $ /usr/bin/curl-config --libs > -lcurl > > But it gets a bit more complicated with a recent curl version. This > likely has to do with the set of enabled options; I passed flags to > ./configure based on the build script "MacOSX-Framework" included in > the curl distribution: > $ ~/d/curl-out-7.36.0/bin/curl-config --libs > -L/Users/dborowitz/d/curl-out-7.36.0/lib -lcurl -lgssapi_krb5 -lresolv > -lldap -lz > > And with --static-libs there's just that much more: > $ ~/d/curl-out-7.36.0/bin/curl-config --static-libs > /Users/dborowitz/d/curl-out-7.36.0/lib/libcurl.a > -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk > -arch x86_64 -Wl,-headerpad_max_install_names -framework > CoreFoundation -framework Security -lgssapi_krb5 -lresolv -lldap -lz > > So I don't think specifying NEEDS_*_WITH_CURL scales to this use case.
Thanks. As I said, the kosher way to learn how to link with libcURL is by asking curl-config about the details of options to give to the compiler and the linker, so I am all for this change.
Show 5 quoted lines
> While writing this up I also noticed an issue with the second patch, > namely that `curl-config --static-libs` is empty when curl is not > built for static linking. > > I will reroll with a more detailed commit message and a fix to the second patch.
I love it whenever I see the contents of the patch improved after spending a bit more time trying to describe the problem and the solution (which is time worth spending).
Thanks.