]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix PR automake/432:
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 11 Aug 2004 21:10:56 +0000 (21:10 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 11 Aug 2004 21:10:56 +0000 (21:10 +0000)
* lib/am/yacc.am [!%?MORE-THAN-ONE%]: Replace `#line's in y.tab.h too.
* tests/yacc7.test: Check this.

ChangeLog
lib/am/yacc.am
tests/yacc7.test

index f9b76ccb2799efccd231370b044593b51912f50c..dbffa3555d08704d803ef5470a790bb18664c004 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-08  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/Automake/DisjConditions.pm (new): Precompute 'string' and 'conds'
index 4655f06312d45f54f0b139503c7c5a2a301bd6b4..04d45572d3aa9b097fce40b8f02ae9f521daba1f 100644 (file)
@@ -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 ;\
index e183139a95e863cd551da26af86e0ebb316098df..a187fda7d2a977aec9873b8440afb994d6ba3392 100755 (executable)
@@ -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