From: Matthias Clasen Date: Fri, 6 Aug 2004 17:26:28 +0000 (+0000) Subject: Require ngettext. (#123847, Danilo Segan) X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=b324ed68043034271fa63e0270ee7c30d1ae9b08;p=dana%2Fcg-glib.git Require ngettext. (#123847, Danilo Segan) 2004-08-06 Matthias Clasen * m4macros/glib-gettext.m4: Require ngettext. (#123847, Danilo Segan) --- diff --git a/ChangeLog b/ChangeLog index ae94c8d1..0b5af3c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-08-06 Matthias Clasen + + * m4macros/glib-gettext.m4: Require ngettext. (#123847, + Danilo Segan) + Thu Aug 5 20:53:00 2004 Ray Strode * glib/gutils.h (g_get_codeset): strdup result so caller diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ae94c8d1..0b5af3c2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-08-06 Matthias Clasen + + * m4macros/glib-gettext.m4: Require ngettext. (#123847, + Danilo Segan) + Thu Aug 5 20:53:00 2004 Ray Strode * glib/gutils.h (g_get_codeset): strdup result so caller diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ae94c8d1..0b5af3c2 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2004-08-06 Matthias Clasen + + * m4macros/glib-gettext.m4: Require ngettext. (#123847, + Danilo Segan) + Thu Aug 5 20:53:00 2004 Ray Strode * glib/gutils.h (g_get_codeset): strdup result so caller diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ae94c8d1..0b5af3c2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-08-06 Matthias Clasen + + * m4macros/glib-gettext.m4: Require ngettext. (#123847, + Danilo Segan) + Thu Aug 5 20:53:00 2004 Ray Strode * glib/gutils.h (g_get_codeset): strdup result so caller diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ae94c8d1..0b5af3c2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-08-06 Matthias Clasen + + * m4macros/glib-gettext.m4: Require ngettext. (#123847, + Danilo Segan) + Thu Aug 5 20:53:00 2004 Ray Strode * glib/gutils.h (g_get_codeset): strdup result so caller diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 index 5a4ef281..6f8efd90 100644 --- a/m4macros/glib-gettext.m4 +++ b/m4macros/glib-gettext.m4 @@ -1,5 +1,5 @@ # Copyright (C) 1995-2002 Free Software Foundation, Inc. -# Copyright (C) 2001-2003 Red Hat, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General @@ -22,7 +22,9 @@ # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 - +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package @@ -115,16 +117,27 @@ glib_DEFUN([GLIB_WITH_NLS], # # First check in libc # - AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], - [return (int) dgettext ("","")], - gt_cv_func_dgettext_libc=yes, - gt_cv_func_dgettext_libc=no) + [return (int) ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) ]) - if test "$gt_cv_func_dgettext_libc" = "yes" ; then + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return (int) dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi @@ -132,25 +145,29 @@ glib_DEFUN([GLIB_WITH_NLS], # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, - [AC_CHECK_LIB(intl, dgettext, - gt_cv_func_dgettext_libintl=yes)]) + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) - AC_CHECK_LIB(intl, dcgettext, + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], - :,-liconv) + :,-liconv)], + :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), - # and both have dgettext + # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" @@ -162,7 +179,8 @@ glib_DEFUN([GLIB_WITH_NLS], if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else - if test "$gt_cv_func_dgettext_libc" = "yes"; then + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi