]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Remove catgets fallback code.
authorBruno Haible <bruno@clisp.org>
Thu, 18 Jan 2001 16:51:39 +0000 (16:51 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Jan 2001 16:51:39 +0000 (16:51 +0000)
19 files changed:
Admin/plans
NEWS
README
doc/ChangeLog
doc/gettext.texi
doc/nls.texi
doc/version.texi
intl/ChangeLog
intl/Makefile.in
intl/cat-compat.c [deleted file]
intl/libgettext.h
intl/po2msg.sin [deleted file]
intl/po2tbl.sin [deleted file]
m4/ChangeLog
m4/gettext.m4
po/ChangeLog
po/Makefile.in.in
src/ChangeLog
src/Makefile.am

index 7c5d2aed8fac90be4bacbfb827c6bcfad9d65284..1a3a582a893daec0ad975da47cb7f6a283ff782f 100644 (file)
@@ -50,7 +50,3 @@ Things we plan to do. Comments welcome.
 - Split xgettext into a language dependent part and a language independent
   part.
 
-Future:
-
-- Remove support for catgets.
-
diff --git a/NEWS b/NEWS
index 013a9a343f38fa49ffac95789554669b5cc4d666..8738df4b3bb4caf36bf929b9413d6c485e84820e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Version 0.10.36 - XXX 2000, by Ulrich Drepper
+Version 0.10.36 - XXX 2001, by Ulrich Drepper and Bruno Haible
 
 * General plural handling. New functions ngettext, dngettext, dcngettext.
 
@@ -6,6 +6,14 @@ Version 0.10.36 - XXX 2000, by Ulrich Drepper
   ja_JP.UTF-8, can now share the same message catalogs. gettext converts
   the messages to the appropriate character encoding on the fly.
 
+* Support for non-GNU gettext has been dropped.  Previously, on Solaris, the
+  system's gettext was used (unless --with-included-gettext was specified),
+  which led to problems with PO files that were not 100% translated.
+
+* Support for the catgets wrapper has been dropped.  This means that gettext
+  now always supports the LANGUAGE environment variable, message inheritance,
+  automatic charset conversion etc.
+
 * Support for the old Linux specific .msg catalog format has been dropped.
 
 * PO mode changes:
diff --git a/README b/README
index 66c49ed79ec025329a611e754109f5f581790863..08d183682c9a5522f439da39b0186096417561f5 100644 (file)
--- a/README
+++ b/README
@@ -13,9 +13,10 @@ here included functions compile ok.  This helps to prevent errors
 when installing other packages which use this library.  The message
 handling functions are not yet part of POSIX and ISO/IEC standards
 and therefore it is not possible to rely on facts about their
-implementation in the local C library.  If the installer selects
-it, GNU gettext tries using the systems functionality; in that
-case, compatibility problems might occur.
+implementation in the local C library.  For this reason, GNU gettext
+tries using the system's functionality only if it is a GNU gettext
+implementation (possibly a different version); otherwise, compatibility
+problems would occur.
 
 We felt that the Uniforum proposals has the much more flexible interface
 and, what is more important, does not burden the programmers as much as
@@ -32,15 +33,9 @@ The goal of this library was to give a unique interface to message
 handling functions.  At least the same level of importance was to give
 the programmer/maintainer the needed tools to maintain the message
 catalogs.  The interface is designed after the proposals of the
-Uniforum group.  So systems having this interface implemented in their
-C library don't need the library provided here (and it will
-automatically not be included).  If your systems C library implements
-the second widely available approach (X/Opens catgets) the library
-can use this and only some stubs will be compiled to provide the
-needed interface.  If neither is locally available a full
-implementation of the library will be compiled.
-
-The configure script provides three non-standard options.  These will
+Uniforum group.
+
+The configure script provides two non-standard options.  These will
 also be available in other packages if they use the functionality of
 GNU gettext.  Use
 
@@ -71,27 +66,10 @@ The second configure option is
 
        --with-included-gettext
 
-This forces to use the GNU implementing the message handling library
+This forces to use the GNU implementation of the message handling library
 regardless what the local C library provides.  This possibility is
-much less error prone because possible unreliable effects of the local
-message handling system are avoided.  And perhaps more important: many
-useful features can only be exploited with this library.  The reason
-is obvious: we cannot dig in the internals of other implementations.
-It is likely that the discrepancy between the GNU implementation and
-others will get bigger in the time coming.  So better change now!
-
-The third option is:
-
-       --with-catgets
-
-The X/Open catgets functions which might be found in the local C
-library are not used by default.  The reason is already described
-above: the GNU gettext library provides many useful extension which
-cannot be emulated with catgets().  Beside this the utility programs
-for generating the catalog used by catgets() vary heavily between
-different systems.  You should select this feature only if you really
-don't want to use the GNU gettext library and do not want to extended
-functionality (but I do not see any good reason for such a choice).
+useful if the local C library is a glibc 2.1.x or older, which didn't
+have all the features the included libintl has.
 
 
 Other files you might look into:
@@ -119,16 +97,12 @@ Some points you might be interested in before installing the package:
     will recognize GNU message catalog files (.mo files).
 
 3.  If your system's C library already provides the gettext interface
-    it might be a good idea to configure the package with
+    and its associated tools don't come from this package, it might be
+    a good idea to configure the package with
         --program-prefix=g
 
     Systems affected by this are:
-        Solaris 2.x, future GNU and GNU/Linux systems
-
-    One point to mention here is that at least Solaris 2.3 does not have
-    all function of the Uniforum proposal implement.  More specific, the
-    dcgettext() function is missing.  For programmers/maintainers it
-    is therefore nowaday better to avoid using this function.
+        Solaris 2.x
 
 4.  Some system have a very dumb^H^H^H^Hstrange version of msgfmt, the
     one which comes with xview.  This one is *not* usable.  It's best
