git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Dave Borowitz
Message 5 of 5 in “Makefile: use curl-config to determine curl flags”
  1. 1/2 Makefile: use curl-config to determine curl flagsDave Borowitz, Apr 12, 2014
  2. 2/2 Makefile: allow static linking against libcurlDave Borowitz, Apr 12, 2014
  3. Junio C HamanoApr 14, 2014
  4. Dave BorowitzApr 15, 2014
  5. Junio C HamanoApr 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.