summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Admin/plans15
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.am4
-rw-r--r--configure.in4
-rw-r--r--intl/ChangeLog37
-rw-r--r--intl/Makefile.in28
-rw-r--r--intl/bindtextdom.c3
-rw-r--r--intl/dcgettext.c5
-rw-r--r--intl/dcigettext.c3
-rw-r--r--intl/dcngettext.c5
-rw-r--r--intl/dgettext.c3
-rw-r--r--intl/dngettext.c3
-rw-r--r--intl/finddomain.c3
-rw-r--r--intl/gettext.c5
-rw-r--r--intl/gettext.h11
-rw-r--r--intl/gettextP.h74
-rw-r--r--intl/hash-string.h4
-rw-r--r--intl/intl-compat.c3
-rw-r--r--intl/libgettext.h152
-rw-r--r--intl/libgnuintl.h (renamed from intl/intlh.inst.in)15
-rw-r--r--intl/localealias.c1
-rw-r--r--intl/ngettext.c3
-rw-r--r--intl/plural.y1
-rw-r--r--intl/textdomain.c3
-rw-r--r--m4/ChangeLog6
-rw-r--r--m4/gettext.m429
-rw-r--r--src/ChangeLog12
-rw-r--r--src/msgcmp.c2
-rw-r--r--src/msgfmt.c2
-rw-r--r--src/msgmerge.c2
-rw-r--r--src/msgunfmt.c2
-rw-r--r--src/open-po.c2
-rw-r--r--src/po-gram-gen.y2
-rw-r--r--src/po-lex.c2
-rw-r--r--src/xgettext.c3
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/plural-1-prg.c10
37 files changed, 183 insertions, 286 deletions
diff --git a/Admin/plans b/Admin/plans
index 8e7ce05..b232aba 100644
--- a/Admin/plans
+++ b/Admin/plans
@@ -19,21 +19,6 @@ Things we plan to do. Comments welcome.
- Stop documenting AM_WITH_NLS. AM_GNU_GETTEXT is the right macro to use.
-- Unify intlh.inst.in and libgettext.h. libgettext.h depends on
- HAVE_LC_MESSAGES and on <locale.h> being already included.
-
-- What about gettext_noop? Kill it or maybe apply this:
-
- 2000-03-06 Paul Eggert <eggert@twinsun.com>
- * libgettext.h (gettext_noop): Do not parenthesize Str in the
- definiens, as that breaks string literal concatenation.
-
- /* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result.
- Do not parenthesize Str in the definiens,
- as that breaks string literal concatenation. */
- #define gettext_noop(Str) Str
-
- Build also libintl.so, using libtool.
- Check the *.m4 macros with bleeding-edge autoconf & automake.
diff --git a/ChangeLog b/ChangeLog
index 025aacf..c682cc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-01-07 Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.am (DISTCLEANFILES): Remove. Now done in intl/Makefile.in.
+ * configure.in: Stop creating intl/intlh.inst from intl/intlh.inst.in.
+ Now done through a simple file copy.
+
2001-01-06 Bruno Haible <haible@clisp.cons.org>
* configure.in: Use AC_CHECK_HEADERS instead of AC_HAVE_HEADERS.
diff --git a/Makefile.am b/Makefile.am
index 87d213a..51c8ee5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
## Makefile for the toplevel directory of the GNU NLS Utilities
-## Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+## Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@ gettextsrc_DATA = ABOUT-NLS
EXTRA_DIST = BUGS DISCLAIM README.gemtext aclocal.sh
SUBDIRS = doc lib intl src po m4 misc tests
-DISTCLEANFILES = intl/libintl.h
-
ABOUT-NLS: $(srcdir)/doc/nls.texi $(srcdir)/doc/matrix.texi
rm -f $(srcdir)/ABOUT-NLS \
&& $(MAKEINFO) --output=$(srcdir)/ABOUT-NLS --no-header \
diff --git a/configure.in b/configure.in
index 1d46931..9f72dd3 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.12)
-AC_REVISION($Revision: 1.6 $)
+AC_REVISION($Revision: 1.7 $)
AC_INIT(src/msgfmt.c)
AM_INIT_AUTOMAKE(gettext, 0.10.36)
AM_CONFIG_HEADER(config.h)
@@ -81,7 +81,7 @@ echo "GNU gettext library from $PACKAGE-$VERSION" > intl/VERSION
AC_OUTPUT([Makefile lib/Makefile intl/Makefile src/Makefile \
po/Makefile.in doc/Makefile tests/Makefile m4/Makefile \
- misc/Makefile misc/gettextize intl/intlh.inst], [
+ misc/Makefile misc/gettextize], [
dnl Workaround an automake-1.4 bug which generates an incorrect uninstall
dnl target in misc/Makefile.in.
sed -e 's/rm -f \$(lispdir)/rm -f \$(DESTDIR)\$(lispdir)/' < misc/Makefile \
diff --git a/intl/ChangeLog b/intl/ChangeLog
index dad9a5b..a34a2a4 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,5 +1,42 @@
2001-01-07 Bruno Haible <haible@clisp.cons.org>
+ * libgnuintl.h: Renamed from intlh.inst.in.
+ Remove comment about __builtin_constant_p.
+ (gettext): Use NULL.
+ * libgettext.h: Completely rewritten. Now a conditional wrapper around
+ <libintl.h>. Keep the handling of ENABLE_NLS and gettext_noop, remove
+ everything else.
+ * gettextP.h: Include gettext.h, for nls_uint32.
+ (gettext__, dgettext__, dcgettext__, textdomain__, bindtextdomain__,
+ bind_textdomain_codeset__): New declarations, from old libgettext.h.
+ * gettext.h: Don't include <stdio.h>.
+ * Makefile.in (HEADERS): Add libgnuintl.h.
+ (DISTFILES.gettext): Remove intlh.inst.in.
+ (all-yes): Depend on libintl.h instead of intlh.inst.
+ (libintl.h): New target. Create as a copy of libgnuintl.h.
+ (intlh.inst): Remove target.
+ (install-exec): Update.
+ ($(OBJECTS): Depend on libgnuintl.h, not libgettext.h.
+ (mostlyclean): Remove libintl.h instead of intlh.inst.
+ (dist-libc): Remove target.
+ * bindtextdom.c: Include libgnuintl.h instead of libgettext.h. Don't
+ include gettext.h.
+ * dcgettext.c: Likewise.
+ * dcigettext.c: Likewise.
+ * dcngettext.c: Likewise.
+ * dngettext.c: Likewise.
+ * finddomain.c: Likewise.
+ * ngettext.c: Likewise.
+ * textdomain.c: Likewise.
+ * dgettext.c: Include libgnuintl.h instead of libgettext.h. Include
+ gettextP.h.
+ * gettext.c: Likewise.
+ * intl-compat.c: Likewise.
+ * localealias.c: Don't include gettext.h.
+ * plural.y: Likewise.
+
+2001-01-07 Bruno Haible <haible@clisp.cons.org>
+
Assume <stddef.h>, <stdlib.h>, <string.h>, <locale.h> exist.
* intlh.inst.in: Likewise.
* libgettext.h: Likewise.
diff --git a/intl/Makefile.in b/intl/Makefile.in
index 63d1367..04e178a 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -58,7 +58,7 @@ LDFLAGS = @LDFLAGS@
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
COMHDRS = gettext.h gettextP.h hash-string.h
SOURCES = $(COMSRCS) intl-compat.c
COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
@@ -73,7 +73,7 @@ GETTOBJS = intl-compat.$lo
DISTFILES.common = ChangeLog Makefile.in \
config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
DISTFILES.normal = VERSION
-DISTFILES.gettext = libintl.glibc intlh.inst.in plural.c
+DISTFILES.gettext = libintl.glibc plural.c
# Libtool's library version information for libintl.
LTV_CURRENT=1
@@ -99,7 +99,7 @@ INCLUDES = -I.. -I. -I$(top_srcdir)/intl
all: all-@USE_INCLUDED_LIBINTL@
-all-yes: libintl.$la intlh.inst charset.alias ref-add.sed ref-del.sed
+all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
all-no:
libintl.a: $(OBJECTS)
@@ -112,6 +112,9 @@ libintl.la: $(OBJECTS)
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir)
+libintl.h: libgnuintl.h
+ cp $(srcdir)/libgnuintl.h libintl.h
+
charset.alias: config.charset
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
mv t-$@ $@
@@ -131,7 +134,7 @@ install-exec: all
if test "$(PACKAGE)" = "gettext" \
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
- $(INSTALL_DATA) intlh.inst $(DESTDIR)$(includedir)/libintl.h; \
+ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
$(INSTALL_DATA) libintl.a $(DESTDIR)$(libdir)/libintl.a; \
else \
: ; \
@@ -219,7 +222,7 @@ uninstall:
info dvi:
-$(OBJECTS): ../config.h libgettext.h
+$(OBJECTS): ../config.h libgnuintl.h
bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
@@ -236,7 +239,7 @@ ID: $(HEADERS) $(SOURCES)
mostlyclean:
rm -f *.a *.o *.lo core core.*
- rm -f intlh.inst charset.alias ref-add.sed ref-del.sed
+ rm -f libintl.h charset.alias ref-add.sed ref-del.sed
clean: mostlyclean
@@ -267,23 +270,10 @@ dist distdir: Makefile $(DISTFILES)
|| cp -p $(srcdir)/$$file $(distdir); \
done
-dist-libc:
- tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
-
Makefile: Makefile.in ../config.status
cd .. \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-# The dependency for intlh.inst is different in gettext and all other
-# packages. Because we cannot you GNU make features we have to solve
-# the problem while rewriting Makefile.in.
-@GT_YES@intlh.inst: intlh.inst.in ../config.status
-@GT_YES@ cd .. \
-@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
-@GT_YES@ $(SHELL) ./config.status
-@GT_NO@.PHONY: intlh.inst
-@GT_NO@intlh.inst:
-
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index 795ab48..602a651 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -26,9 +26,8 @@
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
index 0d9a8fc..469e78d 100644
--- a/intl/dcgettext.c
+++ b/intl/dcgettext.c
@@ -1,5 +1,5 @@
/* Implementation of the dcgettext(3) function.
- Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,12 +19,11 @@
# include <config.h>
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 71ebc35..c9e52a7 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -73,12 +73,11 @@ extern int errno;
# include <sys/param.h>
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
#include "hash-string.h"
diff --git a/intl/dcngettext.c b/intl/dcngettext.c
index af0c27d..e5da257 100644
--- a/intl/dcngettext.c
+++ b/intl/dcngettext.c
@@ -1,5 +1,5 @@
/* Implementation of the dcngettext(3) function.
- Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,12 +19,11 @@
# include <config.h>
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
diff --git a/intl/dgettext.c b/intl/dgettext.c
index 11ed70a..c513041 100644
--- a/intl/dgettext.c
+++ b/intl/dgettext.c
@@ -21,10 +21,11 @@
#include <locale.h>
+#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
diff --git a/intl/dngettext.c b/intl/dngettext.c
index c9623a4..79aaa9a 100644
--- a/intl/dngettext.c
+++ b/intl/dngettext.c
@@ -21,12 +21,11 @@
#include <locale.h>
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
diff --git a/intl/finddomain.c b/intl/finddomain.c
index a1fdf94..fdcae62 100644
--- a/intl/finddomain.c
+++ b/intl/finddomain.c
@@ -29,12 +29,11 @@
# include <unistd.h>
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
diff --git a/intl/gettext.c b/intl/gettext.c
index 50d594c..a640205 100644
--- a/intl/gettext.c
+++ b/intl/gettext.c
@@ -26,14 +26,13 @@
# include <stdlib.h> /* Just for NULL. */
#endif
+#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
-#include <locale.h>
-
/* @@ end of prolog @@ */
/* Names for the libintl functions are a problem. They must not clash
diff --git a/intl/gettext.h b/intl/gettext.h
index 2af4532..eb58890 100644
--- a/intl/gettext.h
+++ b/intl/gettext.h
@@ -1,5 +1,5 @@
-/* Internal header for GNU gettext internationalization functions.
- Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
+/* Description of GNU message catalog format: general file layout.
+ Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,8 +18,6 @@
#ifndef _GETTEXT_H
#define _GETTEXT_H 1
-#include <stdio.h>
-
#if HAVE_LIMITS_H || _LIBC
# include <limits.h>
#endif
@@ -36,9 +34,8 @@
/* The following contortions are an attempt to use the C preprocessor
to determine an unsigned integral type that is 32 bits wide. An
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
- doing that would require that the configure script compile and *run*
- the resulting executable. Locally running cross-compiled executables
- is usually not possible. */
+ as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
+ when cross-compiling. */
#if __STDC__
# define UINT_MAX_32_BITS 4294967295U
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 27c04e4..b100e1f 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -1,4 +1,4 @@
-/* Header describing internals of gettext library
+/* Header describing internals of libintl library.
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -31,6 +31,8 @@
#include "loadinfo.h"
+#include "gettext.h" /* Get nls_uint32. */
+
/* @@ end of prolog @@ */
#ifndef PARAMS
@@ -116,6 +118,7 @@ struct parse_args
};
+/* The representation of an opened message catalog. */
struct loaded_domain
{
const char *data;
@@ -148,6 +151,8 @@ struct loaded_domain
# define ZERO 1
#endif
+/* A set of settings bound to a message domain. Used to store settings
+ from bindtextdomain() and bind_textdomain_codeset(). */
struct binding
{
struct binding *next;
@@ -156,6 +161,9 @@ struct binding
char domainname[ZERO];
};
+/* A counter which is incremented each time some previous translations
+ become invalid.
+ This variable is part of the external ABI of the GNU libintl. */
extern int _nl_msg_cat_cntr;
struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
@@ -169,27 +177,51 @@ void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
internal_function;
#ifdef _LIBC
-extern char *__ngettext PARAMS ((const char *msgid1, const char *msgid2,
- unsigned long int n));
-extern char *__dngettext PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, unsigned long int n));
-extern char *__dcngettext PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, unsigned long int n,
- int category));
-extern char *__dcigettext PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, int plural,
- unsigned long int n, int category));
+extern char *__gettext PARAMS ((const char *__msgid));
+extern char *__dgettext PARAMS ((const char *__domainname,
+ const char *__msgid));
+extern char *__dcgettext PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *__dngettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int n));
+extern char *__dcngettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category));
+extern char *__dcigettext PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category));
+extern char *__textdomain PARAMS ((const char *__domainname));
+extern char *__bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
+ const char *__codeset));
#else
-extern char *ngettext__ PARAMS ((const char *msgid1, const char *msgid2,
- unsigned long int n));
-extern char *dngettext__ PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, unsigned long int n));
-extern char *dcngettext__ PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, unsigned long int n,
- int category));
-extern char *dcigettext__ PARAMS ((const char *domainname, const char *msgid1,
- const char *msgid2, int plural,
- unsigned long int n, int category));
+extern char *gettext__ PARAMS ((const char *__msgid));
+extern char *dgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid));
+extern char *dcgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *dngettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n));
+extern char *dcngettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category));
+extern char *dcigettext__ PARAMS ((const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category));
+extern char *textdomain__ PARAMS ((const char *__domainname));
+extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
+ const char *__codeset));
#endif
extern int __gettextdebug;
diff --git a/intl/hash-string.h b/intl/hash-string.h
index 25e0b93..37d4ce1 100644
--- a/intl/hash-string.h
+++ b/intl/hash-string.h
@@ -1,5 +1,5 @@
-/* Implements a string hashing function.
- Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Description of GNU message catalog format: string hashing function.
+ Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
index 299773b..3550c78 100644
--- a/intl/intl-compat.c
+++ b/intl/intl-compat.c
@@ -20,7 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <config.h>
#endif
-#include "libgettext.h"
+#include "libgnuintl.h"
+#include "gettextP.h"
/* @@ end of prolog @@ */
diff --git a/intl/libgettext.h b/intl/libgettext.h
index 3834a08..553382c 100644
--- a/intl/libgettext.h
+++ b/intl/libgettext.h
@@ -1,4 +1,4 @@
-/* Message catalogs for internationalization.
+/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -15,144 +15,14 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-/* Because on some systems (e.g. Solaris) we sometimes have to include
- the systems libintl.h as well as this file we have more complex
- include protection above. But the systems header might perhaps also
- define _LIBINTL_H and therefore we have to protect the definition here. */
-
-#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
-#ifndef _LIBINTL_H
-# define _LIBINTL_H 1
-#endif
-#define _LIBGETTEXT_H 1
-
-/* We define an additional symbol to signal that we use the GNU
- implementation of gettext. */
-#define __USE_GNU_GETTEXT 1
-
-#include <sys/types.h>
-#include <locale.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* @@ end of prolog @@ */
-
-#ifndef PARAMS
-# if __STDC__ || defined __cplusplus
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-#ifndef NULL
-# if !defined __cplusplus || defined __GNUC__
-# define NULL ((void *) 0)
-# else
-# define NULL (0)
-# endif
-#endif
-
-#if !HAVE_LC_MESSAGES
-/* This value determines the behaviour of the gettext() and dgettext()
- function. But some system does not have this defined. Define it
- to a default value. */
-# define LC_MESSAGES (-1)
-#endif
-
-
-/* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result. */
-#define gettext_noop(Str) (Str)
-
-/* Look up MSGID in the current default message catalog for the current
- LC_MESSAGES locale. If not found, returns MSGID itself (the default
- text). */
-extern char *gettext PARAMS ((const char *__msgid));
-extern char *gettext__ PARAMS ((const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current
- LC_MESSAGES locale. */
-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
-extern char *dgettext__ PARAMS ((const char *__domainname,
- const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
- locale. */
-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
- int __category));
-extern char *dcgettext__ PARAMS ((const char *__domainname,
- const char *__msgid, int __category));
-
-
-/* Similar to `gettext' but select the plural form corresponding to the
- number N. */
-extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
- unsigned long int __n));
-extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
- unsigned long int __n));
-
-/* Similar to `dgettext' but select the plural form corresponding to the
- number N. */
-extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
- const char *__msgid2, unsigned long int __n));
-extern char *dngettext__ PARAMS ((const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n));
-
-/* Similar to `dcgettext' but select the plural form corresponding to the
- number N. */
-extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
- const char *__msgid2, unsigned long int __n,
- int __category));
-extern char *dcngettext__ PARAMS ((const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category));
-
-
-/* Set the current default message catalog to DOMAINNAME.
- If DOMAINNAME is null, return the current default.
- If DOMAINNAME is "", reset to the default of "messages". */
-extern char *textdomain PARAMS ((const char *__domainname));
-extern char *textdomain__ PARAMS ((const char *__domainname));
-
-/* Specify that the DOMAINNAME message catalog will be found
- in DIRNAME rather than in the system locale data base. */
-extern char *bindtextdomain PARAMS ((const char *__domainname,
- const char *__dirname));
-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
- const char *__dirname));
-
-/* Specify the character encoding in which the messages from the
- DOMAINNAME message catalog will be returned. */
-extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
- const char *__codeset));
-extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
- const char *__codeset));
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
-/* Solaris 2.3 has the gettext function but dcgettext is missing.
- So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
- has dcgettext. */
-# if !HAVE_GETTEXT || HAVE_DCGETTEXT
-
-# define gettext(Msgid) \
- dgettext (NULL, Msgid)
-
-# define dgettext(Domainname, Msgid) \
- dcgettext (Domainname, Msgid, LC_MESSAGES)
-
-# define ngettext(Msgid1, Msgid2, N) \
- dngettext (NULL, Msgid1, Msgid2, N)
-
-# define dngettext(Domainname, Msgid1, Msgid2, N) \
- dcngettext (Domainname, Msgid1, Msgid2, N, LC_MESSAGES)
-
-# endif
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
#else
@@ -171,10 +41,8 @@ extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
#endif
-/* @@ begin of epilog @@ */
-
-#ifdef __cplusplus
-}
-#endif
+/* For automatical extraction of messages sometimes no real
+ translation is needed. Instead the string itself is the result. */
+#define gettext_noop(Str) (Str)
-#endif
+#endif /* _LIBGETTEXT_H */
diff --git a/intl/intlh.inst.in b/intl/libgnuintl.h
index dee4906..e345828 100644
--- a/intl/intlh.inst.in
+++ b/intl/libgnuintl.h
@@ -86,20 +86,19 @@ extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
/* Optimized version of the functions above. */
#if defined __OPTIMIZED
-/* These must be a macro. Inlined functions are useless because the
- `__builtin_constant_p' predicate in dcgettext would always return
- false. */
+/* These are macros, but could also be inline functions. */
-# define gettext(msgid) dgettext ((char *) 0, msgid)
+# define gettext(msgid) \
+ dgettext (NULL, msgid)
# define dgettext(domainname, msgid) \
dcgettext (domainname, msgid, LC_MESSAGES)
-# define ngettext(msgid1, Msgid2, N) \
- dngettext (NULL, msgid1, Msgid2, N)
+# define ngettext(msgid1, msgid2, n) \
+ dngettext (NULL, msgid1, msgid2, n)
-# define dngettext(domainname, msgid1, Msgid2, n) \
- dcngettext (domainname, msgid1, Msgid2, n, LC_MESSAGES)
+# define dngettext(domainname, msgid1, msgid2, n) \
+ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
#endif /* Optimizing. */
diff --git a/intl/localealias.c b/intl/localealias.c
index e55d0c0..6c49564 100644
--- a/intl/localealias.c
+++ b/intl/localealias.c
@@ -56,7 +56,6 @@ char *alloca ();
# endif
#endif
-#include "gettext.h"
#include "gettextP.h"
/* @@ end of prolog @@ */
diff --git a/intl/ngettext.c b/intl/ngettext.c
index 5710007..8b1fa02 100644
--- a/intl/ngettext.c
+++ b/intl/ngettext.c
@@ -26,12 +26,11 @@
# include <stdlib.h> /* Just for NULL. */
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
#include <locale.h>
diff --git a/intl/plural.y b/intl/plural.y
index 1f7fb6c..1407afe 100644
--- a/intl/plural.y
+++ b/intl/plural.y
@@ -22,7 +22,6 @@
#endif
#include <stdlib.h>
-#include "gettext.h"
#include "gettextP.h"
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
diff --git a/intl/textdomain.c b/intl/textdomain.c
index 99650d6..05c2fd7 100644
--- a/intl/textdomain.c
+++ b/intl/textdomain.c
@@ -25,9 +25,8 @@
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 12a0b88..4af3df5 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,5 +1,11 @@
2001-01-07 Bruno Haible <haible@clisp.cons.org>
+ * gettext.m4 (AM_WITH_NLS): Remove third argument. Don't call
+ AC_LINK_FILES. Now done through simple file copy in intl/Makefile.in.
+ (AM_GNU_GETTEXT): Remove GT_NO and GT_YES macros.
+
+2001-01-07 Bruno Haible <haible@clisp.cons.org>
+
* gettext.m4 (AM_GNU_GETTEXT): Assume <locale.h> exists.
* setlocale.m4 (gt_SETLOCALE): Likewise.
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index bc7b944..64759be 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -8,11 +8,9 @@
# serial 8
-dnl Usage: AM_WITH_NLS([SYMBOL], [LIBDIR], [INCDIR]).
+dnl Usage: AM_WITH_NLS([SYMBOL], [LIBDIR]).
dnl LIBDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
-dnl INCDIR is used to find the include files. If empty,
-dnl the value `intl' is used.
dnl
dnl The result of the configuration is one of three cases:
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
@@ -56,8 +54,6 @@ AC_DEFUN(AM_WITH_NLS,
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
- nls_cv_header_intl=
- nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
@@ -122,8 +118,6 @@ return (int) gettext ("") + _nl_msg_cat_cntr],
INTLDEPS='ifelse([$2],[],$(top_builddir)/intl/libintl.a,[$2])'
INTLLIBS=$INTLDEPS
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
- nls_cv_header_intl=ifelse([$3],[],intl,[$3])/libintl.h
- nls_cv_header_libgt=ifelse([$3],[],intl,[$3])/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
@@ -141,11 +135,7 @@ return (int) gettext ("") + _nl_msg_cat_cntr],
# We need to process the po/ directory.
POSUB=po
- else
- nls_cv_header_intl=ifelse([$3],[],intl,[$3])/libintl.h
- nls_cv_header_libgt=ifelse([$3],[],intl,[$3])/libgettext.h
fi
- AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
@@ -178,6 +168,10 @@ return (int) gettext ("") + _nl_msg_cat_cntr],
AC_SUBST(POFILES)
AC_SUBST(POSUB)
+ dnl For backward compatibility. Some configure.ins may be using this.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
AC_SUBST(DATADIRNAME)
@@ -230,19 +224,6 @@ __argz_count __argz_stringify __argz_next])
fi
fi
- dnl In the intl/Makefile.in we have a special dependency which makes
- dnl only sense for gettext. We comment this out for non-gettext
- dnl packages.
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- fi
- AC_SUBST(GT_NO)
- AC_SUBST(GT_YES)
-
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
dnl Try to locate is.
diff --git a/src/ChangeLog b/src/ChangeLog
index e761eca..1562734 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,17 @@
2001-01-07 Bruno Haible <haible@clisp.cons.org>
+ * msgcmp.c: Include libgettext.h instead of libintl.h, so that the
+ configure argument --disable-nls gets respected.
+ * msgfmt.c: Likewise.
+ * msgmerge.c: Likewise.
+ * msgunfmt.c: Likewise.
+ * open-po.c: Likewise.
+ * po-gram-gen.y: Likewise.
+ * po-lex.c: Likewise.
+ * xgettext.c: Likewise. Don't include gettext.h.
+
+2001-01-07 Bruno Haible <haible@clisp.cons.org>
+
Assume <stddef.h>, <stdlib.h>, <string.h>, <locale.h> exist.
* dir-list.c: Likewise.
* gettextp.c: Likewise.
diff --git a/src/msgcmp.c b/src/msgcmp.c
index 9be13bb..8dcbb44 100644
--- a/src/msgcmp.c
+++ b/src/msgcmp.c
@@ -29,7 +29,7 @@
#include "error.h"
#include "message.h"
#include <system.h>
-#include <libintl.h>
+#include "libgettext.h"
#include "po.h"
#include "str-list.h"
diff --git a/src/msgfmt.c b/src/msgfmt.c
index 46ace8e..0f653ab 100644
--- a/src/msgfmt.c
+++ b/src/msgfmt.c
@@ -39,7 +39,7 @@
#include "gettext.h"
#include "hash-string.h"
-#include <libintl.h>
+#include "libgettext.h"
#include "message.h"
#include "po.h"
diff --git a/src/msgmerge.c b/src/msgmerge.c
index 1732c18..c70e6b4 100644
--- a/src/msgmerge.c
+++ b/src/msgmerge.c
@@ -31,7 +31,7 @@
#include "error.h"
#include "message.h"
#include <system.h>
-#include <libintl.h>
+#include "libgettext.h"
#include "po.h"
#define _(str) gettext (str)
diff --git a/src/msgunfmt.c b/src/msgunfmt.c
index 6842a08..3dd2cec 100644
--- a/src/msgunfmt.c
+++ b/src/msgunfmt.c
@@ -38,7 +38,7 @@
#include "gettext.h"
#include "hash-string.h"
-#include <libintl.h>
+#include "libgettext.h"
#include "message.h"
#define _(str) gettext (str)
diff --git a/src/open-po.c b/src/open-po.c
index 0bf4379..7ae3606 100644
--- a/src/open-po.c
+++ b/src/open-po.c
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "error.h"
#include "system.h"
-#include <libintl.h>
+#include "libgettext.h"
#define _(str) gettext (str)
diff --git a/src/po-gram-gen.y b/src/po-gram-gen.y
index edbfb5a..ddd776d 100644
--- a/src/po-gram-gen.y
+++ b/src/po-gram-gen.y
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "po-gram.h"
#include "error.h"
#include "system.h"
-#include <libintl.h>
+#include "libgettext.h"
#include "po.h"
#define _(str) gettext (str)
diff --git a/src/po-lex.c b/src/po-lex.c
index 83f0cdd..1ba8264 100644
--- a/src/po-lex.c
+++ b/src/po-lex.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <sys/types.h>
-#include <libintl.h>
+#include "libgettext.h"
#define _(str) gettext(str)
#if HAVE_VPRINTF || HAVE_DOPRNT
diff --git a/src/xgettext.c b/src/xgettext.c
index e4da03f..611100d 100644
--- a/src/xgettext.c
+++ b/src/xgettext.c
@@ -49,8 +49,7 @@ extern int errno;
#include "xget-lex.h"
#include "printf-parse.h"
-#include "gettext.h"
-#include <libintl.h>
+#include "libgettext.h"
#ifndef _POSIX_VERSION
struct passwd *getpwuid ();
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9740a3a..4f24852 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,9 @@
2001-01-07 Bruno Haible <haible@clisp.cons.org>
+ * plural-1-prg.c: Include libgnuintl.h instead of libgettext.h.
+
+2001-01-07 Bruno Haible <haible@clisp.cons.org>
+
* plural-1-prg.c: Assume <locale.h> exists.
2001-01-06 Bruno Haible <haible@clisp.cons.org>
diff --git a/tests/plural-1-prg.c b/tests/plural-1-prg.c
index 033eaa9..37beec6 100644
--- a/tests/plural-1-prg.c
+++ b/tests/plural-1-prg.c
@@ -9,18 +9,10 @@
#include <locale.h>
/* Make sure we use the included libintl, not the system's one. */
-#if 0
-#include <libintl.h>
-#else
-#define ENABLE_NLS 1
-#include "libgettext.h"
-#undef textdomain
#define textdomain textdomain__
-#undef bindtextdomain
#define bindtextdomain bindtextdomain__
-#undef ngettext
#define ngettext ngettext__
-#endif
+#include <libgnuintl.h>
int main (argc, argv)
int argc;