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

[PATCH 2/2] autoconf: Add support for setting NO_ICONV and ICONVDIR

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 7, 2006, 11:48 UTC
Message-ID
<200609071348.49935.jnareb@gmail.com>
In-Reply-To
<200609071347.32152.jnareb@gmail.com>

Add support for ./configure options --without-iconv (if neither libc nor libiconv properly support iconv), and for --with-iconv=PATH (to set prefix to libiconv library and headers, used only when NEED_LIBICONV is set). While at it, make ./configure set or unset NO_ICONV always (it is not autodetected in Makefile).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
The config.mak.in patch just adds or uncomments 
NO_ICONV=@NO_ICONV@

at the end of the file. If there is conflict during applying this part of patchset (for example "autoconf: Add some commented out variables to config.mak.in" and "autoconf: Preliminary check for working mmap" are not applied), just modify config.mak.in to have this line at the end.

 config.mak.in |    2 +-
 configure.ac  |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index 2c8fd2c..fccde61 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -38,5 +38,5 @@ NO_STRCASESTR=@NO_STRCASESTR@
 NO_STRLCPY=@NO_STRLCPY@
 NO_SETENV=@NO_SETENV@
 NO_MMAP=@NO_MMAP@
-#NO_ICONV=@NO_ICONV@
+NO_ICONV=@NO_ICONV@
 
diff --git a/configure.ac b/configure.ac
index 8af276c..6a980a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,8 +148,9 @@ AC_CHECK_LIB([c], [iconv],
 	[NEEDS_LIBICONV=],
 	AC_CHECK_LIB([iconv], [iconv],
 		[NEEDS_LIBICONV=YesPlease],
-		[GIT_CONF_APPEND_LINE([NO_ICONV=YesPlease])]))
+		[NO_ICONV=YesPlease]))
 AC_SUBST(NEEDS_LIBICONV)
+AC_SUBST(NO_ICONV)
 test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv"
 #
 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
@@ -350,6 +351,16 @@ # specify your own (or DarwinPort's) inc
 # library directories by defining CFLAGS and LDFLAGS appropriately.
 #
 # Define NO_MMAP if you want to avoid mmap.
+#
+# Define NO_ICONV if your libc does not properly support iconv.
+AC_ARG_WITH(iconv,
+AS_HELP_STRING([--without-iconv],
+[if your architecture doesn't properly support iconv])
+AS_HELP_STRING([--with-iconv=PATH],
+[PATH is prefix for libiconv library and headers])
+AS_HELP_STRING([],
+[used only if you need linking with libiconv]),
+GIT_PARSE_WITH(iconv))
 
 ## --enable-FEATURE[=ARG] and --disable-FEATURE
 #
-- 
1.4.2
Previous: Jakub Narebski
Message 3 of 3 in “autoconf: iconv”
  1. 0/2 autoconf: iconvJakub Narebski, Sep 7, 2006
  2. 1/2 autoconf: Set NO_ICONV if iconv is found neither in libc, nor in libiconvJakub Narebski, Sep 7, 2006
  3. 2/2 autoconf: Add support for setting NO_ICONV and ICONVDIRJakub Narebski, Sep 7, 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.