After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 312217 - intltool.m4 doesn't work with AM_GNU_GETTEXT
intltool.m4 doesn't work with AM_GNU_GETTEXT
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
unspecified
Other All
: Normal minor
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on: 311870
Blocks:
 
 
Reported: 2005-08-01 10:12 UTC by Stepan Kasal
Modified: 2005-11-24 20:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (3.90 KB, patch)
2005-08-02 10:00 UTC, Stepan Kasal
none Details | Review
fixed patch (4.00 KB, patch)
2005-09-01 10:55 UTC, Stepan Kasal
committed Details | Review
fix the vpath build (745 bytes, patch)
2005-09-21 12:11 UTC, Stepan Kasal
committed Details | Review

Description Stepan Kasal 2005-08-01 10:12:59 UTC
intltool.m4 macros don't cooperate well with m4 macros delivered with GNU
gettext 0.10.38 and newer. (I use GNU gettext 0.14.5.)

Steps to reproduce:
# check out gnome-icon-theme
cd gnome-icon-theme
mv configure.in configure.bkp
sed 's/AM_GLIB_GNU_GETTEXT/AM_GNU_GETTEXT([external])/;/^po.Makefile.in/d'
configure.bkp >configure.in
./autogen.sh
make

The "make" fails in subdirectory po/.

To see the reason, type:
   grep type: po/Makefile
the intltool tags

(This bug is still present in current CVS, which contains the patch to fix bug
#171330.)
Comment 1 Stepan Kasal 2005-08-02 10:00:15 UTC
Created attachment 50116 [details] [review]
the patch

The problem was in the interaction between gettext macros and IT_PROG_INTLTOOL.
This patch fixes it.

Moreover, it has the following advantages:

1) It introduces macro IT_PO_SUBDIR, which can be called separately. In the
future, this will help projects with multiple po directories, like the Gnumeric
spreadsheet. (GNU gettext supports multiple po directories since 0.10.38.)

2) The sed script to create POTFILES is now only in intltool.m4. 
Makefile.in.in no longer has a copy of it, thus things like bug #171330 will
not happen again.

Apply by "patch -p1", after applying the patch for bug #311870.
Comment 2 Stepan Kasal 2005-08-02 10:04:14 UTC
When I patched and reinstalled intltool, the above procedure gave a clean build,
which then passed "make distcheck".
Comment 3 Stepan Kasal 2005-09-01 10:55:10 UTC
Created attachment 51651 [details] [review]
fixed patch

I fixed a bug in the stamp-it rule in Makefile.in.in and regenerated the patch
against CVS HEAD.

OK to commit?
Comment 4 Christian Persch 2005-09-21 11:03:30 UTC
The patch certainly is an improvement, but I'm still unable to use intltool
together with AM_GNU_GETTEXT in Epiphany: make dist fails with tons of messages
like this:
cp: cannot stat `../../po/../../po/am.po': No such file or directory
(in a builddir != srcdir build, which works with AM_GLIB_GNU_GETTEXT)

Oh and there seems to be a problem with generating files in po/, POTFILES &
Makefile are created twice:

config.status: executing intltool commands
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing default-2 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
Comment 5 Christian Persch 2005-09-21 11:09:18 UTC
The diff between latest gettext (0.14.5) and intltool's Makefile.in.in is rather
large. Among the changes is a change to install directory for the catalogues:
gettext now always installs them in $(datadir)/locale while intltool still uses
$(datadir)/locale and $(libdir)/locale depending on whether the extension is
.gmo or not.
Comment 6 Stepan Kasal 2005-09-21 12:09:09 UTC
Thank you Christian for testing this.  Regarding your problems:

> cp: cannot stat `../../po/../../po/am.po': No such file or directory

The problem is that with modern Gettext, POFILES contains things like
$(srcdir)/xy.po .
With the ancient glib-gettext.m4, you get only "xy.po", without the prefix.

To be compatible with both, intltool has to adjust the "dist" rule, see the
patch below.

> config.status: executing default-1 commands
> config.status: creating po/POTFILES
> config.status: creating po/Makefile
> config.status: executing default-2 commands
> config.status: creating po/POTFILES
> config.status: creating po/Makefile

It looks as if AM_GNU_GETTEXT were called twice.  Could you please try to look
at it?

> [GNU] gettext now always installs [catalogues] in $(datadir)/locale while
> intltool still uses $(datadir)/locale and $(libdir)/locale depending on
> whether the extension is .gmo or not.

Yes, that is probably dead code.  But you could remove it only if you removed
the check for CATOBJEXT from glib-gettext.m4 .

I don't want to waste time patching glib-gettext.m4; I think we should first
make intltool compatible with GNU gettext, and then drop the whole glib-gettext.
(AM_GLIB_GNU_GETTEXT will then become an alias for AM_GNU_GETTEXT.)

> The diff between latest gettext (0.14.5) and intltool's Makefile.in.in is
> rather large.

Yes, it is.  It will take a lot of work to make them more similar.  Even then,
the intltool one will have to have some backward compatibility quirks (like the
patch for two forms of POFILES or for CATOBJEXT variants, both discussed above).

... and a year or two after glib-gettext is nuked we might be able to drop
intltool/Makefile.in.in and rely on the one provided by gettext.

... but by that time, at 2009, Makefile.in.in will be deprecated, because
Automake will be able to handle the po directory correctly.  So we'll actually
drop our Makefile.in.in to gain compatibility with Automake 1.14.

So it's really a long time run.  But we should start now, so we have a change to
catch up.
Comment 7 Stepan Kasal 2005-09-21 12:11:29 UTC
Created attachment 52454 [details] [review]
fix the vpath build

This patch fixes two problems for srcdir != builddir.  (The second one was
reported by Christian Persch, see above.)
Comment 8 Christian Persch 2005-09-21 12:47:10 UTC
Thanks, the additional patch (attachment.cgi 52454) fixes "make dist" for me.

>> config.status: executing default-1 commands
>> config.status: creating po/POTFILES
>> config.status: creating po/Makefile
>> config.status: executing default-2 commands
>> config.status: creating po/POTFILES
>> config.status: creating po/Makefile
>
>It looks as if AM_GNU_GETTEXT were called twice.  Could you please try to look
>at it?

No, I only use AM_GNU_GETTEXT once. It came from AM_PO_SUBDIRS([po]); apparently
it already uses that by default. Removing it fixed the problem.

>> [GNU] gettext now always installs [catalogues] in $(datadir)/locale while
>> intltool still uses $(datadir)/locale and $(libdir)/locale depending on
>> whether the extension is .gmo or not.
>
>Yes, that is probably dead code.  But you could remove it only if you removed
>the check for CATOBJEXT from glib-gettext.m4 .

The problem is that you need to know the install directory, to call
bindtextdomain with it. glib-gettext has AM_GLIB_DEFINE_LOCALEDIR which takes
that into account...
Comment 9 Stepan Kasal 2005-09-21 14:20:05 UTC
Yes AM_GNU_GETTEXT calls AM_PO_SUBDIRS([po]) and it is documented.
It was a mistake to call it explicitly.

About CATOBJEXT: I think it is reasonable to suppose that the old branch is
never used, ie. that CATALOGS always contains *.gmo files.

(But if you want to remove the .mo alternative from intltool, you have to remove
it from glib-gettext.m4 first.)
Comment 10 Rodney Dawes 2005-11-24 20:38:50 UTC
I've committed the minor srcdir/builddir patch. Looking at the other patch now.
Comment 11 Rodney Dawes 2005-11-24 20:54:52 UTC
Committed the gnu gettext patching to cvs.