{"thread":{"id":"3356","subject":"[PATCH] Allow building Git in systems without iconv","startedAt":"2006-02-16T08:38:01Z","lastAt":"2006-02-16T08:38:01Z","messageCount":1,"participants":["Fernando J. Pereda"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16259","messageId":"20060216083801.GB9323@ferdyx.org","threadId":"3356","inReplyTo":null,"subject":"[PATCH] Allow building Git in systems without iconv","fromName":"Fernando J. Pereda","fromEmail":"ferdy@gentoo.org","sentAt":"2006-02-16T08:38:01Z","receivedAt":"2006-02-16T08:38:01Z","isPatch":true,"sender":{"key":"ferdy@gentoo.org","avatar":null},"body":"Systems using some uClibc versions do not properly support\niconv stuff. This patch allows Git to be built on those\nsystems by passing NO_ICONV=YesPlease to make. The only\ndrawback is mailinfo won't do charset conversion in those\nsystems.\n\nSigned-off-by: Fernando J. Pereda <ferdy@gentoo.org>\n\n---\n\n Makefile   |    6 ++++++\n mailinfo.c |    4 ++++\n 2 files changed, 10 insertions(+), 0 deletions(-)\n\nca34460f60a4e0e037953124b91d3377db2cd1c8\ndiff --git a/Makefile b/Makefile\nindex 648469e..317be3c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -53,6 +53,8 @@ all:\n # Define NO_SOCKADDR_STORAGE if your platform does not have struct\n # sockaddr_storage.\n #\n+# Define NO_ICONV if your libc does not properly support iconv.\n+#\n # Define COLLISION_CHECK below if you believe that SHA1's\n # 1461501637330902918203684832716283019655932542976 hashes do not give you\n # sufficient guarantee that no collisions between objects will ever happen.\n@@ -380,6 +382,10 @@ else\n endif\n endif\n \n+ifdef NO_ICONV\n+\tALL_CFLAGS += -DNO_ICONV\n+endif\n+\n ifdef PPC_SHA1\n \tSHA1_HEADER = \"ppc/sha1.h\"\n \tLIB_OBJS += ppc/sha1.o ppc/sha1ppc.o\ndiff --git a/mailinfo.c b/mailinfo.c\nindex ff2d4d4..3c56f8c 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -7,7 +7,9 @@\n #include <stdlib.h>\n #include <string.h>\n #include <ctype.h>\n+#ifndef NO_ICONV\n #include <iconv.h>\n+#endif\n #include \"git-compat-util.h\"\n #include \"cache.h\"\n \n@@ -469,6 +471,7 @@ static int decode_b_segment(char *in, ch\n \n static void convert_to_utf8(char *line, char *charset)\n {\n+#ifndef NO_ICONV\n \tchar *in, *out;\n \tsize_t insize, outsize, nrc;\n \tchar outbuf[4096]; /* cheat */\n@@ -501,6 +504,7 @@ static void convert_to_utf8(char *line, \n \t\treturn;\n \t*out = 0;\n \tstrcpy(line, outbuf);\n+#endif\n }\n \n static void decode_header_bq(char *it)\n-- \n1.2.0\n"}]}