dnl CF_FUNC_ICONV version: 5 updated: 2007/12/17 19:44:10
dnl -------------
dnl Check for iconv() and related functions/headers.  On a few systems it is
dnl part of the default runtime library, but on others it may be within the
dnl iconv library.  Set the cache variable to tell where we found it:
dnl
dnl	no - did not find
dnl	yes - in the default library
dnl	-liconv - the external library
AC_DEFUN([CF_FUNC_ICONV],
[
CF_FIND_LIBRARY(iconv,iconv,
	[#include <iconv.h>],
	[iconv_t c = iconv_open(0,0); iconv(c, 0,0,0,0); iconv_close(c)],
	iconv,
	noexit)
AC_CACHE_CHECK(for iconv function library,cf_cv_func_iconv,
	cf_cv_func_iconv="$ac_cv_func_iconv"; test "$cf_cv_func_iconv" = no && cf_cv_func_iconv=$cf_cv_have_lib_iconv
	if test "$cf_cv_func_iconv" = yes ; then
		if test -n "$cf_libdir" ; then
			cf_cv_func_iconv="-L$cf_libdir -liconv"
		fi
	fi
)
])dnl
