7 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
8 dnl those with the standalone portable GNU libiconv installed).
9 AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [
10 jm_cv_func_iconv="no, consider installing GNU libiconv"
12 AC_TRY_LINK([#include <stdlib.h>
14 [iconv_t cd = iconv_open("","");
15 iconv(cd,NULL,NULL,NULL,NULL);
18 if test "$jm_cv_func_iconv" != yes; then
21 AC_TRY_LINK([#include <stdlib.h>
23 [iconv_t cd = iconv_open("","");
24 iconv(cd,NULL,NULL,NULL,NULL);
31 if test "$jm_cv_func_iconv" = yes; then
32 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
33 AC_MSG_CHECKING([for iconv declaration])
34 AC_CACHE_VAL(jm_cv_proto_iconv, [
42 #if defined(__STDC__) || defined(__cplusplus)
43 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);
47 ], [], jm_cv_proto_iconv_arg1="", jm_cv_proto_iconv_arg1="const")
48 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);"])
49 jm_cv_proto_iconv=`echo "[$]jm_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
50 AC_MSG_RESULT([$]{ac_t:-
51 }[$]jm_cv_proto_iconv)
52 AC_DEFINE_UNQUOTED(ICONV_CONST, $jm_cv_proto_iconv_arg1,
53 [Define as const if the declaration of iconv() needs const.])
56 if test "$jm_cv_lib_iconv" = yes; then