Hi! If Automake is used in non-recursive mode and one of the inputs is a yacc file, for example, src/grammar.y, ylwrap will remove too many directories from the output file when it adjusts the paths in it. This results in #line directives referring to grammar.y instead of src/grammar.y.
This is a result of input_rx simply taking all the directory components of the absolute input path and removing them. One solution is to store the path passed to ylwrap and replace input_rx with it: --- build/ylwrap.old 2012-05-10 13:59:19.495291713 +0200 +++ build/ylwrap 2012-05-10 13:59:24.579351693 +0200 @@ -67,6 +67,8 @@ # The input. input="$1" shift +input_orgdir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` +input_sub=`echo "$input_orgdir" | sed 's,\\\\,\\\\\\\\,g'` case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. @@ -175,7 +177,7 @@ -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," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. I’m sure that there’s a much better way of doing this, but this seems to work.