[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: suggested patch for gettext/m4/gettext.m4
From: |
Bruno Haible |
Subject: |
Re: suggested patch for gettext/m4/gettext.m4 |
Date: |
Wed, 17 Jan 2001 23:54:27 +0100 (CET) |
Aharon Robbins wrote on 2000-12-05:
> As part of alpha testing the next gawk release, I found that Solaris 2.3
> has gettext in its C library but not dcgettext. This confuses things
> no end, especially if you want to call dcgettext.
>
> I suggest the following diff against the CVS version of m4/gettext.m4.
Thanks for the diff, and sorry for the delay. For various other
reasons - the lack of dcgettext is not the only bad surprise -, I now
recommend to not use libc's gettext facilities on Solaris at
all. Please try the following patch.
2001-01-08 Bruno Haible <address@hidden>
* gettext.m4: Remove support code for Solaris gettext. It cannot cope
with partially untranslated PO files. Also remove catgets support.
*** gettext-0.10.35/m4/gettext.m4.bak Mon Jan 8 21:23:36 2001
--- gettext-0.10.35/m4/gettext.m4 Mon Jan 8 21:29:48 2001
***************
*** 6,12 ****
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
! # serial 5
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
--- 6,12 ----
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
! # serial 6
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
***************
*** 40,61 ****
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
! [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
! [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
! gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
!
! if test "$gt_cv_func_gettext_libc" != "yes"; then
! AC_CHECK_LIB(intl, bindtextdomain,
! [AC_CACHE_CHECK([for gettext in libintl],
! gt_cv_func_gettext_libintl,
! [AC_CHECK_LIB(intl, gettext,
! gt_cv_func_gettext_libintl=yes,
! gt_cv_func_gettext_libintl=no)],
! gt_cv_func_gettext_libintl=no)])
fi
! if test "$gt_cv_func_gettext_libc" = "yes" \
! || test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
--- 40,65 ----
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
! [AC_CACHE_CHECK([for GNU gettext in libc],
! gt_cv_func_gnugettext_libc,
! [AC_TRY_LINK([#include <libintl.h>
! extern int _nl_msg_cat_cntr;], [return (int) gettext ("") + _nl_msg_cat_cntr],
! gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)])
!
! if test "$gt_cv_func_gnugettext_libc" != "yes"; then
! AC_CACHE_CHECK([for GNU gettext in libintl],
! gt_cv_func_gnugettext_libintl,
! [gt_save_LIBS="$LIBS"
! LIBS="$LIBS -lintl"
! AC_TRY_LINK([#include <libintl.h>
! extern int _nl_msg_cat_cntr;], [return (int) gettext ("") + _nl_msg_cat_cntr],
! gt_cv_func_gnugettext_libintl=yes,
! gt_cv_func_gnugettext_libintl=no)
! LIBS="$gt_save_LIBS"])
fi
! if test "$gt_cv_func_gnugettext_libc" = "yes" \
! || test "$gt_cv_func_gnugettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
***************
*** 64,116 ****
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
! AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
! return _nl_msg_cat_cntr],
! [CATOBJEXT=.gmo
! DATADIRNAME=share],
! [CATOBJEXT=.mo
! DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
- AC_MSG_CHECKING([whether catgets can be used])
- AC_ARG_WITH(catgets,
- [ --with-catgets use catgets functions if available],
- nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
- AC_MSG_RESULT($nls_cv_use_catgets)
-
- if test "$nls_cv_use_catgets" = "yes"; then
- dnl No gettext in C library. Try catgets next.
- AC_CHECK_LIB(i, main)
- AC_CHECK_FUNC(catgets,
- [AC_DEFINE(HAVE_CATGETS)
- INTLOBJS="\$(CATOBJS)"
- AC_PATH_PROG(GENCAT, gencat, no)dnl
- if test "$GENCAT" != "no"; then
- AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
- if test "$GMSGFMT" = "no"; then
- AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
- fi
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- USE_INCLUDED_LIBINTL=yes
- CATOBJEXT=.cat
- INSTOBJEXT=.cat
- DATADIRNAME=lib
- INTLDEPS='$(top_builddir)/intl/libintl.a'
- INTLLIBS=$INTLDEPS
- LIBS=`echo $LIBS | sed -e 's/-lintl//'`
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
- fi])
- fi
- fi
-
- if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
--- 68,81 ----
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
! CATOBJEXT=.gmo
! DATADIRNAME=share
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: suggested patch for gettext/m4/gettext.m4,
Bruno Haible <=