+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'
## 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
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 ;\
#! /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.
#
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";
%%
$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