Internationalization of packages, as provided by GNU
optional. It can be turned off in two situations:
./configure --disable-nls’. This can be useful when small binaries are more important than features, for example when building utilities for boot diskettes. It can also be useful in order to get some specific C compiler warnings about code quality with some older versions of GCC (older than 3.0).
A C preprocessor macro can be used to detect these two cases. Usually,
libintl.h was found and not explicitly disabled, the
ENABLE_NLS macro will be defined to 1 in the autoconf generated
configuration file (usually called
config.h). In the two negative
situations, however, this macro will not be defined, thus it will evaluate
to 0 in C preprocessor expressions.
gettext.h is a convenience header file for conditional use of
<libintl.h>, depending on the
ENABLE_NLS macro. If
ENABLE_NLS is set, it includes
<libintl.h>; otherwise it
defines no-op substitutes for the libintl.h functions. We recommend
the use of
"gettext.h" over direct use of
so that portability to older systems is guaranteed and installers can
turn off internationalization if they want to. In the C code, you will
The location of
gettext.h is usually in a directory containing
auxiliary include files. In many GNU packages, there is a directory
lib/ containing helper functions;
gettext.h fits there.
In other packages, it can go into the
Do not install the
gettext.h file in public locations. Every
package that needs it should contain a copy of it on its own.