automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 0/2] Bugfix w.r.t. $(AM_LFLAGS)/$(LFLAGS) and $(AM_YFLAGS)/$(


From: Ralf Wildenhues
Subject: Re: [PATCH 0/2] Bugfix w.r.t. $(AM_LFLAGS)/$(LFLAGS) and $(AM_YFLAGS)/$(YFLAGS) precedence.
Date: Mon, 21 Jun 2010 21:12:47 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hi Stefano,

I'm falling more and more behind on patches, it seems.

* Stefano Lattarini wrote on Sat, May 01, 2010 at 10:33:46AM CEST:
> The Automake manual states in:
>   
> http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
> (and the good sense dictates) that all the flags specified in a $(FOOFLAGS)
> variable take precedence over the flags specified in the corresponding
> $(AM_FOOFLAGS) variable (or in any per-target $(maude_FOOFLAGS) variable).
> However, with current Automake, this is not the case for $(LFLAGS) and
> $(YFLAGS).
> 
> The patches in this series fix this.  The first patch introduces some tests
> that fail with current Automake; the second one fixes the Lex&Yacc language
> registration so that the tests passes (it turns out that a simple four-line
> change in automake.in is enough).
> 
> I personally prefer to keep these two patches as separate commits; but if
> you'd prefer to squash them togheter, please do so: it's no big deal.

It's fine to have them as separate patches.  I'm putting them in a new
branch off of maint, and adding the following patch below to fix a
couple of nits in them.  I'm merging the branch to master for now,
might merge to branch-1.11 later as well, I'm not quite sure yet.

So far I've been appending items to NEWS in the relevant sub-section,
unless there is a reason for putting things together.  The approach of
adding on top, as is done for ChangeLog, might be more git
merge-friendly, I don't know.

Thanks!
Ralf

    Fix minor testsuite issues, update docs, for yacc/lex changes.
    
    * doc/automake.texi (Yacc and Lex): Mention AM_YFLAGS, YFLAGS
    and AM_LFLAGS, LFLAGS in the order in which they now appear in
    the rules.
    * NEWS: Update.
    * tests/lflags.test, tests/lflags2.test, tests/yflags.test,
    tests/yflags2.test: Prefer `make -e' over `make VAR=VAL', to
    please maintainer-check.  Ensure generated C files contain a
    declaration, to please compilers.

diff --git a/NEWS b/NEWS
index 4a0fa94..b8a0f08 100644
--- a/NEWS
+++ b/NEWS
@@ -21,11 +21,6 @@ Bugs fixed in 1.11.0a:
 
 * Long standing bugs:
 
-  - Automake variables $(AM_LFLAGS) and $(AM_YFLAGS) took precedence over
-    user variables $(FLAGS) and $(YFLAGS) (respectively).  This was in
-    contrast with both reasonable user's expectations and the Automake
-    manual; so the precedence is now the other way round.
-
   - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Python'
     even if the `--prefix' argument pointed outside of a system directory.
     AM_PATH_PYTHON has been fixed to ignore the value returned from python's
@@ -43,6 +38,10 @@ Bugs fixed in 1.11.0a:
 
   - A per-Makefile.am setting of -Werror does not carry over to the
     handling of other Makefile.am files any more.
+
+  - The order of Yacc and Lex flags is fixed to be consistent with other
+    languages: $(AM_YFLAGS) comes before $(YFLAGS), and $(AM_LFLAGS) before
+    $(LFLAGS), so that the user variables override the developer variables.
 
 New in 1.11:
 
diff --git a/doc/automake.texi b/doc/automake.texi
index 2bf3291..ea500a9 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6029,8 +6029,8 @@ Program Checks, autoconf, The Autoconf Manual}).
 
 @vindex YFLAGS
 @vindex AM_YFLAGS
-When @code{yacc} is invoked, it is passed @code{YFLAGS} and
address@hidden  The former is a user variable and the latter is
+When @code{yacc} is invoked, it is passed @code{AM_YFLAGS} and
address@hidden  The latter is a user variable and the former is
 intended for the @file{Makefile.am} author.
 
 @code{AM_YFLAGS} is usually used to pass the @option{-d} option to
@@ -6058,8 +6058,8 @@ autoconf, The Autoconf Manual}), but using 
@code{AM_PROG_LEX} macro
 
 @vindex LFLAGS
 @vindex AM_LFLAGS
-When @command{lex} is invoked, it is passed @code{LFLAGS} and
address@hidden  The former is a user variable and the latter is
+When @command{lex} is invoked, it is passed @code{AM_LFLAGS} and
address@hidden  The latter is a user variable and the former is
 intended for the @file{Makefile.am} author.
 
 When @code{AM_MAINTAINER_MODE} (@pxref{maintainer-mode}) is used, the
diff --git a/tests/lflags.test b/tests/lflags.test
index 5027f1c..97de608 100755
--- a/tests/lflags.test
+++ b/tests/lflags.test
@@ -26,6 +26,7 @@ set -e
 cat >fake-lex <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >lex.yy.c
+echo 'extern int dummy;' >> lex.yy.c
 END
 chmod a+x fake-lex
 
@@ -58,7 +59,7 @@ echo 'int main(void){ return 0; }' > main.c
 
 $AUTOCONF
 ./configure
-$MAKE LFLAGS=__user_flags__
+env LFLAGS=__user_flags__ $MAKE -e
 
 ls -l
 
diff --git a/tests/lflags2.test b/tests/lflags2.test
index e50678e..df766b2 100755
--- a/tests/lflags2.test
+++ b/tests/lflags2.test
@@ -27,6 +27,7 @@ set -e
 cat >fake-lex <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >lex.yy.c
+echo 'extern int dummy;' >> lex.yy.c
 END
 chmod a+x fake-lex
 
@@ -59,7 +60,7 @@ echo 'int main(void) { return 0; }' > main.cc
 
 $AUTOCONF
 ./configure
-$MAKE LFLAGS=__user_flags__
+env LFLAGS=__user_flags__ $MAKE -e
 
 ls -l
 
diff --git a/tests/yflags.test b/tests/yflags.test
index d7d3fca..fcb0c64 100755
--- a/tests/yflags.test
+++ b/tests/yflags.test
@@ -26,6 +26,7 @@ set -e
 cat >fake-yacc <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >y.tab.c
+echo 'extern int dummy;' >> y.tab.c
 END
 chmod a+x fake-yacc
 
@@ -56,7 +57,7 @@ echo 'int main(void){ return 0; }' > main.c
 
 $AUTOCONF
 ./configure
-$MAKE YFLAGS=__user_flags__
+env YFLAGS=__user_flags__ $MAKE -e
 
 ls -l
 
diff --git a/tests/yflags2.test b/tests/yflags2.test
index 5d5be1c..346c2e4 100755
--- a/tests/yflags2.test
+++ b/tests/yflags2.test
@@ -27,6 +27,7 @@ set -e
 cat >fake-yacc <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >y.tab.c
+echo 'extern int dummy;' >> y.tab.c
 END
 chmod a+x fake-yacc
 
@@ -57,7 +58,7 @@ echo 'int main(void) { return 0; }' > main.cc
 
 $AUTOCONF
 ./configure
-$MAKE YFLAGS=__user_flags__
+env YFLAGS=__user_flags__ $MAKE -e
 
 ls -l
 



reply via email to

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