www.delorie.com/gnu/docs/gettext/gettext_190.html   search  
 
Buy GNU books!


GNU gettext utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.5.1 AM_GNU_GETTEXT in `gettext.m4'

The AM_GNU_GETTEXT macro tests for the presence of the GNU gettext function family in either the C library or a separate libintl library (shared or static libraries are both supported) or in the package's `intl/' directory.

AM_GNU_GETTEXT accepts up to three optional arguments. The general syntax is

 
AM_GNU_GETTEXT([intlsymbol], [needsymbol], [intldir])

intlsymbol can be one of `external', `no-libtool', `use-libtool'. The default (if it is not specified or empty) is `no-libtool'. intlsymbol should be `external' for packages with no `intl/' directory, and `no-libtool' or `use-libtool' for packages with an `intl/' directory. If intlsymbol is `use-libtool', then a libtool library $(top_builddir)/intl/libintl.la will be created (shared and/or static, depending on --{enable,disable}-{shared,static} and on the presence of AM_DISABLE_SHARED). If intlsymbol is `no-libtool', a static library $(top_builddir)/intl/libintl.a will be created.

If needsymbol is specified and is `need-ngettext', then GNU gettext implementations (in libc or libintl) without the ngettext() function will be ignored. If needsymbol is specified and is `need-formatstring-macros', then GNU gettext implementations that don't support the ISO C 99 `<inttypes.h>' formatstring macros will be ignored. Only one needsymbol can be specified. To specify more than one requirement, just specify the strongest one among them. The hierarchy among the various alternatives is as follows: `need-formatstring-macros' implies `need-ngettext'.

intldir is used to find the intl libraries. If empty, the value `$(top_builddir)/intl/' is used.

The AM_GNU_GETTEXT macro determines whether GNU gettext is available and should be used. If so, it sets the USE_NLS variable to `yes'; it defines ENABLE_NLS to 1 in the autoconf generated configuration file (usually called `config.h'); it sets the variables LIBINTL and LTLIBINTL to the linker options for use in a Makefile (LIBINTL for use without libtool, LTLIBINTL for use with libtool); it adds an `-I' option to CPPFLAGS if necessary. In the negative case, it sets USE_NLS to `no'; it sets LIBINTL and LTLIBINTL to empty and doesn't change CPPFLAGS.

The complexities that AM_GNU_GETTEXT deals with are the following:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003