+2002-01-19 Bruno Haible <bruno@clisp.org>
+
+ * iconv.m4 (AM_ICONV_LINK): New macro, extracted from AM_ICONV.
+ (AM_ICONV): Call it.
+ * gettext.m4 (AM_GNU_GETTEXT): Call AM_ICONV_LINK instead of AM_ICONV.
+
2002-01-19 Bruno Haible <bruno@clisp.org>
* gettext.m4 (AM_GNU_GETTEXT): Don't consider that -liconv is
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
ifelse(gt_included_intl, yes, , [
- AM_ICONV
+ AM_ICONV_LINK
])
dnl Search for libintl and define LIBINTL and INCINTL accordingly.
dnl Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) because that would
dnl From Bruno Haible.
-AC_DEFUN([AM_ICONV],
+AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ fi
+ AC_SUBST(LIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+ AC_REQUIRE([AM_ICONV_LINK])
+ if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
- if test "$am_cv_lib_iconv" = yes; then
- AC_MSG_CHECKING([how to link with libiconv])
- AC_MSG_RESULT([$LIBICONV])
- else
- dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
- dnl either.
- CPPFLAGS="$am_save_CPPFLAGS"
- LIBICONV=
- fi
- AC_SUBST(LIBICONV)
])