@@ -140,8 +114,7 @@ Some points you might be interested in before installing the package:
     Sparcs like strings aligned to 8 byte boundaries).  If you want to
     have the output of msgfmt aligned you can use the -a option.  But you
     also could change the default value to be different from 1.  Take
-    a look at the config.h file, built by configure.
-    (If you change the default value the test of msgfmt will fail!)
+    a look at the --alignment option of msgfmt.
 
 6.  The locale name alias scheme implemented here is in a similar form
     implemented in the X Window System.  Especially the alias data base
index 4fec2b1f21d2591be7cc41d185ec8f218f9c0a32..88a42c244959e7604e3a8e286afe1d12b9fa1bd5 100644 (file)
@@ -1,3 +1,12 @@
+2001-01-06  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.texi: (Magic for Installers) Remove references to catgets
+       based emulation of gettext.
+       (Being a `gettext' grok): Likewise. LANGUAGE now always works.
+       (acconfig.h): Don't mention HAVE_CATGETS.
+       * nls.texi: Remove references to catgets. Describe new working of
+       autoconf macro.
+
 2001-01-01  Bruno Haible  <haible@clisp.cons.org>
 
        * Makefile.am (MAKEINFO): New macro. Unset LANG and LANGUAGE while
index 137c1ee0981b0cab5a6616cb61b999bbbbedc242..67747acade9034f13b3b5145377730479966a596 100644 (file)
@@ -2990,14 +2990,15 @@ Translation Project sites, and also on most GNU archive sites.
 By default, packages fully using GNU @code{gettext}, internally,
 are installed in such a way that they to allow translation of
 messages.  At @emph{configuration} time, those packages should
-automatically detect whether the underlying host system provides usable
-@code{catgets} or @code{gettext} functions.  If neither is present,
+automatically detect whether the underlying host system already provides
+the GNU @code{gettext} functions.  If not,
 the GNU @code{gettext} library should be automatically prepared
 and used.  Installers may use special options at configuration
 time for changing this behavior.  The command @samp{./configure
---with-included-gettext} bypasses system @code{catgets} or @code{gettext} to
-use GNU @code{gettext} instead, while @samp{./configure --disable-nls}
-produces program totally unable to translate messages.
+--with-included-gettext} bypasses system @code{gettext} to
+use the included GNU @code{gettext} instead,
+while @samp{./configure --disable-nls}
+produces programs totally unable to translate messages.
 
 Internationalized packages have usually many @file{@var{ll}.po}
 files.  Unless
@@ -3974,10 +3975,7 @@ For interactive programs it might be useful to offer a selection of the
 used language at runtime.  To understand how to do this one need to know
 how the used language is determined while executing the @code{gettext}
 function.  The method which is presented here only works correctly
-with the GNU implementation of the @code{gettext} functions.  It is not
-possible with underlying @code{catgets} functions or @code{gettext}
-functions from the systems C library.  The exception is of course the
-GNU C Library which uses the GNU @code{gettext} Library for message handling.
+with the GNU implementation of the @code{gettext} functions.
 
 In the function @code{dcgettext} at every call the current setting of
 the highest priority environment variable is determined and used.
@@ -4112,20 +4110,20 @@ Supposing another catalog access system is implemented.  Which do
 we recommend?  At least for Linux, we need to attract as many
 software developers as possible.  Hence we need to make it as easy
 for them to port their software as possible.  Which means supporting
-@code{catgets}.  We will be implementing the @code{glocale} code
+@code{catgets}.  We will be implementing the @code{libintl} code
 within our @code{libc}, but does this mean we also have to incorporate
 another message catalog access scheme within our @code{libc} as well?
-And what about people who are going to be using the @code{glocale}
+And what about people who are going to be using the @code{libintl}
 + non-@code{catgets} routines.  When they port their software to
 other platforms, they're now going to have to include the front-end
-(@code{glocale}) code plus the back-end code (the non-@code{catgets}
+(@code{libintl}) code plus the back-end code (the non-@code{catgets}
 access routines) with their software instead of just including the
-@code{glocale} code with their software.
+@code{libintl} code with their software.
 
 Message catalog support is however only the tip of the iceberg.
 What about the data for the other locale categories.  They also have
 a number of deficiencies.  Are we going to abandon them as well and
-develop another duplicate set of routines (should @code{glocale}
+develop another duplicate set of routines (should @code{libintl}
 expand beyond message catalog support)?
 
 Like many parts of Unix that can be improved upon, we're stuck with balancing
@@ -4952,11 +4950,11 @@ piece of @code{m4} code will be the same for all projects using GNU
 If you do not have an @file{acconfig.h} file in your distribution, the
 simplest is use take a copy of @file{acconfig.h} from GNU
 @code{gettext}.  But to be precise, you only need the lines and comments
-for @code{ENABLE_NLS}, @code{HAVE_CATGETS}, @code{HAVE_GETTEXT} and
-@code{HAVE_LC_MESSAGES}, @code{HAVE_STPCPY}, @code{PACKAGE} and
-@code{VERSION}, so you may use an editor and remove everything else.  If
-you already have an @file{acconfig.h} file, then you should merge the
-said definitions into your @file{acconfig.h}.
+for @code{ENABLE_NLS}, @code{HAVE_GETTEXT} and @code{HAVE_LC_MESSAGES},
+@code{HAVE_STPCPY}, @code{PACKAGE} and @code{VERSION}, so you may use an
+editor and remove everything else.  If you already have an
+@file{acconfig.h} file, then you should merge the said definitions into
+your @file{acconfig.h}.
 
 @node Makefile, src/Makefile, acconfig, Adjusting Files
 @subsection @file{Makefile.in} at top level
index 7c169bcd953141a163256662d7d515e63191a572..e3c18c388458855139ee8f26f7effbcf6cfaa9dd 100644 (file)
@@ -48,7 +48,8 @@ to force usage of internationalizing routines provided within this
 package, despite the existence of internationalizing capabilities in the
 operating system where this package is being installed.  So far, only
 the @code{gettext} implementation in the GNU C library version 2
-provides as many features (such as locale alias or message inheritance)
+provides as many features (such as locale alias, message inheritance,
+automatic charset conversion or plural form handling)
 as the implementation here.  It is also not possible to offer this
 additional functionality on top of a @code{catgets} implementation.
 Future versions of GNU @code{gettext} will very likely convey even more
@@ -69,9 +70,8 @@ Most such packages use GNU @code{gettext}.  Other packages have their
 own ways to internationalization, predating GNU @code{gettext}.
 
 By default, this package will be installed to allow translation of
-messages.  It will automatically detect whether the system provides
-usable @code{catgets} (if using this is selected by the installer) or
-@code{gettext} functions.  If neither is available, the GNU
+messages.  It will automatically detect whether the system already
+provides the GNU @code{gettext} functions.  If not, the GNU
 @code{gettext} own library will be used.  This library is wholly
 contained within this package, usually in the @file{intl/} subdirectory,
 so prior installation of the GNU @code{gettext} package is @emph{not}
@@ -80,16 +80,13 @@ changing the default behaviour.  The commands:
 
 @example
 ./configure --with-included-gettext
-./configure --with-catgets
 ./configure --disable-nls
 @end example
 
 @noindent
-will respectively bypass any pre-existing @code{catgets} or
-@code{gettext} to use the internationalizing routines provided within
-this package, enable the use of the @code{catgets} functions (if found
-on the locale system), or else, @emph{totally} disable translation of
-messages.
+will respectively bypass any pre-existing @code{gettext} to use the
+internationalizing routines provided within this package, or else,
+@emph{totally} disable translation of messages.
 
 When you already have GNU @code{gettext} installed on your system and
 run configure without an option for your new package, @code{configure}
@@ -106,22 +103,10 @@ which comes with this package is more recent, you should use
 @noindent
 to prevent auto-detection.
 
-By default the configuration process will not test for the
-@code{catgets} function and therefore they will not be used.  The
-reasons are already given above: the emulation on top of @code{catgets}
-cannot provide all the extensions provided by the GNU @code{gettext}
-library.  If you nevertheless want to use the @code{catgets} functions
-use
-
-@example
-./configure --with-catgets
-@end example
-
-@noindent
-to enable the test for @code{catgets} (this causes no harm if
-@code{catgets} is not available on your system).  If you really select
-this option we would like to hear about the reasons because we cannot
-think of any good one ourself.
+The configuration process will not test for the @code{catgets} function
+and therefore it will not be used.  The reason is that even an
+emulation of @code{gettext} on top of @code{catgets} could not provide
+all the extensions of the GNU @code{gettext} library.
 
 Internationalized packages have usually many @file{po/@var{ll}.po}
 files, where @var{ll} gives an @w{ISO 639} two-letter code
index 80506d70ad4c7e8776ca872c4125cde20983abf3..c250ceb27517093c1b6538d334d273fc5db1bec5 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 1 January 2001
+@set UPDATED 7 January 2001
 @set EDITION 0.10.36
 @set VERSION 0.10.36
index 821b7ee028b745959ee46339f765daf194837166..5837d2e334d2d2b97ea7bd90535073d49c2fa95d 100644 (file)
@@ -1,3 +1,27 @@
+2001-01-06  Bruno Haible  <haible@clisp.cons.org>
+
+       Remove catgets fallback code.
+       - It does not handle message clash prevention through domains and
+         dgettext().
+       - It does not handle message catalog inheritance and the LANGUAGE
+         environment variable.
+       - It does not handle locale aliases.
+       - It does not handle automatic charset conversion.
+       - It does not handle plural form handling and ngettext().
+       - It uses a slow string to integer conversion.
+       - It is sensitive against installation problems.
+       * cat-compat.c: Remove file.
+       * po2msg.sin, po2tbl.sin: Remove files.
+       * Makefile.in (datadir): Assume DATADIRNAME = share.
+       (SOURCES): Remove cat-compat.c.
+       (DISTFILES.common): Remove po2msg.sin, po2tbl.sin.
+       (distclean): No need to remove po2msg.sed, po2tbl.sed.
+       (../po/cat-id-tbl.$lo): Remove rule.
+       * libgettext.h (_msg_ent): Remove.
+       (_msg_tbl, _msg_tbl_length): Remove declarations.
+       (gettext, dgettext, ngettext, dngettext): Don't depend on
+       !HAVE_CATGETS.
+
 2001-01-04  Ulrich Drepper  <drepper@redhat.com>
 
        * plural.y (yylex): Minimal improvement in number scanner.
index bc1dad774c8a1453fa24c2c7bba54e534ba014be..63d1367a1393522ea88daeea719630aafd4c8bbb 100644 (file)
@@ -30,7 +30,7 @@ exec_prefix = @exec_prefix@
 transform = @program_transform_name@
 libdir = $(exec_prefix)/lib
 includedir = $(prefix)/include
-datadir = $(prefix)/@DATADIRNAME@
+datadir = $(prefix)/share
 localedir = $(datadir)/locale
 gettextsrcdir = @datadir@/gettext/intl
 aliaspath = $(localedir)
@@ -60,7 +60,7 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
 
 HEADERS = $(COMHDRS) libgettext.h loadinfo.h
 COMHDRS = gettext.h gettextP.h hash-string.h
-SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+SOURCES = $(COMSRCS) intl-compat.c
 COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
 finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
 explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
@@ -69,9 +69,8 @@ OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
 finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
 explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
 plural.$lo localcharset.$lo
-CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
 GETTOBJS = intl-compat.$lo
-DISTFILES.common = ChangeLog Makefile.in po2msg.sin po2tbl.sin \
+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
@@ -113,9 +112,6 @@ libintl.la: $(OBJECTS)
                   -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
                   -rpath $(libdir)
 
-../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
-       cd ../po && $(MAKE) cat-id-tbl.$lo
-
 charset.alias: config.charset
        $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
        mv t-$@ $@
@@ -126,9 +122,8 @@ check: all
 # only use the library should use install instead.
 
 # We must not install the libintl.h/libintl.a files if we are on a
-# system which has the gettext() function in its C library or in a
-# separate library or use the catgets interface.  A special case is
-# where configure found a previously installed GNU gettext library.
+# system which has the GNU gettext() function in its C library or in a
+# separate library.
 # If you want to use the one which comes with this version of the
 # package, you have to use `configure --with-included-gettext'.
 install: install-exec install-data
@@ -246,7 +241,7 @@ mostlyclean:
 clean: mostlyclean
 
 distclean: clean
-       rm -f Makefile ID TAGS po2msg.sed po2tbl.sed
+       rm -f Makefile ID TAGS
        if test "$(PACKAGE)" = gettext; then \
          rm -f $(DISTFILES.normal); \
        else \
diff --git a/intl/cat-compat.c b/intl/cat-compat.c
deleted file mode 100644 (file)
index 2082ad6..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/* Compatibility code for gettext-using-catgets interface.
-   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
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-#  include <malloc.h>
-# endif
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-#ifdef HAVE_NL_TYPES_H
-# include <nl_types.h>
-#endif
-
-#include "libgettext.h"
-
-/* Tell the compiler when a conditional or integer expression is
-   almost always true or almost always false.  */
-#ifndef HAVE_BUILTIN_EXPECT
-# define __builtin_expect(expr, val) (expr)
-#endif
-
-/* @@ end of prolog @@ */
-
-/* XPG3 defines the result of `setlocale (category, NULL)' as:
-   ``Directs `setlocale()' to query `category' and return the current
-     setting of `local'.''
-   However it does not specify the exact format.  And even worse: POSIX
-   defines this not at all.  So we can use this feature only on selected
-   system (e.g. those using GNU C Library).  */
-#ifdef _LIBC
-# define HAVE_LOCALE_NULL
-#endif
-
-/* The catalog descriptor.  */
-static nl_catd catalog = (nl_catd) -1;
-
-/* Name of the default catalog.  */
-static const char default_catalog_name[] = "messages";
-
-/* Name of currently used catalog.  */
-static const char *catalog_name = default_catalog_name;
-
-/* Get ID for given string.  If not found return -1.  */
-static int msg_to_cat_id PARAMS ((const char *msg));
-
-/* Substitution for systems lacking this function in their C library.  */
-#if !_LIBC && !HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
-#endif
-
-
-/* Set currently used domain/catalog.  */
-char *
-textdomain (domainname)
-     const char *domainname;
-{
-  nl_catd new_catalog;
-  char *new_name;
-  size_t new_name_len;
-  char *lang;
-
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
-    && defined HAVE_LOCALE_NULL
-  lang = setlocale (LC_MESSAGES, NULL);
-#else
-  lang = getenv ("LC_ALL");
-  if (lang == NULL || lang[0] == '\0')
-    {
-      lang = getenv ("LC_MESSAGES");
-      if (lang == NULL || lang[0] == '\0')
-       lang = getenv ("LANG");
-    }
-#endif
-  if (lang == NULL || lang[0] == '\0')
-    lang = "C";
-
-  /* See whether name of currently used domain is asked.  */
-  if (domainname == NULL)
-    return (char *) catalog_name;
-
-  if (domainname[0] == '\0')
-    domainname = default_catalog_name;
-
-  /* Compute length of added path element.  */
-  new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
-                + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
-                + sizeof (".cat");
-
-  new_name = (char *) malloc (new_name_len);
-  if (new_name == NULL)
-    return NULL;
-
-  strcpy (new_name, PACKAGE);
-  new_catalog = catopen (new_name, 0);
-
-  if (new_catalog == (nl_catd) -1)
-    {
-      /* NLSPATH search didn't work, try absolute path */
-      sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
-              PACKAGE);
-      new_catalog = catopen (new_name, 0);
-
-      if (new_catalog == (nl_catd) -1)
-       {
-         free (new_name);
-         return (char *) catalog_name;
-       }
-    }
-
-  /* Close old catalog.  */
-  if (catalog != (nl_catd) -1)
-    catclose (catalog);
-  if (catalog_name != default_catalog_name)
-    free ((char *) catalog_name);
-
-  catalog = new_catalog;
-  catalog_name = new_name;
-
-  return (char *) catalog_name;
-}
-
-char *
-bindtextdomain (domainname, dirname)
-     const char *domainname;
-     const char *dirname;
-{
-#if HAVE_SETENV || HAVE_PUTENV
-  char *old_val, *new_val, *cp;
-  size_t new_val_len;
-
-  /* This does not make much sense here but to be compatible do it.  */
-  if (domainname == NULL)
-    return NULL;
-
-  /* Compute length of added path element.  If we use setenv we don't need
-     the first byts for NLSPATH=, but why complicate the code for this
-     peanuts.  */
-  new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
-               + sizeof ("/%L/LC_MESSAGES/%N.cat");
-
-  old_val = getenv ("NLSPATH");
-  if (old_val == NULL || old_val[0] == '\0')
-    {
-      old_val = NULL;
-      new_val_len += 1 + sizeof (LOCALEDIR) - 1
-                    + sizeof ("/%L/LC_MESSAGES/%N.cat");
-    }
-  else
-    new_val_len += strlen (old_val);
-
-  new_val = (char *) malloc (new_val_len);
-  if (new_val == NULL)
-    return NULL;
-
-# if HAVE_SETENV
-  cp = new_val;
-# else
-  cp = stpcpy (new_val, "NLSPATH=");
-# endif
-
-  cp = stpcpy (cp, dirname);
-  cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
-
-  if (old_val == NULL)
-    {
-# if __STDC__
-      stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
-# else
-
-      cp = stpcpy (cp, LOCALEDIR);
-      stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
-# endif
-    }
-  else
-    stpcpy (cp, old_val);
-
-# if HAVE_SETENV
-  setenv ("NLSPATH", new_val, 1);
-  free (new_val);
-# else
-  putenv (new_val);
-  /* Do *not* free the environment entry we just entered.  It is used
-     from now on.   */
-# endif
-
-#endif
-
-  return (char *) domainname;
-}
-
-char *
-bind_textdomain_codeset (domainname, codeset)
-     const char *domainname;
-     const char *codeset;
-{
-  /* This does not make much sense here but to be compatible do it.  */
-  if (domainname == NULL)
-    return NULL;
-
-  /* catgets doesn't support character codeset conversion.  We could
-     call iconv() ourselves in gettext, but that's outside of the scope
-     of this compatibility hack.  */
-  return (char *) codeset;
-}
-
-#undef gettext
-char *
-gettext (msg)
-     const char *msg;
-{
-  int msgid;
-
-  if (msg == NULL || catalog == (nl_catd) -1)
-    return (char *) msg;
-
-  /* Get the message from the catalog.  We always use set number 1.
-     The message ID is computed by the function `msg_to_cat_id'
-     which works on the table generated by `po-to-tbl'.  */
-  msgid = msg_to_cat_id (msg);
-  if (msgid == -1)
-    return (char *) msg;
-
-  return catgets (catalog, 1, msgid, (char *) msg);
-}
-
-/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
-   for the one equal to msg.  If it is found return the ID.  In case when
-   the string is not found return -1.  */
-static int
-msg_to_cat_id (msg)
-     const char *msg;
-{
-  int cnt;
-
-  for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
-    if (__builtin_expect (strcmp (msg, _msg_tbl[cnt]._msg) == 0, 0))
-      return _msg_tbl[cnt]._msg_number;
-
-  return -1;
-}
-
-
-/* @@ begin of epilog @@ */
-
-/* We don't want libintl.a to depend on any other library.  So we
-   avoid the non-standard function stpcpy.  In GNU C Library this
-   function is available, though.  Also allow the symbol HAVE_STPCPY
-   to be defined.  */
-#if !_LIBC && !HAVE_STPCPY
-static char *
-stpcpy (dest, src)
-     char *dest;
-     const char *src;
-{
-  while ((*dest++ = *src++) != '\0')
-    /* Do nothing. */ ;
-  return dest - 1;
-}
-#endif
index ff453ecacd58aff4936f5ae613e24501f6d1f606..644d727a6d55b98642be609e6f4d20155de00c2c 100644 (file)
@@ -67,23 +67,6 @@ extern "C" {
 #endif
 
 
-/* Declarations for gettext-using-catgets interface.  Derived from
-   Jim Meyering's libintl.h.  */
-struct _msg_ent
-{
-  const char *_msg;
-  int _msg_number;
-};
-
-
-#if HAVE_CATGETS
-/* These two variables are defined in the automatically by po-to-tbl.sed
-   generated file `cat-id-tbl.c'.  */
-extern const struct _msg_ent _msg_tbl[];
-extern int _msg_tbl_length;
-#endif
-
-
 /* For automatical extraction of messages sometimes no real
    translation is needed.  Instead the string itself is the result.  */
 #define gettext_noop(Str) (Str)
@@ -158,7 +141,7 @@ extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
 /* 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_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+# if !HAVE_GETTEXT || HAVE_DCGETTEXT
 
 #  define gettext(Msgid)                                                     \
      dgettext (NULL, Msgid)
diff --git a/intl/po2msg.sin b/intl/po2msg.sin
deleted file mode 100644 (file)
index 658e767..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# The first directive in the .msg should be the definition of the
-# message set number.  We use always set number 1.
-#
-1 {
-  i\
-$set 1 # Automatically created by po2msg.sed
-  h
-  s/.*/0/
-  x
-}
-#
-# We copy all comments into the .msg file.  Perhaps they can help.
-#
-/^#/ s/^#[     ]*/$ /p
-#
-# We copy the original message as a comment into the .msg file.
-#
-/^msgid/ {
-# Does not work now
-#  /"$/! {
-#    s/\\$//
-#    s/$/ ... (more lines following)"/
-#  }
-  s/^msgid[    ]*"\(.*\)"$/$ Original Message: \1/
-  p
-}
-#
-# The .msg file contains, other than the .po file, only the translations
-# but each given a unique ID.  Starting from 1 and incrementing by 1 for
-# each message we assign them to the messages.
-# It is important that the .po file used to generate the cat-id-tbl.c file
-# (with po-to-tbl) is the same as the one used here.  (At least the order
-# of declarations must not be changed.)
-#
-/^msgstr/ {
-  s/msgstr[    ]*"\(.*\)"/\1/
-  x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
-  td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
-  :d
-  s/9\(_*\)$/_\1/
-  td
-# Assure at least one digit is available.
-  s/^\(_*\)$/0\1/
-# Increment the last digit.
-  s/8\(_*\)$/9\1/
-  s/7\(_*\)$/8\1/
-  s/6\(_*\)$/7\1/
-  s/5\(_*\)$/6\1/
-  s/4\(_*\)$/5\1/
-  s/3\(_*\)$/4\1/
-  s/2\(_*\)$/3\1/
-  s/1\(_*\)$/2\1/
-  s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
-  s/_/0/g
-  x
-# Bring the line in the format `<number> <message>'
-  G
-  s/^[^\n]*$/& /
-  s/\(.*\)\n\([0-9]*\)/\2 \1/
-# Clear flag from last substitution.
-  tb
-# Append the next line.
-  :b
-  N
-# Look whether second part is a continuation line.
-  s/\(.*\n\)"\(.*\)"/\1\2/
-# Yes, then branch.
-  ta
-  P
-  D
-# Note that `D' includes a jump to the start!!
-# We found a continuation line.  But before printing insert '\'.
-  :a
-  s/\(.*\)\(\n.*\)/\1\\\2/
-  P
-# We cannot use the sed command `D' here
-  s/.*\n\(.*\)/\1/
-  tb
-}
-d
diff --git a/intl/po2tbl.sin b/intl/po2tbl.sin
deleted file mode 100644 (file)
index ee89f8b..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-1 {
-  i\
-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot.  */\
-\
-#if HAVE_CONFIG_H\
-# include <config.h>\
-#endif\
-\
-#include "libgettext.h"\
-\
-const struct _msg_ent _msg_tbl[] = {
-  h
-  s/.*/0/
-  x
-}
-#
-# Write msgid entries in C array form.
-#
-/^msgid/ {
-  s/msgid[     ]*\(".*"\)/  {\1/
-  tb
-# Append the next line
-  :b
-  N
-# Look whether second part is continuation line.
-  s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
-# Yes, then branch.
-  ta
-# Because we assume that the input file correctly formed the line
-# just read cannot be again be a msgid line.  So it's safe to ignore
-# it.
-  s/\(.*\)\n.*/\1/
-  bc
-# We found a continuation line.  But before printing insert '\'.
-  :a
-  s/\(.*\)\(\n.*\)/\1\\\2/
-# Escape trigraphs.
-  s/[?][?]\([-=(/)'<!>]\)/?\\?\1/g
-  P
-# We cannot use D here.
-  s/.*\n\(.*\)/\1/
-# Some buggy seds do not clear the `successful substitution since last ``t'''
-# flag on `N', so we do a `t' here to clear it.
-  tb
-# Not reached
-  :c
-  x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
-  td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
-  :d
-  s/9\(_*\)$/_\1/
-  td
-# Assure at least one digit is available.
-  s/^\(_*\)$/0\1/
-# Increment the last digit.
-  s/8\(_*\)$/9\1/
-  s/7\(_*\)$/8\1/
-  s/6\(_*\)$/7\1/
-  s/5\(_*\)$/6\1/
-  s/4\(_*\)$/5\1/
-  s/3\(_*\)$/4\1/
-  s/2\(_*\)$/3\1/
-  s/1\(_*\)$/2\1/
-  s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
-  s/_/0/g
-  x
-  G
-  s/\(.*\)\n\([0-9]*\)/\1, \2},/
-  s/\(.*\)"$/\1/
-# Escape trigraphs.
-  s/[?][?]\([-=(/)'<!>]\)/?\\?\1/g
-  p
-}
-#
-# Last line.
-#
-$ {
-  i\
-};\
-
-  g
-  s/0*\(.*\)/int _msg_tbl_length = \1;/p
-}
-d
index 638ee25f3f83106b44f2cbff1d2c3d8c059dc0bb..dcab5ef2abbba4e0bc5fec2309895d4fd2d34900 100644 (file)
@@ -1,3 +1,18 @@
+2001-01-06  Bruno Haible  <haible@clisp.cons.org>
+
+       Remove catgets fallback code.
+       - It does not handle message clash prevention through domains and
+         dgettext().
+       - It does not handle message catalog inheritance and the LANGUAGE
+         environment variable.
+       - It does not handle locale aliases.
+       - It does not handle automatic charset conversion.
+       - It does not handle plural form handling and ngettext().
+       - It uses a slow string to integer conversion.
+       - It is sensitive against installation problems.
+       * gettext.m4 (AM_WITH_NLS): Don't look for catgets any more. Don't
+       define INSTOBJEXT. Don't create intl/po2msg.sed and intl/po2tbl.sed.
+
 2001-01-06  Bruno Haible  <haible@clisp.cons.org>
 
        * setlocale.m4: New file.
index 5daf742d0a723b1da298496de0ad118f2e631643..b0bf2690d07ca4361873372dcd0b911502840178 100644 (file)
@@ -9,27 +9,20 @@
 # serial 8
 
 dnl Usage: AM_WITH_NLS([SYMBOL], [LIBDIR], [INCDIR]).
-dnl If SYMBOL is specified and is `no-catgets', then the catgets checks
-dnl    will be disabled.  You must specify this if your program uses
-dnl    any of the ngettext/dngettext/dcngettext/bind_textdomain_codeset
-dnl    functions, which are not supported by the catgets backend.
 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 four cases:
+dnl The result of the configuration is one of three cases:
 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
 dnl    and used.
-dnl    Catalog format: GNU --> DATADIRNAME = share
+dnl    Catalog format: GNU --> install in $(datadir)
 dnl    Catalog extension: .mo after installation, .gmo in source tree
 dnl 2) GNU gettext has been found in the system's C library.
-dnl    Catalog format: GNU --> DATADIRNAME = share
+dnl    Catalog format: GNU --> install in $(datadir)
 dnl    Catalog extension: .mo after installation, .gmo in source tree
-dnl 3) A catgets has been found in the system's C library.
-dnl    Catalog format: Platform dependent --> DATADIRNAME = lib
-dnl    Catalog extension: .cat
-dnl 4) No internationalization, always use English msgid.
+dnl 3) No internationalization, always use English msgid.
 dnl    Catalog format: none
 dnl    Catalog extension: none
 dnl The use of .gmo is historical (it was needed to avoid overwriting the
@@ -61,9 +54,8 @@ AC_DEFUN(AM_WITH_NLS,
       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
         dnl User does not insist on using GNU NLS library.  Figure out what
-        dnl to use.  If GNU gettext or catgets are available (in this order)
-        dnl we use this.  Else we have to fall back to GNU NLS library.
-       dnl catgets is only used if permitted by option --with-catgets.
+        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
@@ -102,8 +94,6 @@ return (int) gettext ("") + _nl_msg_cat_cntr],
                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
              if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
                INTLLIBS="-lintl"
@@ -111,45 +101,8 @@ return (int) gettext ("") + _nl_msg_cat_cntr],
            fi
        ])
 
-ifelse([$1], no-catgets, ,[
         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='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])
-         fi
-        fi
-])
-
-        if test "$CATOBJEXT" = "NONE"; then
-         dnl Neither gettext nor catgets in included in the C library.
+         dnl GNU gettext is not found in the C library.
          dnl Fall back on GNU gettext library.
          nls_cv_use_gnu_gettext=yes
         fi
@@ -166,8 +119,6 @@ ifelse([$1], no-catgets, ,[
         AC_SUBST(MSGFMT)
        USE_INCLUDED_LIBINTL=yes
         CATOBJEXT=.gmo
-        INSTOBJEXT=.mo
-        DATADIRNAME=share
        INTLDEPS='ifelse([$2],[],$(top_builddir)/intl/libintl.a,[$2])'
        INTLLIBS=$INTLDEPS
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
@@ -191,7 +142,6 @@ ifelse([$1], no-catgets, ,[
       # We need to process the po/ directory.
       POSUB=po
     else
-      DATADIRNAME=share
       nls_cv_header_intl=ifelse([$3],[],intl,[$3])/libintl.h
       nls_cv_header_libgt=ifelse([$3],[],intl,[$3])/libgettext.h
     fi
@@ -221,14 +171,16 @@ ifelse([$1], no-catgets, ,[
     AC_SUBST(USE_INCLUDED_LIBINTL)
     AC_SUBST(CATALOGS)
     AC_SUBST(CATOBJEXT)
-    AC_SUBST(DATADIRNAME)
     AC_SUBST(GMOFILES)
-    AC_SUBST(INSTOBJEXT)
     AC_SUBST(INTLDEPS)
     AC_SUBST(INTLLIBS)
     AC_SUBST(INTLOBJS)
     AC_SUBST(POFILES)
     AC_SUBST(POSUB)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    DATADIRNAME=share
+    AC_SUBST(DATADIRNAME)
   ])
 
 dnl Usage: Just like AM_WITH_NLS, which see.
@@ -289,17 +241,6 @@ __argz_count __argz_stringify __argz_next])
    fi
    AC_SUBST(INCLUDE_LOCALE_H)
 
-   test -d intl || mkdir intl
-   if test "$CATOBJEXT" = ".cat"; then
-     dnl Only the X/Open catalog format is supported.
-     dnl Transform the SED scripts while copying because some dumb SEDs
-     dnl cannot handle comments.
-     sed -e '/^#/d' $srcdir/intl/po2msg.sin > intl/po2msg.sed
-   fi
-   dnl po2tbl.sed is always needed.
-   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
-     $srcdir/intl/po2tbl.sin > intl/po2tbl.sed
-
    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.
index 5da665bae63361bf09064960c98996bb4e4d4dd0..ea7ffe9ae3855bbc5f96263a05fd2562d45bfd8e 100644 (file)
@@ -1,3 +1,27 @@
+2001-01-06  Bruno Haible  <haible@clisp.cons.org>
+
+       Remove catgets fallback code.
+       - It does not handle message clash prevention through domains and
+         dgettext().
+       - It does not handle message catalog inheritance and the LANGUAGE
+         environment variable.
+       - It does not handle locale aliases.
+       - It does not handle automatic charset conversion.
+       - It does not handle plural form handling and ngettext().
+       - It uses a slow string to integer conversion.
+       - It is sensitive against installation problems.
+       * Makefile.in.in (datadir): Assume DATADIRNAME = share.
+       (SOURCES): Remove, assume empty.
+       (CATOBJEXT): Remove, assume .gmo.
+       (INSTOBJEXT): Remove, assume .mo.
+       (.SUFFIXES): Remove .msg and .cat.
+       (.po.cat): Remove rule.
+       ($(srcdir)/cat-id-tbl.c, $(srcdir)/stamp-cat-id): Remove rules.
+       (install-data-yes): Update and simplify.
+       (cat-id-tbl.o): Remove rule.
+       (mostlyclean, distclean, maintainer-clean): Update.
+       * cat-id-tbl.c: Remove file.
+
 2001-01-06  Bruno Haible  <haible@clisp.cons.org>
 
        * Makefile.in.in (update-po): Set PATH only for the gettext package.
index 11e708c8d8646bb17abd400b330a4df53b170d2c..f9e02cb66a958033ba20e0d9ec1658d3a50829f5 100644 (file)
@@ -19,7 +19,7 @@ VPATH = @srcdir@
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
-datadir = $(prefix)/@DATADIRNAME@
+datadir = $(prefix)/share
 localedir = $(datadir)/locale
 gettextsrcdir = $(prefix)/share/gettext/po
 subdir = po
@@ -44,20 +44,17 @@ INCLUDES = -I.. -I$(top_srcdir)/intl
 
 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
 
-SOURCES = cat-id-tbl.c
 POFILES = @POFILES@
 GMOFILES = @GMOFILES@
 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
-stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+$(POFILES) $(GMOFILES)
 
 POTFILES = \
 
 CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+.SUFFIXES: .c .o .po .pox .gmo .mo
 
 .c.o:
        $(COMPILE) $<
@@ -73,14 +70,10 @@ INSTOBJEXT = @INSTOBJEXT@
        file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
          && rm -f $$file && $(GMSGFMT) -o $$file $<
 
-.po.cat:
-       sed -f ../intl/po2msg.sed < $< > $*.msg \
-         && rm -f $@ && $(GENCAT) $@ $*.msg
-
 
 all: all-@USE_NLS@
 
-all-yes: cat-id-tbl.c $(CATALOGS)
+all-yes: $(CATALOGS)
 all-no:
 
 $(srcdir)/$(PACKAGE).pot: $(POTFILES)
@@ -91,20 +84,6 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES)
           || ( rm -f $(srcdir)/$(PACKAGE).pot \
                && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
 
-$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
-$(srcdir)/stamp-cat-id: $(PACKAGE).pot
-       rm -f cat-id-tbl.tmp
-       sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
-               | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
-       if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
-         rm cat-id-tbl.tmp; \
-       else \
-         echo cat-id-tbl.c changed; \
-         rm -f $(srcdir)/cat-id-tbl.c; \
-         mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
-       fi
-       cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
-
 
 install: install-exec install-data
 install-exec:
@@ -115,31 +94,16 @@ install-data-yes: all
        @catalogs='$(CATALOGS)'; \
        for cat in $$catalogs; do \
          cat=`basename $$cat`; \
-         lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+         lang=`echo $$cat | sed 's/\.gmo$$//'`; \
          dir=$(localedir)/$$lang/LC_MESSAGES; \
          $(mkinstalldirs) $(DESTDIR)$$dir; \
          if test -r $$cat; then \
-           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
-           echo "installing $$cat as" \
-                "$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+           echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
          else \
-           $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
+           $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
            echo "installing $(srcdir)/$$cat as" \
-                "$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
-         fi; \
-         if test -r $$cat.m; then \
-           $(INSTALL_DATA) $$cat.m $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
-           echo "installing $$cat.m as" \
-                "$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
-         else \
-           if test -r $(srcdir)/$$cat.m ; then \
-             $(INSTALL_DATA) $(srcdir)/$$cat.m \
-               $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
-             echo "installing $(srcdir)/$$cat as" \
-                  "$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
-           else \
-             true; \
-           fi; \
+                "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
          fi; \
        done
        if test "$(PACKAGE)" = "gettext"; then \
@@ -157,9 +121,8 @@ uninstall:
        catalogs='$(CATALOGS)'; \
        for cat in $$catalogs; do \
          cat=`basename $$cat`; \
-         lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-         rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
-         rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+         lang=`echo $$cat | sed 's/\.gmo$$//'`; \
+         rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
        done
        if test "$(PACKAGE)" = "gettext"; then \
          rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
@@ -169,23 +132,21 @@ uninstall:
 
 check: all
 
-cat-id-tbl.o: $(top_srcdir)/intl/libgettext.h
-
 dvi info tags TAGS ID:
 
 mostlyclean:
-       rm -f core core.* *.pox $(PACKAGE).po *.new.po cat-id-tbl.tmp
+       rm -f core core.* *.pox $(PACKAGE).po *.new.po
        rm -fr *.o
 
 clean: mostlyclean
 
 distclean: clean
-       rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+       rm -f Makefile Makefile.in POTFILES *.mo
 
 maintainer-clean: distclean
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
-       rm -f $(GMOFILES) cat-id-tbl.c stamp-cat-id
+       rm -f $(GMOFILES)
 
 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir: $(DISTFILES)
@@ -202,7 +163,7 @@ update-po: Makefile
        catalogs='$(CATALOGS)'; \
        for cat in $$catalogs; do \
          cat=`basename $$cat`; \
-         lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+         lang=`echo $$cat | sed 's/\.gmo$$//'`; \
          echo "$$lang:"; \
          if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
            mv -f $$lang.new.po $$lang.po; \
index 652b9719902998096bbbf61899200b2d4422eeb4..5272f638b3aeefc5546a62d6c6c8017e117550fb 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-06  Bruno Haible  <haible@clisp.cons.org>
+
+       * Makefile.am (datadir): Assume DATADIRNAME = share.
+
 2001-01-06  Bruno Haible  <haible@clisp.cons.org>
 
        * setlocale.c: New file.
index a896b67b375b8baa5c375839fcd1eb3782b8c9b9..a2da9b2387aa5ac8e6328edbf4f6b8d76cdd1f68 100644 (file)
@@ -26,7 +26,7 @@ str-list.h xget-lex.h dir-list.h po-gram-gen.h po-hash-gen.h
 
 EXTRA_DIST = FILES
 
-datadir = $(prefix)/@DATADIRNAME@
+datadir = $(prefix)/share
 localedir = $(datadir)/locale
 
 l = @l@