# [PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin

4 messages from 2005-09-07 to 2005-09-07. Participants: Mark Allen, Junio C Hamano.
Thread: https://gitlist.dev/t/1741

## Mark Allen, 2005-09-07 03:08

Subject: [PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin
Message-ID: <20050907030855.9278.qmail@web34313.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20050907030855.9278.qmail%40web34313.mail.mud.yahoo.com

```
[PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin 

This trivial patch creates $(LIBS) and sets it to iconv in tools/Makefile because MacOS
10.4 [gcc 4.0] gets cranky about libiconv routines referenced in mailinfo.c
(convert_to_utf8) and no library pointer to link the symbols against.

I haven't tested this on Linux yet (but I will tomorrow when I get into work).

Signed-off-by: Mark Allen <mrallen1@yahoo.com>

[PATCH] Add LIBS field and populate with iconv to tools/Makefile for Darwin 

OS X.4 [gcc 4.0] gets cranky about iconv data structures and no 
library pointer to link the symbols against.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
---

 tools/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

44865be29a83e2b4b0bf65c6dae427203b7be9b9
diff --git a/tools/Makefile b/tools/Makefile
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -7,13 +7,14 @@ ALL_CFLAGS = $(CFLAGS)
 INSTALL=install
 prefix=$(HOME)
 bindir=$(prefix)/bin
+LIBS=iconv
 # DESTDIR=
 
 PROGRAMS=git-mailsplit git-mailinfo
 SCRIPTS=git-applymbox git-applypatch
 
 git-%: %.c
-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.c,$^)
+	$(CC) $(ALL_CFLAGS) -l$(LIBS) -o $@ $(filter %.c,$^)
 
 all: $(PROGRAMS)
 

```

## Junio C Hamano, 2005-09-07 05:47

Subject: Re: [PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin
Message-ID: <7v8xy9bfaj.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xy9bfaj.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050907030855.9278.qmail@web34313.mail.mud.yahoo.com>

```
Mark Allen <mrallen1@yahoo.com> writes:

> This trivial patch creates $(LIBS) and sets it to iconv in
> tools/Makefile because MacOS 10.4 [gcc 4.0] gets cranky about
> libiconv routines referenced in mailinfo.c (convert_to_utf8)
> and no library pointer to link the symbols against.

I'd do this slightly differently.  Could you take a look at what
I have in the "proposed updates" branch, especially "Flatten
tools/ directory" commit?  What I am aiming for is to have
platform specific ifeq() thing in only one place.

```

## Mark Allen, 2005-09-07 15:01

Subject: Re: [PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin
Message-ID: <20050907150103.11609.qmail@web34311.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20050907150103.11609.qmail%40web34311.mail.mud.yahoo.com
In-Reply-To: <7v8xy9bfaj.fsf@assigned-by-dhcp.cox.net>

```
--- Junio C Hamano <junkio@cox.net> wrote:
> I'd do this slightly differently.  Could you take a look at what
> I have in the "proposed updates" branch, especially "Flatten
> tools/ directory" commit?  What I am aiming for is to have
> platform specific ifeq() thing in only one place.

Looks good to me, Junio.  There's a very small typo in your commit though. :-)

Cheers,

--Mark

---

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@ else
        MOZILLA_SHA1=1
        OPENSSL_LIBSSL=
 endif
-ifdef NEEDS_SSL_WITH_CRIPTO
+ifdef NEEDS_SSL_WITH_CRYPTO
        LIB_4_CRYPTO = -lcrypto -lssl
 else
        LIB_4_CRYPTO = -lcrypto

```

## Junio C Hamano, 2005-09-07 19:18

Subject: Re: [PATCH] Add $(LIBS) and set libiconv in tools/Makefile for Darwin
Message-ID: <7vd5nk6601.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd5nk6601.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050907150103.11609.qmail@web34311.mail.mud.yahoo.com>

```
Mark Allen <mrallen1@yahoo.com> writes:

> Looks good to me, Junio.  There's a very small typo in your
> commit though. :-)

Thanks.

```
