automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFLAGS is a user variable...


From: Alexandre Duret-Lutz
Subject: Re: CFLAGS is a user variable...
Date: 22 Sep 2002 16:33:53 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Harlan" == Harlan Stenn <address@hidden> writes:

[...]

 Harlan> (I have tried to find a small test case which
 Harlan> demonstrates this problem but have not yet been able to
 Harlan> do so.)

Thanks, I could reproduce this using `CFLAGS += foo' in a
Makefile.am.  I'm installing the appended patch to correct this.

 Harlan> As I'm still cleaning up nits found by these newer
 Harlan> releases of automake and autoconf I can't tell which of
 Harlan> the messages I'm seeing is causing autoreconf to fail.

This one is just a warning, it does't change Automake's exit status.

 Harlan> I think I would like a way to tell autoreconf that it
 Harlan> should warn (and not bail) on previously undetected
 Harlan> nits.  This should not be the default, but it would
 Harlan> help a lot in making sure that testing new releases of
 Harlan> automake and autoconf yielded a "useful" result, before
 Harlan> imposing possibly backward incompatible cleanup to a
 Harlan> project.

The current policy is that any warning that is not easy to fix
in a way which is backward compatible with Automake 1.6 should
be disabled by default.  This is the reason why `-Wportability'
is off by default.  In 1.8 we can turn -Wportability on because
people who don't care about portability issue can just say
`-Wno-portability' and it will work fine with 1.7 too.

This said, the concept of "warning" is new in Automake 1.7.
Previous versions produced only errors, and it's likely there
are still many error messages we ought to change into warnings.

2002-09-22  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (macro_define): Update a variable's location each
        time its owner is updated.
        * tests/gnuwarn.test: Append to CFLAGS to check for this.
        Reported by Harlan Stenn.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1359
diff -u -r1.1359 automake.in
--- automake.in 19 Sep 2002 08:59:48 -0000      1.1359
+++ automake.in 22 Sep 2002 14:32:00 -0000
@@ -6392,6 +6392,10 @@
        || $owner > $var_owner{$var}{$cond}))
     {
       $var_owner{$var}{$cond} = $owner;
+      # Always adjust the location when the owner changes (even for
+      # `+=' statements).  The risk otherwise is to warn about
+      # a VAR_MAKEFILE variable and locate it in configure.ac...
+      $var_location{$var}{$cond} = $where;
     }
 
   # Call var_VAR_trigger if it's defined.
Index: tests/gnuwarn.test
===================================================================
RCS file: /cvs/automake/automake/tests/gnuwarn.test,v
retrieving revision 1.2
diff -u -r1.2 gnuwarn.test
--- tests/gnuwarn.test  8 Sep 2002 13:07:55 -0000       1.2
+++ tests/gnuwarn.test  22 Sep 2002 14:32:23 -0000
@@ -36,7 +36,7 @@
 : > ChangeLog
 
 cat > Makefile.am << 'END'
-CFLAGS = -I..
+CFLAGS += -I..
 LDFLAGS = -lfoo
 CXXFLAGS = -Wall
 bin_PROGRAMS = bar
@@ -48,8 +48,8 @@
 # Warn in gnu mode
 $AUTOMAKE -Wnone  --add-missing --gnu 2>stderr && exit 1
 cat stderr
-grep CFLAGS stderr
-grep LDFLAGS stderr
+grep 'Makefile.am:1:.*CFLAGS' stderr
+grep 'Makefile.am:2:.*LDFLAGS' stderr
 # No reason to warn about CXXFLAGS since it's not used.
 grep CXXFLAGS stderr && exit 1
 # Don't warn if -Wno-gnu.

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]