X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ficonv.m4;h=2ff19621243f427476a70343e57fe0f441a27cd4;hb=d91eb369fbc5f860b31fb23e825aff5b50034399;hp=7320bef37338df65be3be3d2091e3b917b440eec;hpb=f74b847e710af94304d0ea21c1e8b57e866e2f1e;p=gnulib.git diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 7320bef37..2ff196212 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,13 +1,13 @@ -#serial 1 +#serial 3 dnl From Bruno Haible. AC_DEFUN(jm_ICONV, [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable libiconv installed). + dnl those with the standalone portable GNU libiconv installed). AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [ - jm_cv_func_iconv="no, consider installing libiconv" + jm_cv_func_iconv="no, consider installing GNU libiconv" jm_cv_lib_iconv=no AC_TRY_LINK([#include #include ], @@ -30,6 +30,27 @@ AC_DEFUN(jm_ICONV, ]) if test "$jm_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(jm_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft); +#else +size_t iconv(); +#endif +], [], jm_cv_proto_iconv_arg1="", jm_cv_proto_iconv_arg1="const") + jm_cv_proto_iconv="extern size_t iconv (iconv_t cd, $jm_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"]) + jm_cv_proto_iconv=`echo "[$]jm_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]jm_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $jm_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$jm_cv_lib_iconv" = yes; then