GNU bug report logs - #35526
misleading documentation about flag variable ordering

Previous Next

Package: automake;

Reported by: Daniel Kahn Gillmor <dkg <at> fifthhorseman.net>

Date: Wed, 1 May 2019 17:34:01 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 35526 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: dkg <at> fifthhorseman.net
Cc: 35526 <at> debbugs.gnu.org
Subject: Re: bug#35526: misleading documentation about flag variable ordering
Date: Tue, 9 Feb 2021 19:23:13 -0700
Back on this bug from May 2019 (https://bugs.gnu.org/35526).
Sorry for the delay.

    The implication here is that for any of the *FLAGS variables, later
    options are inherently more effective than earlier options.
    This is not the case universally.  

Granted. After reading the messages here, here's the change to the
manual I came up with. If any comments before I commit it, let me know.
Thanks. --karl

--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -12491,16 +12491,21 @@ make
 @end example
 
 The reason @samp{$(CPPFLAGS)} appears after @samp{$(AM_CPPFLAGS)} or
-@samp{$(mumble_CPPFLAGS)} in the compile command is that users
-should always have the last say.  It probably makes more sense if you
-think about it while looking at the @samp{CXXFLAGS=-O0} above, which
-should supersede any other switch from @code{AM_CXXFLAGS} or
-@code{mumble_CXXFLAGS} (and this of course replaces the previous value
-of @code{CXXFLAGS}).
-
-You should never redefine a user variable such as @code{CPPFLAGS} in
-@file{Makefile.am}.  Use @samp{automake -Woverride} to diagnose such
-mistakes.  Even something like
+@samp{$(mumble_CPPFLAGS)} in the compile command is that users should
+have the last say.  In the example above, the desire is for the
+@samp{CXXFLAGS=-O0} to supersede any other switch from
+@code{AM_CXXFLAGS} or @code{mumble_CXXFLAGS}.
+
+@c https://bugs.gnu.org/35526
+It's true that not all options to all programs can be overridden.  So
+in general, users could conceivably want to place options at arbitrary
+places in the command line, but Automake does not support this.  It
+would be difficult to make such generality comprehensible.  Being able
+to specify the final options commonly suffices.
+
+Thus, you should never redefine a user variable such as
+@code{CPPFLAGS} in @file{Makefile.am}.  Use @samp{automake -Woverride}
+to diagnose such mistakes.  Even something like
 
 @example
 CPPFLAGS = -DDATADIR=\"$(datadir)\" @@CPPFLAGS@@

compile finished at Tue Feb  9 18:20:52 2021




This bug report was last modified 4 years and 95 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.