diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2004-08-11 21:11:10 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2004-08-11 21:11:10 +0000 |
commit | dd70c8b5ecdc967edf239be312ce05274121d51a (patch) | |
tree | 141763789cad3710d45cc4d0215ecaad7dde97ad | |
parent | ae550cf7e89e4c36001861b0bf41ac5ce5c8479a (diff) | |
download | automake-dd70c8b5ecdc967edf239be312ce05274121d51a.tar.gz |
Fix PR automake/432:
* lib/am/yacc.am [!%?MORE-THAN-ONE%]: Replace `#line's in y.tab.h too.
* tests/yacc7.test: Check this.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/am/yacc.am | 6 | ||||
-rwxr-xr-x | tests/yacc7.test | 11 |
3 files changed, 20 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2004-08-11 Alexandre Duret-Lutz <adl@gnu.org> + + Fix PR automake/432: + * lib/am/yacc.am [!%?MORE-THAN-ONE%]: Replace `#line's in y.tab.h too. + * tests/yacc7.test: Check this. + 2004-08-03 Alexandre Duret-Lutz <adl@gnu.org> * automake.in (yacc_lex_finish_helper): Fix definition of YLWRAP diff --git a/lib/am/yacc.am b/lib/am/yacc.am index cc799c49a..71cc8401d 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -1,5 +1,6 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 +## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -33,7 +34,8 @@ else !%?MORE-THAN-ONE% to=`echo "%BASE%_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ - sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >%BASE%.ht; \ + sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|%BASE%.h|" \ + y.tab.h >%BASE%.ht; \ rm -f y.tab.h; \ if cmp -s %BASE%.ht %BASE%.h; then \ rm -f %BASE%.ht ;\ diff --git a/tests/yacc7.test b/tests/yacc7.test index e183139a9..a187fda7d 100755 --- a/tests/yacc7.test +++ b/tests/yacc7.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -44,7 +44,13 @@ check-dist: distdir test -f $(distdir)/foo.h END +# The %union will cause Bison to output `#line's in y.tab.h too. cat > foo.y << 'END' +%union +{ + int i; + char c; +} %% WORD: "up"; %% @@ -70,6 +76,9 @@ rm -f foo.h $MAKE foo.h test -f foo.h +# Make sure `#line ... y.tab.h' gets replaced. +$FGREP 'y.tab.h' foo.h && exit 1 + # Make distclean must not erase foo.c nor foo.h (by GNU standards) ... $MAKE foo.c test -f foo.h |