diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-08-06 17:26:28 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-08-06 17:26:28 +0000 |
commit | b324ed68043034271fa63e0270ee7c30d1ae9b08 (patch) | |
tree | 7d6bb2c7ae5bde344c5c74d98f5e8d674150c575 /m4macros | |
parent | cf12bdfcd15993fca24f9db7195ec64b87cb16eb (diff) |
Require ngettext. (#123847, Danilo Segan)
2004-08-06 Matthias Clasen <mclasen@redhat.com>
* m4macros/glib-gettext.m4: Require ngettext. (#123847,
Danilo Segan)
Diffstat (limited to 'm4macros')
-rw-r--r-- | m4macros/glib-gettext.m4 | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 index 5a4ef2814..6f8efd904 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 <otaylor.redhat.com> 5/30/3002 - +# +# Modified to require ngettext +# Matthias Clasen <mclasen@redhat.com> 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 <libintl.h> ], - [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 <libintl.h> +], + [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 |