GNOME Bugzilla – Bug 409060
Hardcodes OMF files location to be below $(srcdir) / Does not permit out of tree builds with .omf.in files
Last modified: 2012-08-01 22:17:16 UTC
Hi, omf.make hardcodes $(srcdir) in the path to omf files; this prevents building modules such as gtk-doc out-of-tree (builddir != srcdir) because the OMF files are AC_SUBSTed to set the @VERSION@. (See bug 315320 for this particular build failure of gtk-doc.) I'm going to attach a patch trying to scrollkeeper-preinstall files in the current builddir (.) and falling back to $(srcdir) when these are missing. Bye,
Created attachment 82754 [details] [review] Fix out of tree builds of generated files with omf.make
Created attachment 82909 [details] [review] Fix out of tree builds of generated files with omf.make (take 2) Hmm, there was a missing ";" in the first patch; here's a fixed patch which also fixes another instance of a similar problem which I discovered when building gnome-panel.
omf_timestamp: $(omffile) -for file in $(omffile); do \ - scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \ + absfile=$(srcdir)/$$file; \ + test -r $$file && absfile=$$file; \ + scrollkeeper-preinstall $(docdir)/$(docname).xml $$absfile $$file.out; \ done; \ Couldn't that be done more simply by for file in $^; do \ scrollkeeper-preinstall $(docdir)/$(docname).xml $$file $$file.out; \ done (and the same on install-data-hook-omf ) ?
(In reply to comment #3) > for file in $^; do \ > scrollkeeper-preinstall $(docdir)/$(docname).xml $$file $$file.out; \ > done It's easier to read for sure! The two questions I see are: - Would $file be correctly located both when in srcdir and when in builddir? - Is $^ a GNU Make extension?
I haven't actually tested this :) but I think it will work correctly wherever the srcdir is. Does $$file.out need the whole path, or just the basename ? The make info documentation doesn't say anything about $^ being a GNU extension, but and a quick google search didn't reveal anything either...
(In reply to comment #5) > I haven't actually tested this :) but I think it will work correctly wherever > the srcdir is. Does $$file.out need the whole path, or just the basename ? I think $file.out should always be from basename since it must be in builddir.
It could use $$(basename $$file).out then (not sure about the $-quoting). Care to try? :)
Loïc, did you have a chance to try this?
*** Bug 505534 has been marked as a duplicate of this bug. ***
Comment on attachment 82909 [details] [review] Fix out of tree builds of generated files with omf.make (take 2) Pushed to master as commit 960b1bde8d156f61340500a260402264c5320603, thanks.