@matheusbsbs / matheus-bagliano / commits / b6e56eca8a
Fork 0

Allow building Git in systems without iconv

Systems using some uClibc versions do not properly support iconv stuff. This patch allows Git to be built on those systems by passing NO_ICONV=YesPlease to make. The only drawback is mailinfo won't do charset conversion in those systems. Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Fernando J. Pereda committed Feb 16, 2006 at 09:38 UTC b6e56eca8a4eb74a86e9f2d99aa480c665458aa7
2 files changed +10
Makefile
+6
@@ -53,6 +53,8 @@ all:
53 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
54 # sockaddr_storage.
55 #
56 +# Define NO_ICONV if your libc does not properly support iconv.
57 +#
58 # Define COLLISION_CHECK below if you believe that SHA1's
59 # 1461501637330902918203684832716283019655932542976 hashes do not give you
60 # sufficient guarantee that no collisions between objects will ever happen.
@@ -380,6 +382,10 @@ else
382 endif
383 endif
384
385 +ifdef NO_ICONV
386 + ALL_CFLAGS += -DNO_ICONV
387 +endif
388 +
389 ifdef PPC_SHA1
390 SHA1_HEADER = "ppc/sha1.h"
391 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
mailinfo.c
+4
@@ -7,7 +7,9 @@
7 #include <stdlib.h>
8 #include <string.h>
9 #include <ctype.h>
10 +#ifndef NO_ICONV
11 #include <iconv.h>
12 +#endif
13 #include "git-compat-util.h"
14 #include "cache.h"
15
@@ -469,6 +471,7 @@ static int decode_b_segment(char *in, char *ot, char *ep)
471
472 static void convert_to_utf8(char *line, char *charset)
473 {
474 +#ifndef NO_ICONV
475 char *in, *out;
476 size_t insize, outsize, nrc;
477 char outbuf[4096]; /* cheat */
@@ -501,6 +504,7 @@ static void convert_to_utf8(char *line, char *charset)
504 return;
505 *out = 0;
506 strcpy(line, outbuf);
507 +#endif
508 }
509
510 static void decode_header_bq(char *it)