git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Allow building Git in systems without iconv

From
FPFernando J. Pereda <ferdy@gentoo.org>
Date
Feb 16, 2006, 08:38 UTC
Message-ID
<20060216083801.GB9323@ferdyx.org>

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>
---
 Makefile   |    6 ++++++
 mailinfo.c |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)
ca34460f60a4e0e037953124b91d3377db2cd1c8
diff --git a/Makefile b/Makefile
index 648469e..317be3c 100644
--- a/Makefile
+++ b/Makefile
@@ -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.
@@ -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
diff --git a/mailinfo.c b/mailinfo.c
index ff2d4d4..3c56f8c 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -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"
 
@@ -469,6 +471,7 @@ static int decode_b_segment(char *in, ch
 
 static void convert_to_utf8(char *line, char *charset)
 {
+#ifndef NO_ICONV
 	char *in, *out;
 	size_t insize, outsize, nrc;
 	char outbuf[4096]; /* cheat */
@@ -501,6 +504,7 @@ static void convert_to_utf8(char *line, 
 		return;
 	*out = 0;
 	strcpy(line, outbuf);
+#endif
 }
 
 static void decode_header_bq(char *it)
-- 
1.2.0
Message 1 of 1 in “Allow building Git in systems without iconv”
  1. Allow building Git in systems without iconvFernando J. Pereda, Feb 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.