threads / patch / 22289

patchMakefile: honor NO_CURL when setting REMOTE_CURL_* variables

Subject: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables

## tl;dr

3 messages between Jan 19, 2010 and Jan 19, 2010. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Johannes Sixt· Jan 19, 2010, 15:39 UTC · lore

Previously, these variables were set before there was a chance to set NO_CURL.

This made a difference only during 'make install', because by installing $(REMOTE_CURL_ALIASES), the rule tries to access $(REMOTE_CURL_PRIMARY), which was never installed. On Windows, this fails; on Unix, stale symbolic links are created.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 Makefile |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
Show changes to Makefile +6 −10
diff --git a/Makefile b/Makefile
index 8ed07cf..43fd686 100644
--- a/Makefile
+++ b/Makefile
@@ -423,18 +423,8 @@ BUILT_INS += git-show$X
 BUILT_INS += git-stage$X
 BUILT_INS += git-status$X
 BUILT_INS += git-whatchanged$X
 
-ifdef NO_CURL
-REMOTE_CURL_PRIMARY =
-REMOTE_CURL_ALIASES =
-REMOTE_CURL_NAMES =
-else
-REMOTE_CURL_PRIMARY = git-remote-http$X
-REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
-REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
-endif
-
 # what 'all' will build and 'install' will install in gitexecdir,
 # excluding programs for built-in commands
 ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 
@@ -1108,16 +1098,22 @@ ifdef NO_LIBGEN_H
 endif
 
 ifdef NO_CURL
 	BASIC_CFLAGS += -DNO_CURL
+	REMOTE_CURL_PRIMARY =
+	REMOTE_CURL_ALIASES =
+	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
 	else
 		CURL_LIBCURL = -lcurl
 	endif
+	REMOTE_CURL_PRIMARY = git-remote-http$X
+	REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
+	REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
 	PROGRAMS += $(REMOTE_CURL_NAMES) git-http-fetch$X
 	curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
 	ifeq "$(curl_check)" "070908"
 		ifndef NO_EXPAT
-- 
1.6.6.283.g42b20a
Ilari Liusvaara· Jan 19, 2010, 16:58 UTC · re: Johannes Sixt · lore

Re: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables

On Tue, Jan 19, 2010 at 04:39:12PM +0100, Johannes Sixt wrote:
Show 7 quoted lines
> Previously, these variables were set before there was a chance to set
> NO_CURL.
> 
> This made a difference only during 'make install', because by installing
> $(REMOTE_CURL_ALIASES), the rule  tries to access $(REMOTE_CURL_PRIMARY),
> which was never installed. On Windows, this fails; on Unix, stale symbolic
> links are created.
 
<snip patch>

I didn't even compile-test it, but based on quick look I don't see any obivous mistakes. There are no references to REMOTE_CURL_* in section moved over, and the variable values should not differ unless section skipped sets NO_CURL. So:

Acked-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
-Ilari
Junio C Hamano· Jan 19, 2010, 23:31 UTC · re: Ilari Liusvaara · lore

Re: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 19 quoted lines
> On Tue, Jan 19, 2010 at 04:39:12PM +0100, Johannes Sixt wrote:
>> Previously, these variables were set before there was a chance to set
>> NO_CURL.
>> 
>> This made a difference only during 'make install', because by installing
>> $(REMOTE_CURL_ALIASES), the rule  tries to access $(REMOTE_CURL_PRIMARY),
>> which was never installed. On Windows, this fails; on Unix, stale symbolic
>> links are created.
>  
> <snip patch>
>
> I didn't even compile-test it, but based on quick look I don't see any
> obivous mistakes. There are no references to REMOTE_CURL_* in section
> moved over, and the variable values should not differ unless section skipped
> sets NO_CURL. So:
>
> Acked-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
>
> -Ilari
Thanks.

← back to recent threads