# [PATCH] Include local config before platform tweaks

5 messages from 2006-09-05 to 2006-09-06. Participants: Brian Gernhardt, Junio C Hamano, Shawn Pearce.
Thread: https://gitlist.dev/t/5491

## Brian Gernhardt, 2006-09-05 22:00

Subject: [PATCH] Include local config before platform tweaks
Message-ID: <9434EEBD-57BE-46D7-A2FF-069BB960AA44@silverinsanity.com>
URL: https://gitlist.dev/e/9434EEBD-57BE-46D7-A2FF-069BB960AA44%40silverinsanity.com

```
Having config.mak included after the platform tweaks ignores NO_FINK  
or NO_DARWIN_PORTS in that file.  Simply including the config earlier  
fixes that.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
Makefile |    6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 7b3114f..81902d4 100644
--- a/Makefile
+++ b/Makefile
@@ -300,6 +300,9 @@ BUILTIN_OBJS = \
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
LIBS = $(GITLIBS) -lz
+-include config.mak.autogen
+-include config.mak
+
#
# Platform specific tweaks
#
@@ -403,9 +406,6 @@ ifneq (,$(findstring arm,$(uname_M)))
	ARM_SHA1 = YesPlease
endif
--include config.mak.autogen
--include config.mak
-
ifdef WITH_OWN_SUBPROCESS_PY
	PYMODULES += compat/subprocess.py
else

```

## Junio C Hamano, 2006-09-05 22:13

Subject: Re: [PATCH] Include local config before platform tweaks
Message-ID: <7vlkoyarnx.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vlkoyarnx.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <9434EEBD-57BE-46D7-A2FF-069BB960AA44@silverinsanity.com>

```
Brian Gernhardt <benji@silverinsanity.com> writes:

> Having config.mak included after the platform tweaks ignores NO_FINK
> or NO_DARWIN_PORTS in that file.  Simply including the config earlier
> fixes that.

I vaguely recall that this was brought up before, and the
conclusion was that the include location is correct but the way
darwin bits were done was wrong.  I do not recall the details
but does anybody on the list know?

```

## Shawn Pearce, 2006-09-06 03:31

Subject: Re: [PATCH] Include local config before platform tweaks
Message-ID: <20060906033151.GB30540@spearce.org>
URL: https://gitlist.dev/e/20060906033151.GB30540%40spearce.org
In-Reply-To: <7vlkoyarnx.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> wrote:
> Brian Gernhardt <benji@silverinsanity.com> writes:
> 
> > Having config.mak included after the platform tweaks ignores NO_FINK
> > or NO_DARWIN_PORTS in that file.  Simply including the config earlier
> > fixes that.
> 
> I vaguely recall that this was brought up before, and the
> conclusion was that the include location is correct but the way
> darwin bits were done was wrong.  I do not recall the details
> but does anybody on the list know?

I think we just need to move the NO_FINK stuff below the include;
like this:


diff --git a/Makefile b/Makefile
index 164dbcf..748907b 100644
--- a/Makefile
+++ b/Makefile
@@ -328,18 +333,6 @@ ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
 	NO_STRLCPY = YesPlease
-	ifndef NO_FINK
-		ifeq ($(shell test -d /sw/lib && echo y),y)
-			BASIC_CFLAGS += -I/sw/include
-			BASIC_LDFLAGS += -L/sw/lib
-		endif
-	endif
-	ifndef NO_DARWIN_PORTS
-		ifeq ($(shell test -d /opt/local/lib && echo y),y)
-			BASIC_CFLAGS += -I/opt/local/include
-			BASIC_LDFLAGS += -L/opt/local/lib
-		endif
-	endif
 endif
 ifeq ($(uname_S),SunOS)
 	NEEDS_SOCKET = YesPlease
@@ -433,6 +426,21 @@ else
 	endif
 endif
 
+ifeq ($(uname_S),Darwin)
+	ifndef NO_FINK
+		ifeq ($(shell test -d /sw/lib && echo y),y)
+			BASIC_CFLAGS += -I/sw/include
+			BASIC_LDFLAGS += -L/sw/lib
+		endif
+	endif
+	ifndef NO_DARWIN_PORTS
+		ifeq ($(shell test -d /opt/local/lib && echo y),y)
+			BASIC_CFLAGS += -I/opt/local/include
+			BASIC_LDFLAGS += -L/opt/local/lib
+		endif
+	endif
+endif
+
 ifndef NO_CURL
 	ifdef CURLDIR
 		# This is still problematic -- gcc does not always want -R.

```

## Junio C Hamano, 2006-09-06 07:18

Subject: Re: [PATCH] Include local config before platform tweaks
Message-ID: <7vwt8h8nuf.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwt8h8nuf.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060906033151.GB30540@spearce.org>

```
Shawn Pearce <spearce@spearce.org> writes:

> Junio C Hamano <junkio@cox.net> wrote:
>> Brian Gernhardt <benji@silverinsanity.com> writes:
>> 
>> > Having config.mak included after the platform tweaks ignores NO_FINK
>> > or NO_DARWIN_PORTS in that file.  Simply including the config earlier
>> > fixes that.
>> 
>> I vaguely recall that this was brought up before, and the
>> conclusion was that the include location is correct but the way
>> darwin bits were done was wrong.  I do not recall the details
>> but does anybody on the list know?
>
> I think we just need to move the NO_FINK stuff below the include;
> like this:

Thanks Shawn.  Brian does Shawn's patch work for you?

```

## Brian Gernhardt, 2006-09-06 19:13

Subject: Re: [PATCH] Include local config before platform tweaks
Message-ID: <5EDA627C-CBE3-4408-A4F5-D668BB2478BC@silverinsanity.com>
URL: https://gitlist.dev/e/5EDA627C-CBE3-4408-A4F5-D668BB2478BC%40silverinsanity.com
In-Reply-To: <7vwt8h8nuf.fsf@assigned-by-dhcp.cox.net>

```
On Sep 6, 2006, at 3:18 AM, Junio C Hamano wrote:

> Thanks Shawn.  Brian does Shawn's patch work for you?

Short answer: Yes

Long answer:
The patch from his e-mail failed (git apply: fatal: corrupt patch at  
line 27), but manually making the changes worked.  I didn't pull  
before applying that, so that's probably the problem there.

~~Brian

```
