From: Bruno Haible Date: Mon, 21 Jan 2002 13:25:44 +0000 (+0000) Subject: Don't check for ICONV_CONST if we don't need it. X-Git-Tag: v0.11~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6504af86ff4afa810c2cf96f96e801daa9861872;p=thirdparty%2Fgettext.git Don't check for ICONV_CONST if we don't need it. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index 04163cf3b..1af739055 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2002-01-19 Bruno Haible + + * 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 * gettext.m4 (AM_GNU_GETTEXT): Don't consider that -liconv is diff --git a/m4/gettext.m4 b/m4/gettext.m4 index b5f9f7456..bd83f81d5 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -124,7 +124,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", 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 diff --git a/m4/iconv.m4 b/m4/iconv.m4 index b8c733b1f..58b8a093d 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -8,7 +8,7 @@ dnl the same distribution terms as the rest of that program. 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). @@ -51,6 +51,23 @@ AC_DEFUN([AM_ICONV], ]) 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([ @@ -73,14 +90,4 @@ size_t iconv(); 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) ])