3 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_ICONV_OPEN],
10 AC_REQUIRE([AM_ICONV])
11 AC_REQUIRE([AC_CANONICAL_HOST])
12 AC_REQUIRE([gl_ICONV_H_DEFAULTS])
13 if test "$am_cv_func_iconv" = yes; then
14 dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
16 dnl Test whether iconv_open accepts standardized encoding names.
17 dnl We know that GNU libiconv and GNU libc do.
18 AC_EGREP_CPP([gnu_iconv], [
20 #if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
21 || (defined __GLIBC__ && !defined __UCLIBC__)
24 ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
25 if test $gl_func_iconv_gnu = no; then
28 aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
29 irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
30 hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
31 osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
32 solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
33 openedition*) iconv_flavor=ICONV_FLAVOR_ZOS ;;
35 if test -n "$iconv_flavor"; then
36 AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
37 [Define to a symbolic name denoting the flavor of iconv_open()
42 m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
43 gl_FUNC_ICONV_OPEN_UTF_SUPPORT
44 case "$gl_cv_func_iconv_supports_utf" in
48 AC_DEFINE([REPLACE_ICONV_UTF], [1],
49 [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
58 AC_DEFUN([gl_REPLACE_ICONV_OPEN],