* tests/Makefile.am (XFAIL_TESTS): Removed yaccvpath.test.
* lib/am/distdir.am (distdir): Always look for file in build
directory first.
* lib/ylwrap: Quote the `#line' regular expression.
* lib/am/yacc.am (%YACC_SUFFIX%%C_SUFFIX%): Reverted earlier
change; don't run sed on the generated file.
* tests/yaccvpath.test: Create new parser in srcdir. Added test
to make sure parser will be rebuilt at dist time.
+2001-05-14 Tom Tromey <tromey@redhat.com>
+
+ Fix for yaccvpath.test:
+ * tests/Makefile.am (XFAIL_TESTS): Removed yaccvpath.test.
+ * lib/am/distdir.am (distdir): Always look for file in build
+ directory first.
+ * lib/ylwrap: Quote the `#line' regular expression.
+ * lib/am/yacc.am (%YACC_SUFFIX%%C_SUFFIX%): Reverted earlier
+ change; don't run sed on the generated file.
+ * tests/yaccvpath.test: Create new parser in srcdir. Added test
+ to make sure parser will be rebuilt at dist time.
+
2001-05-13 Pavel Roskin <proski@gnu.org>
* automake.in ($IGNORE_PATTERN): Allow spaces before comments
##
@for file in $(DISTFILES); do \
##
-## In loop, test for file existence because sometimes a file gets
-## included in DISTFILES twice. For example this happens when a single
-## source file is used in building more than one program. Also, there
-## are situations in which "ln" can fail. For instance a file to
-## distribute could actually be a cross-filesystem symlink -- this can
-## easily happen if "gettextize" was run on the distribution.
+## Always look for the file in the build directory first. That way
+## for something like yacc output we will correctly pick up the latest
+## version.
+##
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
##
-?CYGNUS? if test -f $$file; then d=.; else d=$(srcdir); fi; \
-?!CYGNUS? d=$(srcdir); \
## Make the subdirectory for the file. This is going to make `dist'
## really crawl, but it seems like the only way to do it, given that
## files in subdirectories can be specified for `dist' conditionally.
+##
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
+##
+## In loop, test for file existence because sometimes a file gets
+## included in DISTFILES twice. For example this happens when a single
+## source file is used in building more than one program. Also, there
+## are situations in which "ln" can fail. For instance a file to
+## distribute could actually be a cross-filesystem symlink -- this can
+## easily happen if "gettextize" was run on the distribution.
##
if test -d $$d/$$file; then \
## Don't mention $$file in destination argument, since this fails if
if %?YLWRAP%
$(SHELL) $(YLWRAP) $(YACC) $< y.tab.c $*%C_SUFFIX% y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS)
else !%?YLWRAP%
- $(YACC) $(AM_YFLAGS) $(YFLAGS) $<
- sed -e '/^#/ s,$(srcdir)/,,' y.tab.c > $*%C_SUFFIX%
+ $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*%C_SUFFIX%
if test -f y.tab.h; then \
if cmp -s y.tab.h $*.h; then \
rm -f y.tab.h; \
# The directory holding the input.
input_dir="`echo $input | sed -e 's,/[^/]*$,,'`"
+# Quote $INPUT_DIR so we can use it in a regexp.
+# FIXME: really we should care about more than `.'.
+input_rx="`echo $input_dir | sed -e 's,.,\.,g'`"
pairlist=
while test "$#" -ne 0; do
# resulting debug information to point at an absolute srcdir;
# it is better for it to just mention the .y file with no
# path.
- sed -e "/^#/ s,$input_dir,," "$from" > "$target" || status=$?
+ sed -e "/^#/ s,$input_rx,," "$from" > "$target" || status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d
AUTOMAKE_OPTIONS = gnits
-XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test
+XFAIL_TESTS = texinfo10.test subdir5.test
TESTS = \
acinclude.test \
AUTOMAKE_OPTIONS = gnits
-XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test
+XFAIL_TESTS = texinfo10.test subdir5.test
TESTS = \
acinclude.test \
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
sleep 2
# New parser, with `fubar'
-cat > parse.y << 'END'
+cat > ../parse.y << 'END'
%{
int yylex () {return 0;}
void yyerror (char *s) {}
$MAKE
$MAKE distdir
grep fubar foo-0.1/parse.c
+
+#
+# Now check to make sure that `make dist' will rebuild the parser.
+#
+
+# A delay is needed to make sure that the new parse.y is indeed newer
+# than parse.c, i.e. the they don't have the same timestamp.
+sleep 2
+
+# New parser, with `maude'
+cat > ../parse.y << 'END'
+%{
+int yylex () {return 0;}
+void yyerror (char *s) {}
+%}
+%%
+maude : 'm' 'a' 'u' 'd' 'e' {};
+END
+
+$MAKE distdir
+grep maude foo-0.1/parse.c