Use upstream gettext instead the glib one

Some people asked me about this, so here a fast tutorial:
Replace this in your configure.ac:

AM_GLIB_GNU_GETTEXT

with this:

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])

You can see an example in this commit: [1]

Now the theory: gettext has two different utilities: autopoint and gettextize. Here the different purposes of these programs:

  • autopoint [2] Copies the gettext infrastructure that has been omitted from version control.
  • gettextize [3] The `gettextize’ program is an interactive tool that helps the maintainer of a package internationalized through GNU `gettext’. … As a migration tool, for upgrading the GNU `gettext’ support in a package from a previous to a newer version of GNU `gettext’.

So, you should only use autopoint in your autogen.sh file. Only the maintainer should call the gettextize program.
Fortunately, autopoint is automatically called in both gnome-autogen.sh and autoreconf, so no need to change your autogen.sh file.

Note that autopoint needs the AM_GNU_GETTEXT_VERSION() macro to know the version of gettext files you want tou use, because it copies the infrastructure files belonging to this version into the package. ie, AM_GNU_GETTEXT_VERSION([0.17]) means exactly 0.17, not 0.17 and above.

Why we use glib-gettextize then? Well, as far as I know It’s mainly for historical reasons: autopoint was not added until version 0.11 of gettext. However, GNOME did not require gettext version 0.11 those days, so it would had been premature to rely on that script. That is not a problem anymore.

There is also a bug to deprecate the Glib gettext macros: [4]

[1] http://git.gnome.org/browse/giggle/diff/configure.ac?id=7eb32e8d39c382b3bd8a670198b77cbc844c60a7
[2] http://www.gnu.org/software/gettext/manual/gettext.html#autopoint-Invocation
[3] http://www.gnu.org/software/gettext/manual/gettext.html#index-gettextize-1117
[4] https://bugzilla.gnome.org/show_bug.cgi?id=624186


Flattr this

4 thoughts on “Use upstream gettext instead the glib one”

  1. The exact version requirement of AM_GNU_GETTEXT_VERSION kind of concerns me. What happens if you don’t have that exact gettext version installed? I have gettext 0.18 installed on my Fedora 14 machine, so does that mean the gettext 0.17 requirement you added to Evolution’s configure.ac is already out of date?

  2. @Matthew:

    Nope, AM_GNU_GETTEXT_VERSION only specifies the version of the infraestructure gettext files you want to use (Remember, It’s the info used by autopoint to generate the infraestructure files).
    For example, you can have gettext 0.18 installed but use the 0.16 version in the infrestructure files if you have AM_GNU_GETTEXT_VERSION([0.16]) in your configure.ac.
    In this case, the minimal gettext version to compile your program would be gettext 0.16

Comments are closed.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>