--- a/aclocal.m4 Sat Mar 13 00:03:32 2004 +0000 +++ b/aclocal.m4 Sun Dec 25 08:24:11 2005 +0000 @@ -1092,7 +1092,7 @@ # 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 @@ -1115,7 +1115,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 @@ -1208,16 +1210,27 @@ # # 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 !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 !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 @@ -1225,25 +1238,29 @@ # 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" @@ -1255,7 +1272,8 @@ 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 @@ -1370,7 +1388,7 @@ # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl -glib_DEFUN(GLIB_GNU_GETTEXT, +glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl @@ -1447,7 +1465,7 @@ # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. -glib_DEFUN(GLIB_DEFINE_LOCALEDIR, +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" @@ -1468,7 +1486,7 @@ dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_in,[],[ -AC_DEFUN(AM_GLIB_GNU_GETTEXT,[GLIB_GNU_GETTEXT($@)]) -AC_DEFUN(AM_GLIB_DEFINE_LOCALEDIR,[GLIB_DEFINE_LOCALEDIR($@)]) +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl