-AC_CHECK_FUNCS(iconv_open)
-if test "$ac_cv_func_iconv_open" = "no"; then
- oldLibs=$LIBS
- LIBS="$LIBS -liconv"
- AC_CHECK_FUNCS(iconv_open)
- if test "$ac_cv_func_iconv_open" = "no"; then
- LIBS=$oldLibs
+AC_ARG_WITH(iconv, [ --with-iconv[=DIR] iconv library in DIR])
+if test "$with_iconv" != "no"; then
+ AC_MSG_CHECKING(for iconv)
+ oldLIBS="$LIBS"
+ oldCPPFLAGS="${CPPFLAGS}"
+ if test "$with_iconv" != "yes" -a "$with_iconv" != ""; then
+ LIBS="$LIBS -L${with_iconv}/lib"
+ CPPFLAGS="${CPPFLAGS} -I${with_iconv}/include"