From: Tom Tromey Date: Tue, 15 May 2001 02:21:54 +0000 (+0000) Subject: Fix for yaccvpath.test: X-Git-Tag: Release-1-4f~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be94280d5faa04be2d8f58a7670710c041cfc67;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 4eae378ab..8c10dfa61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-05-14 Tom Tromey + + 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 * automake.in ($IGNORE_PATTERN): Allow spaces before comments diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 34840ce47..3b11fc1d1 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -57,22 +57,27 @@ endif %?TOPDIR_P% ## @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 diff --git a/lib/am/yacc.am b/lib/am/yacc.am index 344fb9ecb..0d7e10531 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -21,8 +21,7 @@ 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; \ diff --git a/lib/ylwrap b/lib/ylwrap index c78cdd745..9ae6c0515 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -65,6 +65,9 @@ esac # 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 @@ -123,7 +126,7 @@ if test $status -eq 0; then # 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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 2c805f8fb..7fcbc0de8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = gnits -XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test +XFAIL_TESTS = texinfo10.test subdir5.test TESTS = \ acinclude.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 877dadc85..63537a2a1 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -74,7 +74,7 @@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = gnits -XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test +XFAIL_TESTS = texinfo10.test subdir5.test TESTS = \ acinclude.test \ @@ -453,7 +453,7 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) 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"; \ diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index d78ca4edc..04041fec1 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -66,7 +66,7 @@ cd sub sleep 2 # New parser, with `fubar' -cat > parse.y << 'END' +cat > ../parse.y << 'END' %{ int yylex () {return 0;} void yyerror (char *s) {} @@ -78,3 +78,24 @@ END $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