From 11c530149113c50a24079ec58c2d99299b7df295 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 10 Feb 2012 08:49:05 +1100 Subject: heimdal_build: omit #line statments This restores and finishes my original commit 80e23c68d83a7c9989f87d5a88a78bb76d222afc, reverted in 68c61a829b8487104483b23052b54c532fecb6ce heimdal_build omit #line statments to allow valgrind to work again This time however, the reason to omit line statements is that it causes more trouble with the lcov code coverage system than the (nil) value that these statements bring. Otherwise, we have to have a special case to remove the .gcno and .gcda files for these generated files. Andrew Bartlett --- source4/heimdal_build/lexyacc.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source4/heimdal_build/lexyacc.sh b/source4/heimdal_build/lexyacc.sh index eb6314ad96..00fe7a4bdd 100755 --- a/source4/heimdal_build/lexyacc.sh +++ b/source4/heimdal_build/lexyacc.sh @@ -24,20 +24,21 @@ call_lex() { cd $dir - $LEX $lfile || exit 1 + # --noline specified because line directives cause more bother than they solve (issues with lcov finding the source files) + $LEX --noline $lfile || exit 1 if [ -r lex.yy.c ]; then echo "#include \"config.h\"" > $base.c - sed -e "s|lex\.yy\.c|$cfile|" lex.yy.c >> $base.c + grep -v "^#line" lex.yy.c >> $base.c rm -f $base.yy.c elif [ -r $base.yy.c ]; then echo "#include \"config.h\"" > $base.c - sed -e "s|$base\.yy\.c|$cfile|" $base.yy.c >> $base.c + grep -v "^#line" $base.yy.c >> $base.c rm -f $base.yy.c elif [ -r $base.c ]; then mv $base.c $base.c.tmp echo "#include \"config.h\"" > $base.c - sed -e "s|$base\.yy\.c|$cfile|" $base.c.tmp >> $base.c + grep -v "^#line" $base.c.tmp >> $base.c rm -f $base.c.tmp elif [ ! -r base.c ]; then echo "$base.c nor $base.yy.c nor lex.yy.c generated." @@ -59,10 +60,11 @@ call_yacc() { cd $dir - $YACC -d $yfile || exit 1 + # -l specified because line directives cause more bother than they solve (issues with lcov finding the source files) + $YACC -l -d $yfile || exit 1 if [ -r y.tab.h -a -r y.tab.c ];then - sed -e "/^#/!b" -e "s|y\.tab\.h|$cfile|" -e "s|\"$base.y|\"$cfile|" y.tab.h > $base.h - sed -e "s|y\.tab\.c|$cfile|" -e "s|\"$base.y|\"$cfile|" y.tab.c > $base.c + cat y.tab.h > $base.h + cat y.tab.c > $base.c rm -f y.tab.c y.tab.h elif [ ! -r $base.h -a ! -r $base.c]; then echo "$base.h nor $base.c generated." -- cgit