OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [config/] [iconv.m4] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
# iconv.m4 serial AM4 (gettext-0.11.3)
# iconv.m4 serial AM4 (gettext-0.11.3)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License.  As a special exception to the GNU General
dnl General Public License.  As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl the same distribution terms as the rest of that program.
 
 
dnl From Bruno Haible.
dnl From Bruno Haible.
 
 
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
[
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  AC_REQUIRE([AC_LIB_RPATH])
  AC_REQUIRE([AC_LIB_RPATH])
 
 
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  dnl accordingly.
  dnl accordingly.
  AC_LIB_LINKFLAGS_BODY([iconv])
  AC_LIB_LINKFLAGS_BODY([iconv])
])
])
 
 
AC_DEFUN([AM_ICONV_LINK],
AC_DEFUN([AM_ICONV_LINK],
[
[
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  dnl those with the standalone portable GNU libiconv installed).
  dnl those with the standalone portable GNU libiconv installed).
 
 
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  dnl accordingly.
  dnl accordingly.
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
 
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  dnl because if the user has installed libiconv and not disabled its use
  dnl because if the user has installed libiconv and not disabled its use
  dnl via --without-libiconv-prefix, he wants to use it. The first
  dnl via --without-libiconv-prefix, he wants to use it. The first
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
  am_save_CPPFLAGS="$CPPFLAGS"
  am_save_CPPFLAGS="$CPPFLAGS"
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
 
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
    am_cv_func_iconv="no, consider installing GNU libiconv"
    am_cv_func_iconv="no, consider installing GNU libiconv"
    am_cv_lib_iconv=no
    am_cv_lib_iconv=no
    AC_TRY_LINK([#include <stdlib.h>
    AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
#include <iconv.h>],
      [iconv_t cd = iconv_open("","");
      [iconv_t cd = iconv_open("","");
       iconv(cd,NULL,NULL,NULL,NULL);
       iconv(cd,NULL,NULL,NULL,NULL);
       iconv_close(cd);],
       iconv_close(cd);],
      am_cv_func_iconv=yes)
      am_cv_func_iconv=yes)
    if test "$am_cv_func_iconv" != yes; then
    if test "$am_cv_func_iconv" != yes; then
      am_save_LIBS="$LIBS"
      am_save_LIBS="$LIBS"
      LIBS="$LIBS $LIBICONV"
      LIBS="$LIBS $LIBICONV"
      AC_TRY_LINK([#include <stdlib.h>
      AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
#include <iconv.h>],
        [iconv_t cd = iconv_open("","");
        [iconv_t cd = iconv_open("","");
         iconv(cd,NULL,NULL,NULL,NULL);
         iconv(cd,NULL,NULL,NULL,NULL);
         iconv_close(cd);],
         iconv_close(cd);],
        am_cv_lib_iconv=yes
        am_cv_lib_iconv=yes
        am_cv_func_iconv=yes)
        am_cv_func_iconv=yes)
      LIBS="$am_save_LIBS"
      LIBS="$am_save_LIBS"
    fi
    fi
  ])
  ])
  if test "$am_cv_func_iconv" = yes; then
  if test "$am_cv_func_iconv" = yes; then
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
  fi
  fi
  if test "$am_cv_lib_iconv" = yes; then
  if test "$am_cv_lib_iconv" = yes; then
    AC_MSG_CHECKING([how to link with libiconv])
    AC_MSG_CHECKING([how to link with libiconv])
    AC_MSG_RESULT([$LIBICONV])
    AC_MSG_RESULT([$LIBICONV])
  else
  else
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
    dnl either.
    dnl either.
    CPPFLAGS="$am_save_CPPFLAGS"
    CPPFLAGS="$am_save_CPPFLAGS"
    LIBICONV=
    LIBICONV=
    LTLIBICONV=
    LTLIBICONV=
  fi
  fi
  AC_SUBST(LIBICONV)
  AC_SUBST(LIBICONV)
  AC_SUBST(LTLIBICONV)
  AC_SUBST(LTLIBICONV)
])
])
 
 
AC_DEFUN([AM_ICONV],
AC_DEFUN([AM_ICONV],
[
[
  AM_ICONV_LINK
  AM_ICONV_LINK
  if test "$am_cv_func_iconv" = yes; then
  if test "$am_cv_func_iconv" = yes; then
    AC_MSG_CHECKING([for iconv declaration])
    AC_MSG_CHECKING([for iconv declaration])
    AC_CACHE_VAL(am_cv_proto_iconv, [
    AC_CACHE_VAL(am_cv_proto_iconv, [
      AC_TRY_COMPILE([
      AC_TRY_COMPILE([
#include <stdlib.h>
#include <stdlib.h>
#include <iconv.h>
#include <iconv.h>
extern
extern
#ifdef __cplusplus
#ifdef __cplusplus
"C"
"C"
#endif
#endif
#if defined(__STDC__) || defined(__cplusplus)
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
#else
size_t iconv();
size_t iconv();
#endif
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
    AC_MSG_RESULT([$]{ac_t:-
    AC_MSG_RESULT([$]{ac_t:-
         }[$]am_cv_proto_iconv)
         }[$]am_cv_proto_iconv)
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
      [Define as const if the declaration of iconv() needs const.])
      [Define as const if the declaration of iconv() needs const.])
  fi
  fi
])
])
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.