]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Rename intlh.inst.in to libgnuintl.h.
authorBruno Haible <bruno@clisp.org>
Mon, 22 Jan 2001 12:53:10 +0000 (12:53 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 22 Jan 2001 12:53:10 +0000 (12:53 +0000)
libgettext.h is now merely a convenience header, not used inside libintl.

37 files changed:
Admin/plans
ChangeLog
Makefile.am
configure.in
intl/ChangeLog
intl/Makefile.in
intl/bindtextdom.c
intl/dcgettext.c
intl/dcigettext.c
intl/dcngettext.c
intl/dgettext.c
intl/dngettext.c
intl/finddomain.c
intl/gettext.c
intl/gettext.h
intl/gettextP.h
intl/hash-string.h
intl/intl-compat.c
intl/libgettext.h
intl/libgnuintl.h [moved from intl/intlh.inst.in with 89% similarity]
intl/localealias.c
intl/ngettext.c
intl/plural.y
intl/textdomain.c
m4/ChangeLog
m4/gettext.m4
src/ChangeLog
src/msgcmp.c
src/msgfmt.c
src/msgmerge.c
src/msgunfmt.c
src/open-po.c
src/po-gram-gen.y
src/po-lex.c
src/xgettext.c
tests/ChangeLog
tests/plural-1-prg.c

index 8e7ce0528b87d5789d0345ef875e707f11df3fb8..b232abab61206222f6f773ab03028ea3c2d8395b 100644 (file)
@@ -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.
index 025aacfecd59b6fbcc0e826aed423937c429d6fa..c682cc00f4bf66398c75e4518d697d4a18229053 100644 (file)
--- 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.
index 87d213a884c4035117184ecd4125506006a42c93..51c8ee5b5553834af0b6cec5df7db8f8d9292276 100644 (file)
@@ -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 \
index 1d46931e3874ab54ddda8b2e3bf6ce5f15333616..9f72dd3d63e3822029eb02a1e3baa6c1b4baad59 100644 (file)
@@ -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 \
index dad9a5b0dfdb02f3cd5be6785e0f8e58a5106f79..a34a2a44a84d067e4c2563ef51374654e7f06c93 100644 (file)
@@ -1,3 +1,40 @@
+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.
index 63d1367a1393522ea88daeea719630aafd4c8bbb..04e178ada1803453be3cbd9a25611066cfe6a9d0 100644 (file)
@@ -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:
index 795ab485f141fbff1b82d25d7b96df8932ad25cb..602a6513f5815fa747c8d515a63dcec799f779bf 100644 (file)
@@ -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
index 0d9a8fce436efbd21dd311ecc3ab51b0b5579bf5..469e78de7ad1d3aec5e25e991358f25226658b19 100644 (file)
@@ -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
 # 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 @@ */
index 71ebc35c5e04b10563a0c528ba9d1b5e2ee0ab3f..c9e52a7e83fc38ea1818511614b0e2b64e4e65f6 100644 (file)
@@ -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"
 
index af0c27d1423da07b6d10453f4b92274122a196a5..e5da257754e71825817c0267e725bea1728733de 100644 (file)
@@ -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
 # 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 @@ */
index 11ed70aa3aff72dc0e26eb4e4ccfea1cd5432f6e..c5130411dca4f01d6010925a5cde6678f6e95257 100644 (file)
 
 #include <locale.h>
 
+#include "gettextP.h"
 #ifdef _LIBC
 # include <libintl.h>
 #else
-# include "libgettext.h"
+# include "libgnuintl.h"
 #endif
 
 /* @@ end of prolog @@ */
index c9623a4d1b2c2547bd3e14e0cad3200851d438ee..79aaa9ae6387392b33b76b64d88243a84f0c297b 100644 (file)
 
 #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 @@ */
index a1fdf94213831c1c7196c3bc6e24fb3ddcd28724..fdcae6230ac81bbb09779b94ccbde9415afdc738 100644 (file)
 # 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 @@ */
index 50d594c84b3c2c62935acd0c484a50e764799c3f..a64020553ad8fd0e7578c623ac7ff4b41c450bbd 100644 (file)
 # 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
index 2af45328bae0fe50c666a8295bdf4d4e6b935032..eb5889074a460c9a6b7724136b9e7d6208830729 100644 (file)
@@ -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
index 27c04e4ca506aa7f7a74cc254f060b5cb5d736b5..b100e1fbd11e6d485b5e2ffc6a8854664832a64d 100644 (file)
@@ -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;
index 25e0b9367b9d301ee05ca57d41da039158dcd543..37d4ce1a2c3d2c05d1e9d6a90d64e055613c74ad 100644 (file)
@@ -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
index 299773b851e1fe316d3c21cc984733bd11aaac49..3550c78a4605d96fd116fb32b8d449d7646ec545 100644 (file)
@@ -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 @@ */
 
index 3834a08db87551e2fecbc50746a2d346e88d3a65..553382ca04502343e79b0cba10ad2c33892a1951 100644 (file)
@@ -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
    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 */
similarity index 89%
rename from intl/intlh.inst.in
rename to intl/libgnuintl.h
index dee49065404ed8bcd52cffb5ba8284d4837646cd..e3458280fa5a0e39f2226f5226842d69f6adb2bd 100644 (file)
@@ -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. */
 
index e55d0c0968c37874fbae1f4b7c861db6a2d8c54e..6c495643623096b34bb10526fe861363f131e24c 100644 (file)
@@ -56,7 +56,6 @@ char *alloca ();
 # endif
 #endif
 
-#include "gettext.h"
 #include "gettextP.h"
 
 /* @@ end of prolog @@ */
index 571000745b5a31e44e6fea24eb20c490a028370b..8b1fa02f8015898bf2f615700aaf1d9a3bb48641 100644 (file)
 # 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>
index 1f7fb6cf14cff751acadbb402af457fdc0391f31..1407afee52cbf77089c4e95a5486c9769b993fbe 100644 (file)
@@ -22,7 +22,6 @@
 #endif
 
 #include <stdlib.h>
-#include "gettext.h"
 #include "gettextP.h"
 
 #define YYLEX_PARAM    &((struct parse_args *) arg)->cp
index 99650d6a3eff76c50c4f3da513071f180250ba01..05c2fd76b3c7655fccca0d5e73a895424d6dd4f4 100644 (file)
@@ -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
index 12a0b88781880a0b8ff1d57c2f1464ddbb245fa9..4af3df57921dd37caed9d5d26342612add99cd80 100644 (file)
@@ -1,3 +1,9 @@
+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.
index bc7b944b65a1d243623c817e279cd9e2b7422393..64759beb999ad6091dfc54870d86801d7bdcff2d 100644 (file)
@@ -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.
index e761eca0f1fb02a0cdb6e1a5e76fa2fd8e33026e..1562734e443404f4dfeca4eae9c9a92a2182779e 100644 (file)
@@ -1,3 +1,15 @@
+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.
index 9be13bbea8e148252305c74e0d89d22c32c584fe..8dcbb4425ff56e39e64c9f3b57b8f139f6c2a17d 100644 (file)
@@ -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"
 
index 46ace8e7b9bd765b9f1533a574818b69e357c80d..0f653ab8463b3c529487a6d36a47c93b25bf7d6c 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "gettext.h"
 #include "hash-string.h"
-#include <libintl.h>
+#include "libgettext.h"
 #include "message.h"
 #include "po.h"
 
index 1732c186b43874ed6359a496513e6a3e35e24246..c70e6b4647d903a98b476dc05325e07ddb404ab1 100644 (file)
@@ -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)
index 6842a08a14c9cc922a99e4cf0b0f4a8dca7c5fae..3dd2cec5e011d871acd204580837c04c592514bd 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "gettext.h"
 #include "hash-string.h"
-#include <libintl.h>
+#include "libgettext.h"
 #include "message.h"
 
 #define _(str) gettext (str)
index 0bf4379bc9a015378ea58d18d4eea9c1325cb211..7ae3606e8395a7a80e315c92d51f3fa42a5c06dd 100644 (file)
@@ -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)
 
index edbfb5a959130e4960cda354e769a13863f4894f..ddd776da7dcf0530ba65f98a9a6424f17eb9f1be 100644 (file)
@@ -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)
index 83f0cdd18a5c3e3ead9fa7031bbf633ddfa94e7c..1ba8264d3d72e03c801e1f9c8052edc543357a3a 100644 (file)
@@ -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
index e4da03f10e775b9d49ec9a26d30d160f72678327..611100d39d0e2ebf59186a3596e72f8366f92a7f 100644 (file)
@@ -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 ();
index 9740a3a4a555fde0dbecb72ad7c3f6c0c40431e2..4f24852733d5707ba665b444a443374da6e1dde5 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 033eaa988ad690617a9344db4671013543744c8c..37beec64c17aadb06206adc7a4fb045fc1398f7d 100644 (file)
@@ -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;