GNOME Bugzilla – Bug 501107
EXTRA_DIST automake warnings
Last modified: 2010-06-10 11:24:34 UTC
This commit: 2007-11-21 21:06:47 Tim Janik <timj@imendio.com> * Makefile.decl: initialize automake variables EXTRA_DIST and TEST_PROGS for unconditional appending via += in other makefiles. define recursive test targets: test, test-report, perf-report, full-report, as described here: http://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00000.html (...) makes my automake (1.9) unhappy: niraikanai:~/git/glib%sh autogen.sh I am going to run ./configure with no arguments - if you wish to pass any to it, please specify them on the autogen.sh command line. gtk-doc.make:24: EXTRA_DIST multiply defined in condition TRUE ... docs/reference/gio/Makefile.am:87: `gtk-doc.make' included from here Makefile.decl:7: ... `EXTRA_DIST' previously defined here docs/reference/gio/Makefile.am:1: `Makefile.decl' included from here gtk-doc.make:24: EXTRA_DIST multiply defined in condition TRUE ... docs/reference/glib/Makefile.am:70: `gtk-doc.make' included from here Makefile.decl:7: ... `EXTRA_DIST' previously defined here docs/reference/glib/Makefile.am:2: `Makefile.decl' included from here gtk-doc.make:24: EXTRA_DIST multiply defined in condition TRUE ... docs/reference/gobject/Makefile.am:57: `gtk-doc.make' included from here Makefile.decl:7: ... `EXTRA_DIST' previously defined here docs/reference/gobject/Makefile.am:2: `Makefile.decl' included from here gio/Makefile.am:250: EXTRA_DIST multiply defined in condition TRUE ... Makefile.decl:7: ... `EXTRA_DIST' previously defined here gio/Makefile.am:1: `Makefile.decl' included from here glib/gnulib/Makefile.am:22: EXTRA_DIST multiply defined in condition TRUE ... Makefile.decl:7: ... `EXTRA_DIST' previously defined here glib/gnulib/Makefile.am:2: `Makefile.decl' included from here Just reporting in case it does not happen in Tim's/other maintainters boxes.
I fixed two of those. The remaining ones are redefined by gtk-doc.make and out of glib's control. Not sure how to fix them. 2007-12-03 Behdad Esfahbod <behdad@gnome.org> * glib/gnulib/Makefile.am: Fix EXTRA_DIST automake warnings. (#501107)
it's really gtk-doc.make that needs to be fixed here. not sure that can be done backwards compatibly though, if not, we'll have to live with the warnings for a while.
Yeah, probably. The warnings are ugly, but not the end of the world. IMO, none of these included makefile fragments has any business defining "standard" variables like EXTRA_DIST.
one way to fix it compatibly might be to rename gtk-doc.make to gtk-doc2.make and add a gtk-doc.make that just does EXTRA_DIST= include gtk-doc2.make
Well, Makefile fragments can't reliably append to EXTRA_DIST without either assuming that it's already defined, or that it's not. gtk-doc.make assume the latter. Easier would be to move most of Makefile.decl to Makefile.decl2 and add Makefile.decl that does: EXTRA_DIST= include Makefile.decl2 then make doc Makefiles include Makefile.decl2 instead of Makefile.decl. Not sure how your suggestion is supposed to work, but this one should. I'll go ahead and do it.
(In reply to comment #5) > Well, Makefile fragments can't reliably append to EXTRA_DIST without either > assuming that it's already defined, or that it's not. gtk-doc.make assume the > latter. Easier would be to move most of Makefile.decl to Makefile.decl2 and > add Makefile.decl that does: > > EXTRA_DIST= > include Makefile.decl2 > > then make doc Makefiles include Makefile.decl2 instead of Makefile.decl. this is not at all easier. Makefile.decl is something that'll be needed in lots of projects soon that want proper testing support (because it implements new recursive rules). splitting it off into two files to work around a gtk-doc bug would be fixing this in the wrong place and complicate possibly lots of projects. also, with Makefile.decl being the first thing included in all Makefiles, it is the canonical place to predefine variables and then allow every other makefile to append to those variables. this is for instance pasting a portion of the Makefile.decl used in beast: # declare variables that we might want to use += on. INCLUDES= EXTRA_HEADERS= MAINTAINERCLEANFILES=$(GENERATED) CLEANFILES=$(GENERATED_CLEANFILES) GENERATED_EXTRA_DIST= GENERATED_CLEANFILES= GENERATED=$(strip $(GENERATED_EXTRA_DIST) $(GENERATED_CLEANFILES)) EXTRA_DIST=$(GENERATED_EXTRA_DIST) > Not sure how your suggestion is supposed to work, but this one should. I'll > go ahead and do it. no, don't do that. this really needs to be fixed in gtk-doc, probably like matthias suggested it.
Sorry. Not touching it. /me goes studying Makefile.decl
*** Bug 499997 has been marked as a duplicate of this bug. ***
*** Bug 499167 has been marked as a duplicate of this bug. ***
Created attachment 135609 [details] [review] Only set EXTRA_DIST if not defined Possible fix to make automake stop complaining. gtkdoc only sets EXTRA_DIST if it isn't defined.
Patch is stupid and doesn't work. Matthias solution sounds best, or if automake could be fixed to handle appending to undefined variables that would work too.
Whats the main problem here. Stuff in a doc dir should belong to the doc build. So the actual Makefile.am should not need to deal with EXTRA_DIST. It can use content_files and HTML_IMAGES vars to add extra files. Also which is the proposed fix now?
(In reply to comment #12) > Whats the main problem here. Stuff in a doc dir should belong to the doc build. > So the actual Makefile.am should not need to deal with EXTRA_DIST. It can use > content_files and HTML_IMAGES vars to add extra files. > > Also which is the proposed fix now? The main problem is, if I understand it correctly, line 26 in gtk-doc.make: EXTRA_DIST = \ EXTRA_DIST is used by automake to add extra files to be included in the tarball when running "make dist." But gtk+ and other projects also sets the EXTRA_DIST variable because they also have extra files they want to dist. Then gtk-doc.make is included and sets it again, overwriting the old EXTRA_DIST definition and triggers the warning. The automake language is no way to check if a variable is defined or not, so it must guess whether it is or isn't, like Behdad said. In gtk's case, gtk-doc.make guesses wrong and overwrites EXTRA_DIST. gtk-doc could instead append using the += operator but that produces an undefined variable error for projects that does not set EXTRA_DIST. For backwards compatibility reasons, that can't be done. In Mattias solution, gtk-doc.make is renamed to gtk-doc2.make and the EXTRA_DIST= statement changed to EXTRA_DIST+=. gtk-doc.make would set EXTRA_DIST and include gtk-doc2.make. Projects would be encouraged to use gtk-doc2.make and fix their Makefile.am's but could still use gtk-doc.make which would be deprecated. If I understand correctly, that is. A second alternative would be to fix automake so that it can use the += operator on undefined variables. If that could happen then gtk-doc.make could be fixed without breaking compatibility.
Björn, people should use content_files and/or HTML_IMAGES for EXTRA_DIST in a subdir that contains the gtk-doc build. This has always been so. Is gtk now having different stuff there which is unrelated to api-docs?
We put version.xml.in in EXTRA_DIST. version.xml is in content_files, but it is generated.
What I could offer is a flavour of the makefile that uses EXTRA_DIST+=. In addition to gtk-doc.make and gtk-doc.notmpl.make, we would also have gtk-doc.notmpl.nonrecursive.make. I would not like to also add gtk-doc.nonrecursive.make. So this would only help gtk once the deprecated tmpl files are exterminated.
> What I could offer is a flavour of the makefile that uses EXTRA_DIST+=. If we can have that, that would be great.
commit 8716ce6972ce7444a28496c0782c8c0facb6aed3 Author: Stefan Kost <ensonic@users.sf.net> Date: Thu Jun 10 14:21:02 2010 +0300 makefiles: add two flavours for flat makefiles. Fixes #501107 When using non recursive Makefile, we currently get warnings aboutr EXTRA_DIST being overridden. Make variants of the makefiles that use EXTRA_DIST += instead.