Sun 21 Feb 2010 05:22:13 PM UTC, comment #6:
My use case is the following. I am integrating texi2html in texinfo. Basically I took the texi2html directory and put it in texinfo, and add texi2html to the SUBDIRS of the toplevel texinfo Makefile.am. But I also would like that using texi2html independently remains possible. Basically there is a configure.ac and a configure in the texi2html directory that is not used when built as part of texinfo, and is used when texi2html is stand-alone.
The layout is there fore like
texinfo/
texinfo/configure.ac
texinfo/texi2html/
texinfo/texi2html/configure.ac
texinfo/po
texinfo/texi2html/po_messages
If one wants to build texi2html as part of texinfo, one does
cd texinfo && autoreconf && ./configure
If one wants to build texi2html standalone, one goes in the texi2html directory and do
cd texinfo/texi2html && autoreconf && ./configure
Now I would like to avoid duplicating the .po files in the po directories of texinfo and texi2html. So in texinfo, there is a po directory where in POTFILES.in there are the texinfo files, and also the texi2html ones, like
info/footnotes.c
...
texi2html/texi2html.pl
...
Then in the texi2html directory there is a po directory (which is called po_messages), with, in POTFILES.in only the texi2html files:
texi2html.pl
...
Since the messages in texinfo are a superset of messages in texi2html, I would have liked to copy the .po (and maybe .gmo files) from the texinfo/po directory.
Then when doing make dist when building texinfo, I wouldn't do update-po in texi2html/po_messages but instead copy files from po/ to texi2html/po_messages and distribute the files and be done.
When doing make dist when building texi2html, everything would be as usual, .gmo would be regenerated from .po files in po_messages, and it would be transparent that the .po came from texinfo/po.
With this setup, make update-po in texi2html/po_messages fails because the paths are not right when doing make dist in texinfo. That's the reason why I wanted to conditionalize doing make update-po in texi2html/po_messages to being built from the texi2html configure, while still having files in texi2html/po_messages being distributed.
Here is my current solution to this issue.
Since it is not possible to avoid doing update-po in texi2html/po_messages when doing make dist from the toplevel texinfo directory, what I have done is used configure to set the right paths in the po directories, differently when running configure in texinfo or texi2html.
In texi2html/po_messages po_messages/POTFILES.in.in there is:
@t2h_po_dir@texi2html.pl
...
and in po_messages/Makevars.in:
# These two variables depend on the location of this directory.
subdir = @t2h_po_dir@po_messages
top_builddir = @t2h_po_top_builddir@
Then in texinfo configure.ac one the paths are set like:
t2h_po_dir='texi2html/'
AC_SUBST([t2h_po_dir])
t2h_po_top_builddir='../..'
AC_SUBST([t2h_po_top_builddir])
in texi2html configure.ac the paths are:
t2h_po_dir=
AC_SUBST([t2h_po_dir])
t2h_po_top_builddir='..'
AC_SUBST([t2h_po_top_builddir])
Therefore update-po is run in both directories but with the right paths (that are different when building texinfo and standalone texi2html).
(to be precise, there are in fact 2 po directories, po and po_document in texinfo and respectively po_messages and po_document in texi2html, but I don't think it is important).
Those changes will be commited in texinfo soon.
|