diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-02-26 04:12:52 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-02-26 04:12:52 +0000 |
commit | 7e620ee072009ee445c1189cced044ba22495819 (patch) | |
tree | 430e3819cebce27fc88b9c42a081e1c6772f22f5 /configure.in | |
parent | 11026f653803dd49d0a8136ffc3d13d40558231d (diff) | |
download | glib-7e620ee072009ee445c1189cced044ba22495819.tar.gz |
Check for iconv_* in -liconv as well as libiconv_* in -liconv since AIX
Mon Feb 25 23:01:53 2002 Owen Taylor <otaylor@redhat.com>
* configure.in acconfig.h config.h.win32.in
glib/gconvert.c: Check for iconv_* in -liconv
as well as libiconv_* in -liconv since AIX ships
the system iconv in a separate library.
Patch from Miroslaw Dobrzanski-Neumann (#72569)
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/configure.in b/configure.in index 0783b5d10..42920e794 100644 --- a/configure.in +++ b/configure.in @@ -1520,32 +1520,47 @@ dnl *********************** dnl *** Tests for iconv *** dnl *********************** -AC_ARG_WITH(libiconv, [ --with-libiconv use the libiconv library ],,with_libiconv=maybe) +AC_ARG_WITH(libiconv, [ --with-libiconv=[no/gnu/native] use the libiconv library ],,with_libiconv=maybe) found_iconv=no - -if test "x$with_libiconv" != "xyes" ; then - # - # Check in the C library - # - AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes) -fi - -if test "x$with_libiconv" != "xno" ; then - # - # Check for libiconv - # - AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=yes; found_iconv=yes) -fi +case $with_libiconv in + maybe) + # Check in the C library first + AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes) + # Check if we have GNU libiconv + if test $found_iconv = "no"; then + AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=gnu; found_iconv=yes) + fi + # Check if we have a iconv in -liconv, possibly from vendor + if test $found_iconv = "no"; then + AC_CHECK_LIB(iconv, iconv_open, with_libiconv=native; found_iconv=yes) + fi + ;; + no) + AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes) + ;; + gnu|yes) + AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=gnu; found_iconv=yes) + ;; + native) + AC_CHECK_LIB(iconv, iconv_open, with_libiconv=native; found_iconv=yes) + ;; +esac if test "x$found_iconv" = "xno" ; then AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv]) fi -if test "x$with_libiconv" = "xyes" ; then - ICONV_LIBS="-liconv" - AC_DEFINE(USE_LIBICONV) -fi +case $with_libiconv in + gnu) + ICONV_LIBS="-liconv" + AC_DEFINE(USE_LIBICONV_GNU, [Using GNU libiconv]) + ;; + native) + ICONV_LIBS="-liconv" + AC_DEFINE(USE_LIBICONV_NATIVE, [Using a native implementation of iconv in a separate library]) + ;; +esac AC_SUBST(ICONV_LIBS) dnl If the system doesn't define EILSEQ, we should define EILSEQ ourselves |