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 501107 - EXTRA_DIST automake warnings
EXTRA_DIST automake warnings
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal minor
: 1.16
Assigned To: gtk-doc maintainers
gtk-doc maintainers
: 499167 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-02 20:26 UTC by Xan Lopez
Modified: 2010-06-10 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Only set EXTRA_DIST if not defined (358 bytes, patch)
2009-05-30 12:16 UTC, Björn Lindqvist
rejected Details | Review

Description Xan Lopez 2007-12-02 20:26:28 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.
Comment 1 Behdad Esfahbod 2007-12-04 00:44:11 UTC
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)

Comment 2 Tim Janik 2007-12-04 09:32:34 UTC
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.
Comment 3 Matthias Clasen 2007-12-07 06:32:24 UTC
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. 
Comment 4 Matthias Clasen 2007-12-07 06:36:37 UTC
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
Comment 5 Behdad Esfahbod 2007-12-07 06:59:23 UTC
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.
Comment 6 Tim Janik 2007-12-07 07:18:14 UTC
(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.
Comment 7 Behdad Esfahbod 2007-12-07 07:23:28 UTC
Sorry.  Not touching it.

/me goes studying Makefile.decl
Comment 8 Matthias Clasen 2008-05-18 23:03:54 UTC
*** Bug 499997 has been marked as a duplicate of this bug. ***
Comment 9 Matthias Clasen 2008-08-17 01:44:27 UTC
*** Bug 499167 has been marked as a duplicate of this bug. ***
Comment 10 Björn Lindqvist 2009-05-30 12:16:00 UTC
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.
Comment 11 Björn Lindqvist 2009-05-30 17:04:53 UTC
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.
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2009-05-30 18:16:10 UTC
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?
Comment 13 Björn Lindqvist 2009-05-30 22:47:12 UTC
(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.


Comment 14 Stefan Sauer (gstreamer, gtkdoc dev) 2009-05-31 18:38:37 UTC
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?
Comment 15 Matthias Clasen 2009-05-31 22:35:58 UTC
We put version.xml.in in EXTRA_DIST. version.xml is in content_files, but it is generated.
Comment 16 Stefan Sauer (gstreamer, gtkdoc dev) 2010-04-14 06:55:54 UTC
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.
Comment 17 Matthias Clasen 2010-06-03 17:32:42 UTC
> What I could offer is a flavour of the makefile that uses EXTRA_DIST+=.

If we can have that, that would be great.
Comment 18 Stefan Sauer (gstreamer, gtkdoc dev) 2010-06-10 11:24:34 UTC
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.