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

Re: [PATCH] Makefile: default to -lcurl when no CURL_CONFIG or CURLDIR

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 28, 2014, 20:05 UTC
Message-ID
<20140428200550.GO9218@google.com>
In-Reply-To
<1398714653-1050-1-git-send-email-dborowitz@google.com>
Dave Borowitz wrote:
Show 6 quoted lines
> Instead, if CURL_CONFIG is empty or returns an empty result (e.g. due
> to curl-config being missing), use the old behavior of falling back to
> -lcurl.
> ---
>  Makefile | 36 +++++++++++++++++++++++++-----------
>  1 file changed, 25 insertions(+), 11 deletions(-)
Sign-off?
[...]
Show 9 quoted lines
> +++ b/Makefile
> @@ -35,7 +35,9 @@ all::
>  # transports (neither smart nor dumb).
>  #
>  # Define CURL_CONFIG to the path to a curl-config binary other than the
> -# default 'curl-config'.
> +# default 'curl-config'. If CURL_CONFIG is unset or points to a binary that
> +# is not found, defaults to the CURLDIR behavior, or if CURLDIR is not set,
> +# uses -lcurl with no additional library detection.

I'm having a little trouble parsing this but don't have any better suggestion.

[...]
Show 8 quoted lines
> @@ -1127,9 +1129,27 @@ ifdef NO_CURL
>  	REMOTE_CURL_NAMES =
>  else
>  	ifdef CURLDIR
> -		# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
> -		BASIC_CFLAGS += -I$(CURLDIR)/include
> -		CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
> +		CURL_LIBCURL=

Tiny nit: elsewhere the makefile seems to prefer having a space before the '='.

If I explicitly set CURL_LIBCURL to the empty string and CURLDIR was set then my setting will still override the setting below and the behavior is unchanged from before this patch --- good.

If I explicitly set CURL_LIBCURL to empty and CURLDIR was unset then that used to produce an error so it was an invalid configuration and couldn't regress.

So this should be safe --- good.
> +	else
> +		CURL_CONFIG ?= curl-config

Not about this patch, but the above '?=' should probably be plain '=' for consistency with the rest of the makefile's behavior wrt envvars.

[...]
> -				$(error libcurl not detected; try setting CURLDIR)
> +                                $(error libcurl not detected or not compiled with static support)
Whitespace damage.
Except for the whitespace issues,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
Previous: Dave BorowitzNext: Dave Borowitz
Message 2 of 10 in “Makefile: default to -lcurl when no CURL_CONFIG or CURLDIR”
  1. Makefile: default to -lcurl when no CURL_CONFIG or CURLDIRDave Borowitz, Apr 28, 2014
  2. Jonathan NiederApr 28, 2014
  3. Dave BorowitzApr 28, 2014
  4. Dave BorowitzApr 28, 2014
  5. Jonathan NiederApr 28, 2014
  6. Dave BorowitzApr 28, 2014
  7. Junio C HamanoApr 28, 2014
  8. Junio C HamanoApr 28, 2014
  9. Junio C HamanoApr 28, 2014
  10. Dave BorowitzApr 28, 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.