Skip to content

Commit

Permalink
Allow building Git in systems without iconv
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fernando J. Pereda authored and Junio C Hamano committed Feb 16, 2006
1 parent be97bd1 commit b6e56ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ all:
# Define NO_SOCKADDR_STORAGE if your platform does not have struct
# sockaddr_storage.
#
# Define NO_ICONV if your libc does not properly support iconv.
#
# Define COLLISION_CHECK below if you believe that SHA1's
# 1461501637330902918203684832716283019655932542976 hashes do not give you
# sufficient guarantee that no collisions between objects will ever happen.
Expand Down Expand Up @@ -380,6 +382,10 @@ else
endif
endif

ifdef NO_ICONV
ALL_CFLAGS += -DNO_ICONV
endif

ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
Expand Down
4 changes: 4 additions & 0 deletions mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef NO_ICONV
#include <iconv.h>
#endif
#include "git-compat-util.h"
#include "cache.h"

Expand Down Expand Up @@ -469,6 +471,7 @@ static int decode_b_segment(char *in, char *ot, char *ep)

static void convert_to_utf8(char *line, char *charset)
{
#ifndef NO_ICONV
char *in, *out;
size_t insize, outsize, nrc;
char outbuf[4096]; /* cheat */
Expand Down Expand Up @@ -501,6 +504,7 @@ static void convert_to_utf8(char *line, char *charset)
return;
*out = 0;
strcpy(line, outbuf);
#endif
}

static void decode_header_bq(char *it)
Expand Down

0 comments on commit b6e56ec

Please sign in to comment.