From: Akim Demaille Date: Sat, 14 Jul 2012 14:57:02 +0000 (+0200) Subject: ylwrap: fix C++ support for Bison X-Git-Tag: v1.12.3~43^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa10457919d195957bae104cce6be8ccebd53347;p=thirdparty%2Fautomake.git ylwrap: fix C++ support for Bison Fixes automake bug#7648. The current logic of ylwrap is to call yacc in a sub directory, and pull out of it all the files that were requested on its command line. Reverse this approach: export *all* the files created in the subdirectory, but rename them according to what the command says. This way, extra files, such as position.hh, location.hh and stack.hh for C++ parsers, but also parser.xml or parser.dot if XML or Dot output is enabled, will be preserved. * lib/ylwrap (pairlist): Remove. (main loop): Don't loop over pairlist, but over the files in the temporary directory. * t/list-of-tests.mk (XFAIL_TESTS): Fixes t/yacc-bison-skeleton-cxx.sh. * THANKS (James Bostock): Add, he reported bug#7648. Signed-off-by: Stefano Lattarini --- diff --git a/THANKS b/THANKS index afdd33a72..ca95db802 100644 --- a/THANKS +++ b/THANKS @@ -150,6 +150,7 @@ Imacat imacat@mail.imacat.idv.tw Inoue inoue@ainet.or.jp Jack Kelly jack@jackkelly.name James Amundson amundson@users.sourceforge.net +James Bostock james.bostock@gmail.com James Henstridge james@daa.com.au James R. Van Zandt jrv@vanzandt.mv.com James Youngman jay@gnu.org diff --git a/lib/ylwrap b/lib/ylwrap index 30e8a6c68..49116e5fd 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -1,7 +1,7 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2012-07-13.14; # UTC +scriptversion=2012-07-14.08; # UTC # Copyright (C) 1996-2012 Free Software Foundation, Inc. # @@ -121,8 +121,6 @@ fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 -# The list of file to rename: FROM TO... -pairlist= # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. @@ -143,7 +141,6 @@ while test "$#" -ne 0; do shift to=$1 shift - pairlist="$pairlist $from $to" rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;" done @@ -175,11 +172,9 @@ esac ret=$? if test $ret -eq 0; then - set X $pairlist - shift - while test "$#" -ne 0; do - from=$1 - to=$2 + for from in * + do + to=`printf '%s\n' "$from" | sed "$rename_sed"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. @@ -225,8 +220,6 @@ if test $ret -eq 0; then ret=1 fi fi - shift - shift done else ret=$? diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 9f0e12319..a0209d41e 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -30,7 +30,6 @@ t/pm/Version3.pl XFAIL_TESTS = \ t/all.sh \ -t/yacc-bison-skeleton-cxx.sh \ t/cond17.sh \ t/gcj6.sh \ t/override-conditional-2.sh \