bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple configure.ac's in a project?


From: Bruno Haible
Subject: Re: multiple configure.ac's in a project?
Date: Tue, 31 Mar 2009 13:39:48 +0200
User-agent: KMail/1.9.9

Simon Josefsson wrote:
> In GnuTLS I'm using several configure.ac:
> 
> configure.ac
> lib/configure.ac
> libextra/configure.ac
> 
> The reason for this was that gnulib worked better with this setup, but
> there are other arguments as well (although, alas, not autoreconf
> speed!).
> 
> However, this complicates the gettext setup.  There is one "gnutls"
> gettext domain.
> 
> The options appears to be:
> 
> 1) Use one gettext domain per configure.ac.
> 
>    In other words, there will be:
> 
>    "gnutls" in po/ for command line tools
>    "libgnutls" in lib/po for libgnutls messages
>    "libgnutls-extra" in libextra/po for libgnutls-extra messages
> 
>   Is this what you would recommend?

As long as there is no significant overlap between the message strings
in the three subprojects, yes, I can recommend this PO files structure.

>   I would have to ask the translation team to rename the current
>   "gnutls" domain into "libgnutls" since currently only messages from
>   the library is in the "gnutls" domain.

Yes, you would have to ask the TP to do this. The TP knows how to
deal with this, and how to use the 'msgmerge' and 'msgattrib' programs
for splitting up the PO files from the last release.

>   This approach appears sub-optimal to me, but maybe you have more
>   insight to this.

What are the drawbacks that you see?

> 2) Use one "gnutls" gettext domain for the entire project, putting the
>    translation files in the top-level po/.
> 
>    This leads to problems in the code in lib/ and libextra/: ENABLE_NLS
>    is not set, so the gettext function is null.
> 
>    If I add AM_GNU_GETTEXT to lib{,extra}/configure.ac

Yes, you will have to use AM_GNU_GETTEXT in each of the three configure.acs,
regardless of which PO files structure you choose.

>    it will require 
>    that directories lib/po/ and libextra/po/ exists -- since the macro
>    and the autopoint tool requires that.

The AM_GNU_GETTEXT macro does not require a PO directory. It can, as well,
work with any number of PO directories.

And you would not need 'autopoint' in these two subdirectories - just use
the 'gettext' module from gnulib.

>    How should code in lib/ and libextra/ use the gettext function?

Libraries should use the dgettext() function, not the gettext() function.
To make it easy for you, gnulib has a module 'gettext-h' which will do
the right thing once you define the C macro DEFAULT_TEXT_DOMAIN through
the AM_CPPFLAGS variable in lib/Makefile.am and libextra/Makefile.am.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]