On Thu, 4 Jul 2002, Allan Rae wrote:

[...]
> Again, I see no need for lyx.pot or POTFILES* to be in CVS.  Please
> enlighten me if I've missed something.
>
> (Although as I said in my last email srcdir!=builddir is now getting
> to be a problem because the generated form_*.[Ch] files are in
> builddir which isn't currently scanned by the POTFILES.in
> autogeneration -- and if we add that then we will start getting
> thrashing of the POTFILES.in that is stored in CVS (depending upon
> peoples builddir preference -- on top of any sort order problem that
> may still exist), hence my suggestion we could go to manual
> POTFILES.in and use $builddir in that file to get around this problem
> (although it is only a moderate nuisance IMO))

Actually things are *much* worse than I thought they were.

Why?

Because a manual build of POTFILES.in won't work either.

Why?

Because gettext.m4 insists on prepending "$top_srcdir/" to each of the
lines in POTFILES.in when it creates POTFILES.

Why is this bad?

Because you can't use builddir != srcdir even with a manually
maintained POTFILES.in because we don't know the path from top_srcdir
to top_builddir in order to access the generated files.

Is there a solution?

Actually, yes.  The last few words of the previous comment provide the
key.  If all our generated code was put in $srcdir instead of
$builddir then we can continue to use the existing automatic
maintenance of POTFILES.in without any hassles (except for a one line
deletion I mentioned in an earlier email).  And if Lars really really
wants manual maintenance of POTFILES.in then that would also have
a chance of working.

So then.  Does anyone have a problem with putting the generated source
code (namely the XForms and Qt stuff) into $srcdir instead of
$builddir?  If so, you better figure out how to make POTFILES work.

In the meantime I offer the attached patch as an interim solution --
note that it will only ensure POTFILES.in is correct.  Gettext won't
be able to find the generated files in if builddir != srcdir so people
building that way are slightly screwed but it shouldn't be too
painful.  It does however also have the one line fix that is required.

Allan. (ARRae)

P.S.  For you smarty-pants out there, there is a possible second
solution that involves manually maintaining the POTFILES.in and
hacking gettext.m4 such that it doesn't prepend everything in
POTFILES.in -- then we need to use the string "$(builddir)/" in
POTFILES.in for the files that are generated into the builddir. Too
much screwing around and hence too error-prone IMO -- and I'm not sure
even sure it would work.  Much simpler to just generate the xforms and
Qt sources into srcdir instead.

? src/frontends/qt2/xforms/Makefile.in
Index: po/Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.in.in
--- po/Makefile.in.in   16 Apr 2002 21:59:01 -0000      1.20
+++ po/Makefile.in.in   18 Jul 2002 02:06:03 -0000
@@ -196,13 +196,16 @@ Makefile: Makefile.in.in $(top_builddir)
               $(SHELL) ./config.status
 
 ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
+       @if [ "$(top_srcdir)" != "$(top_builddir)" ]; then \
+           echo "POTFILES.in would be incorrectly rebuilt because srcdir != 
+builddir"; \
+       else \
        rm -f $@-t \
        && ( cd $(top_srcdir); \
             grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
-            sed -e '/xforms.forms/d' | \
             sort -f -n | uniq ) > $@-t \
        && echo "src/ext_l10n.h" >> $@-t \
-       && mv $@-t $@
+       && mv $@-t $@ ;\
+       fi
 
 $(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/layouts/*.layout 
$(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/ui/default.ui 
$(top_srcdir)/lib/languages
        sed < $(top_srcdir)/lib/ui/default.ui -n \

Reply via email to