From: Alexandre Duret-Lutz Date: Wed, 11 Aug 2004 21:10:56 +0000 (+0000) Subject: Fix PR automake/432: X-Git-Tag: Release-1-9b~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056f345bcb5855e425f2fc5045ce9b3b09d65880;p=thirdparty%2Fautomake.git Fix PR automake/432: * lib/am/yacc.am [!%?MORE-THAN-ONE%]: Replace `#line's in y.tab.h too. * tests/yacc7.test: Check this. --- diff --git a/ChangeLog b/ChangeLog index f9b76ccb2..dbffa3555 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-08-11 Alexandre Duret-Lutz + + 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-08 Alexandre Duret-Lutz * lib/Automake/DisjConditions.pm (new): Precompute 'string' and 'conds' diff --git a/lib/am/yacc.am b/lib/am/yacc.am index 4655f0631..04d45572d 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, 2004 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 @@ -61,7 +62,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