Blame m4/iconv_open.m4

Packit Service fdd496
# iconv_open.m4 serial 14
Packit Service fdd496
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
Packit Service fdd496
dnl This file is free software; the Free Software Foundation
Packit Service fdd496
dnl gives unlimited permission to copy and/or distribute it,
Packit Service fdd496
dnl with or without modifications, as long as this notice is preserved.
Packit Service fdd496
Packit Service fdd496
AC_DEFUN([gl_FUNC_ICONV_OPEN],
Packit Service fdd496
[
Packit Service fdd496
  AC_REQUIRE([AM_ICONV])
Packit Service fdd496
  AC_REQUIRE([AC_CANONICAL_HOST])
Packit Service fdd496
  AC_REQUIRE([gl_ICONV_H_DEFAULTS])
Packit Service fdd496
  if test "$am_cv_func_iconv" = yes; then
Packit Service fdd496
    dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
Packit Service fdd496
    gl_REPLACE_ICONV_H
Packit Service fdd496
    dnl Test whether iconv_open accepts standardized encoding names.
Packit Service fdd496
    dnl We know that GNU libiconv and GNU libc do.
Packit Service fdd496
    AC_EGREP_CPP([gnu_iconv], [
Packit Service fdd496
      #include <iconv.h>
Packit Service fdd496
      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
Packit Service fdd496
       gnu_iconv
Packit Service fdd496
      #endif
Packit Service fdd496
      ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
Packit Service fdd496
    if test $gl_func_iconv_gnu = no; then
Packit Service fdd496
      iconv_flavor=
Packit Service fdd496
      case "$host_os" in
Packit Service fdd496
        aix*)     iconv_flavor=ICONV_FLAVOR_AIX ;;
Packit Service fdd496
        irix*)    iconv_flavor=ICONV_FLAVOR_IRIX ;;
Packit Service fdd496
        hpux*)    iconv_flavor=ICONV_FLAVOR_HPUX ;;
Packit Service fdd496
        osf*)     iconv_flavor=ICONV_FLAVOR_OSF ;;
Packit Service fdd496
        solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
Packit Service fdd496
      esac
Packit Service fdd496
      if test -n "$iconv_flavor"; then
Packit Service fdd496
        AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
Packit Service fdd496
          [Define to a symbolic name denoting the flavor of iconv_open()
Packit Service fdd496
           implementation.])
Packit Service fdd496
        gl_REPLACE_ICONV_OPEN
Packit Service fdd496
      fi
Packit Service fdd496
    fi
Packit Service fdd496
    m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
Packit Service fdd496
      gl_FUNC_ICONV_OPEN_UTF_SUPPORT
Packit Service fdd496
      if test $gl_cv_func_iconv_supports_utf = no; then
Packit Service fdd496
        REPLACE_ICONV_UTF=1
Packit Service fdd496
        AC_DEFINE([REPLACE_ICONV_UTF], [1],
Packit Service fdd496
          [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
Packit Service fdd496
        REPLACE_ICONV=1
Packit Service fdd496
        gl_REPLACE_ICONV_OPEN
Packit Service fdd496
      fi
Packit Service fdd496
    ])
Packit Service fdd496
  fi
Packit Service fdd496
])
Packit Service fdd496
Packit Service fdd496
AC_DEFUN([gl_REPLACE_ICONV_OPEN],
Packit Service fdd496
[
Packit Service fdd496
  gl_REPLACE_ICONV_H
Packit Service fdd496
  REPLACE_ICONV_OPEN=1
Packit Service fdd496
])