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

3 messages from 2010-01-19 to 2010-01-19. Participants: Johannes Sixt, Ilari Liusvaara, Junio C Hamano.
Thread: https://gitlist.dev/t/22289

## Johannes Sixt, 2010-01-19 15:39

Subject: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables
Message-ID: <1263915552-32537-1-git-send-email-j6t@kdbg.org>
URL: https://gitlist.dev/e/1263915552-32537-1-git-send-email-j6t%40kdbg.org

```
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(-)

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, 2010-01-19 16:58

Subject: Re: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables
Message-ID: <20100119165858.GA24065@Knoppix>
URL: https://gitlist.dev/e/20100119165858.GA24065%40Knoppix
In-Reply-To: <1263915552-32537-1-git-send-email-j6t@kdbg.org>

```
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

```

## Junio C Hamano, 2010-01-19 23:31

Subject: Re: [PATCH] Makefile: honor NO_CURL when setting REMOTE_CURL_* variables
Message-ID: <7vockp7jtj.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vockp7jtj.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20100119165858.GA24065@Knoppix>

```
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:

> 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.

```
