[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Replace `#line's in y.tab.h too (PR/423)
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: Replace `#line's in y.tab.h too (PR/423) |
Date: |
Wed, 11 Aug 2004 23:10:42 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
I'm checking this in on HEAD and branch-1-8.
(Yet another reason to kill !%?MORE-THAN-ONE% and always use
ylwrap, which does it right already.)
2004-08-11 Alexandre Duret-Lutz <address@hidden>
Fix PR automake/432:
* lib/am/yacc.am [!%?MORE-THAN-ONE%]: Replace `#line's in y.tab.h too.
* tests/yacc7.test: Check this.
Index: lib/am/yacc.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/yacc.am,v
retrieving revision 1.18
diff -u -r1.18 yacc.am
--- lib/am/yacc.am 28 Jul 2004 19:58:37 -0000 1.18
+++ lib/am/yacc.am 11 Aug 2004 21:08:21 -0000
@@ -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 @@
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: tests/yacc7.test
===================================================================
RCS file: /cvs/automake/automake/tests/yacc7.test,v
retrieving revision 1.14
diff -u -r1.14 yacc7.test
--- tests/yacc7.test 14 Nov 2003 21:26:01 -0000 1.14
+++ tests/yacc7.test 11 Aug 2004 21:08:21 -0000
@@ -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 @@
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 @@
$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
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Replace `#line's in y.tab.h too (PR/423),
Alexandre Duret-Lutz <=