# LIBICONV_CHECK_CONFIG ([DEFAULT-ACTION])
# ----------------------------------------------------------
# Checks for iconv. DEFAULT-ACTION is the string yes or no to
# specify whether to default to --with-iconv or --without-iconv.
# If not supplied, DEFAULT-ACTION is no.
# This macro #defines HAVE_ICONV if a required header files is
# found, and sets @ICONV_LDFLAGS@ and @ICONV_CFLAGS@ to the necessary
# This macro is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_DEFUN([LIBICONV_TRY_LINK],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
iconv_t cd = iconv_open("","");
iconv(cd, NULL, NULL, NULL, NULL);
]])],[found_iconv="yes"],[])
AC_DEFUN([LIBICONV_CHECK_CONFIG],
If you want to specify iconv installation directories:
AS_HELP_STRING([--with-iconv@<:@=DIR@:>@], [use iconv from given base install directory (DIR), default is to search through a number of common places for the iconv files.])],
if test "$withval" = "yes"; then
ICONV_CFLAGS="-I/usr/include"
ICONV_LDFLAGS="-L/usr/lib"
elif test "$withval" != "no"; then
_iconv_dir_lib="$withval/lib"
ICONV_CFLAGS="-I$withval/include"
ICONV_LDFLAGS="-L$_iconv_dir_lib"
AC_ARG_WITH([iconv-include],
AS_HELP_STRING([--with-iconv-include@<:@=DIR@:>@],
[use iconv include headers from given path.]
ICONV_CFLAGS="-I$withval"
AS_HELP_STRING([--with-iconv-lib@<:@=DIR@:>@],
[use iconv libraries from given path.]
ICONV_LDFLAGS="-L$withval"