- Several inefficiencies and poor performances in the implementation
of the parallel-tests 'check' and 'recheck' targets have been fixed.
+ - The post-processing of output "#line" directives done the ylwrap
+ script is more faithful w.r.t. files in a subdirectory; for example,
+ if the processed file is "src/grammar.y", ylwrap will correctly
+ produce directives like:
+ #line 7 "src/grammar.y"
+ rather than like
+ #line 7 "grammar.y"
+ as it did before.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.12:
Nicolas Thiery nthiery@Icare.mines.edu
NightStrike nightstrike@gmail.com
Nik A. Melchior nam1@cse.wustl.edu
+Nikolai Weibull now@bitwi.se
NISHIDA Keisuke knishida@nn.iij4u.or.jp
Noah Friedman friedman@gnu.ai.mit.edu
Norman Gray norman@astro.gla.ac.uk
;;
esac
+get_dirname ()
+{
+ case $1 in
+ */*|*\\*) printf '%s\n' "$1" | sed -e 's,\([\\/]\)[^\\/]*$,\1,';;
+ # Otherwise, we want the empty string (not ".").
+ esac
+}
+
+quote_for_sed ()
+{
+ # FIXME: really we should care about more than '.' and '\'.
+ sed -e 's,[\\.],\\&,g'
+}
# The input.
input="$1"
shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
case "$input" in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
y_tab_nodot="yes"
fi
- # The directory holding the input.
- input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
- # Quote $INPUT_DIR so we can use it in a regexp.
- # FIXME: really we should care about more than '.' and '\'.
- input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+ input_rx=`get_dirname "$input" | quote_for_sed`
while test "$#" -ne 0; do
from="$1"
realtarget="$target"
target="tmp-`echo $target | sed s/.*[\\/]//g`"
fi
- # Edit out '#line' or '#' directives.
- #
+ # Munge "#line" or "#" directives.
# We don't want the resulting debug information to point at
- # an absolute srcdir; it is better for it to just mention the
- # .y file with no path.
- #
+ # an absolute srcdir.
# We want to use the real output file name, not yy.lex.c for
# instance.
- #
# We want the include guards to be adjusted too.
FROM=`echo "$from" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
- sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+ sed -e "/^#/!b" -e "s,$input_rx,$input_sub_rx," -e "s,$from,$2," \
-e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
# Check whether header files must be updated.
# For debugging,
ls -l . sub sub/dir
- $FGREP '.l' $c_outputs
+ $EGREP 'line|\.l' $c_outputs
- # Adjusted "#line" should not contain reference to the builddir.
- $EGREP '#.*line.*(build|\.\.).*\.l' $c_outputs && Exit 1
+ grep '#.*line.*build.*\.l' $c_outputs && Exit 1
+ # Adjusted "#line" should not contain reference to the absolute
+ # srcdir.
+ $EGREP '#.*line *"?/.*\.l' $c_outputs && Exit 1
# Adjusted "#line" should not contain reference to the default
# output file names, e.g., 'lex.yy.c'.
- $EGREP '#.*line.*lex\.yy' $c_outputs && Exit 1
- # Don't be excessively strict in grepping, to avoid spurious failures.
- grep '#.*line.*zardoz\.l' zardoz.c
- grep '#.*line.*quux\.l' bar-quux.c
- grep '#.*line.*zardoz\.l' sub/foo-zardoz.c
- grep '#.*line.*quux\.l' sub/dir/quux.c
+ grep '#.*line.*lex\.yy' $c_outputs && Exit 1
+ # Look out for a silly regression.
+ grep "#.*\.l.*\.l" $c_outputs && Exit 1
+ if $vpath; then
+ grep '#.*line.*"\.\./zardoz\.l"' zardoz.c
+ grep '#.*line.*"\.\./dir/quux\.l"' bar-quux.c
+ grep '#.*line.*"\.\./\.\./sub/zardoz\.l"' sub/foo-zardoz.c
+ grep '#.*line.*"\.\./\.\./sub/dir/quux\.l"' sub/dir/quux.c
+ else
+ grep '#.*line.*"zardoz\.l"' zardoz.c
+ grep '#.*line.*"dir/quux\.l"' bar-quux.c
+ grep '#.*line.*"zardoz\.l"' sub/foo-zardoz.c
+ grep '#.*line.*"dir/quux\.l"' sub/dir/quux.c
+ fi
+
cd $srcdir
done
# For debugging,
ls -l . sub sub/dir
- $FGREP '.y' $c_outputs
+ $EGREP 'line|\.y' $c_outputs
# Adjusted "#line" should not contain reference to the builddir.
- $EGREP '#.*line.*(build|\.\.).*\.y' $c_outputs && Exit 1
+ grep '#.*line.*build.*\.y' $c_outputs && Exit 1
+ # Adjusted "#line" should not contain reference to the absolute
+ # srcdir.
+ $EGREP '#.*line *"?/.*\.y' $c_outputs && Exit 1
# Adjusted "#line" should not contain reference to the default
# output file names, e.g., 'y.tab.c' and 'y.tab.h'.
- $EGREP '#.*line.*y\.tab\.' $c_outputs && Exit 1
- # Don't be excessively strict in grepping, to avoid spurious failures.
- grep '#.*line.*zardoz\.y' zardoz.c
- grep '#.*line.*quux\.y' bar-quux.c
- grep '#.*line.*zardoz\.y' sub/foo-zardoz.c
- grep '#.*line.*quux\.y' sub/dir/quux.c
+ grep '#.*line.*y\.tab\.' $c_outputs && Exit 1
+ # Look out for a silly regression.
+ grep "#.*\.y.*\.y" $c_outputs && Exit 1
+ if $vpath; then
+ grep '#.*line.*"\.\./zardoz\.y"' zardoz.c
+ grep '#.*line.*"\.\./dir/quux\.y"' bar-quux.c
+ grep '#.*line.*"\.\./\.\./sub/zardoz\.y"' sub/foo-zardoz.c
+ grep '#.*line.*"\.\./\.\./sub/dir/quux\.y"' sub/dir/quux.c
+ else
+ grep '#.*line.*"zardoz\.y"' zardoz.c
+ grep '#.*line.*"dir/quux\.y"' bar-quux.c
+ grep '#.*line.*"zardoz\.y"' sub/foo-zardoz.c
+ grep '#.*line.*"dir/quux\.y"' sub/dir/quux.c
+ fi
+
cd $srcdir
done