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

Re: [PATCH] Makefile: Change library order for static linking

From
Remi Pommarel <repk@triplefau.lt>
Date
Sep 22, 2015, 20:37 UTC
Message-ID
<20150922203759.GB9793@cruxbox>
In-Reply-To
<xmqqh9mnbswv.fsf@gitster.mtv.corp.google.com>
On Mon, Sep 21, 2015 at 10:09:52AM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> I think I said this already, but I found these bits from your patch
> 
> -		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
> +		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
> 
> that first uses libcurl and then libs (which has ssl bits) totally
> sensible.  Shouldn't that be sufficient?

That is not sufficient on its own because -lssl is not added in $(LIBS), it is only added in $(CURL_LIBCURL) if NEEDS_SSL_WITH_CURL is set.

Show 7 quoted lines
> 
> > The proper variable I should have used is
> > NEEDS_SSL_WITH_CURL. But this variable is not setted on Linux and not
> > configurable,...
> 
> Really?  Anything is configurable from your config.mak, I would have
> thought.

You right using the parts you find sensible and adding "NEEDS_SSL_WITH_CURL=YesPlease" in config.mak makes git compile fine. So I will resubmit with only the sensible part of the patch.

I have one last question thought. Wouldn't it be nice if we had configure to autodetect the need for -lssl with libcurl ? We could make configure to check for Curl_ssl_init function symbol in libcurl, which is only present if libcurl has been compiled with openssl support, by adding something like that in configure.ac:

AC_CHECK_LIB([curl], [Curl_ssl_init],
	[NEEDS_SSL_WITH_CURL=YesPlease],
	[NEEDS_SSL_WITH_CURL=])

The thing that I'm afraid of is that checking a function that is not part of official libcurl API could be not very reliable, don't you think ?

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “Makefile: Change library order for static linking”
  1. Makefile: Change library order for static linkingRemi Pommarel, Sep 17, 2015
  2. Eric SunshineSep 17, 2015
  3. Remi PommarelSep 17, 2015
  4. Junio C HamanoSep 17, 2015
  5. Remi PommarelSep 17, 2015
  6. Junio C HamanoSep 17, 2015
  7. Remi PommarelSep 18, 2015
  8. Junio C HamanoSep 21, 2015
  9. Remi PommarelSep 22, 2015
  10. Junio C HamanoSep 22, 2015

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.