autoconf: iconv
cover autoconf: iconv
Those two patches add support for remaining iconv related compilation variables, namely NO_ICONV and ICONVDIR to configure.ac. First patch sets NO_ICONV if no iconv implementation was found (autodetection), second adds --without-iconv/--with-iconv=PATH option to generated ./configure script (user input).
This series is based on my earlier autoconf series "[PATCH 0/5] Some autoconf patches", but with little editing of config.mak.in patch in the PATCH 2/2 they could be applied on top of 'next' branch.
Shortlog:
[PATCH 1/2] autoconf: Set NO_ICONV if iconv is found neither in libc, nor in libiconv [PATCH 2/2] autoconf: Add support for setting NO_ICONV and ICONVDIR
Diffstat:
config.mak.in | 2 +- configure.ac | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-)
Signature · 3 lines
Jakub Narebski ShadeHawk on #git Poland
PATCH 1/2 autoconf: Set NO_ICONV if iconv is found neither in libc, nor in libiconv
---
This patch only adds NO_ICONV=YesPlease, and it never unsets NO_ICONV. This doesn't matter now because there is no setting NO_ICONV value in Makefile (no architecture/system based detection).
configure.ac | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
configure.ac +5 -2
@@ -143,9 +143,12 @@ AC_CHECK_LIB([expat], [XML_ParserCreate] AC_SUBST(NO_EXPAT) # # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). +# Define NO_ICONV if neither libc nor libiconv support iconv. AC_CHECK_LIB([c], [iconv], -[NEEDS_LIBICONV=], -[NEEDS_LIBICONV=YesPlease]) + [NEEDS_LIBICONV=], + AC_CHECK_LIB([iconv], [iconv], + [NEEDS_LIBICONV=YesPlease], + [GIT_CONF_APPEND_LINE([NO_ICONV=YesPlease])])) AC_SUBST(NEEDS_LIBICONV) test -n "$NEEDS_LIBICONV" && LIBS="$LIBS -liconv" #
Signature · 1 line
1.4.2
PATCH 2/2 autoconf: Add support for setting NO_ICONV and ICONVDIR
In reply to Jakub NarebskiAdd 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).
---
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(-)
config.mak.in +1 -1
@@ -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@
configure.ac +12 -1
@@ -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 #
Signature · 1 line
1.4.2