PACKAGE=gettext VERSION=0.10 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PACKAGE) AC_SUBST(VERSION)Of course, you replace `gettext' with the name of your package, and `0.10' by its version numbers, exactly as they should appear in the packaged
tar
file name of your distribution
(`gettext-0.10.tar.gz', here).
ALL_LINGUAS
to the white separated,
quoted list of available languages, in a single line, like this:
ALL_LINGUAS="de fr"This example means that German and French PO files are available, so that these languages are currently supported by your package. If you want to further restrict, at installation time, the set of installed languages, this should not be done by modifying
ALL_LINGUAS
in
`configure.in', but rather by using the LINGUAS
environment
variable (see section Magic for Installers).
m4
macro for triggering internationalization
support. Just add this line to `configure.in':
ud_GNU_GETTEXTThis call is purposely simple, even if it generates a lot of configure time checking and actions.
ud_GNU_GETTEXT
in `configure.in', use:
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)This will create one header file `libintl.h'. The reason for this has to do with the fact that some systems, using the Uniforum message handling functions, already have a file of this name. The
AC_LINK_FILES
call has not been integrated into the
ud_GNU_GETTEXT
macro because there can be only one such call
in a `configure' file. If you already use it, you will have to
merge the needed AC_LINK_FILES
within yours, by adding
the first argument at the end of the list of your first argument,
and adding the second argument at the end of the list of your second
argument.
AC_OUTPUT
directive, at the end of your `configure.in'
file, needs to be modified in two ways:
AC_OUTPUT([existing configuration files intl/Makefile po/Makefile.in], [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile existing additional actions])The modification to the first argument to
AC_OUTPUT
asks
for substitution in the `intl/' and `po/' directories.
Note the `.in' suffix used for `po/' only. This is because
the distributed file is really `po/Makefile.in.in'.
The modification to the second argument ensures that `po/Makefile'
gets generated out of the `po/Makefile.in' just created, including
in it the `po/POTFILES' produced by ud_GNU_GETTEXT
.
Two steps are needed because `po/POTFILES' can get lengthy in
some packages, too lengthy in fact for being able to merely use an
Autoconf substituted variable, as many sed
s cannot handle very
long lines.
Go to the first, previous, next, last section, table of contents.