1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

heimdal_build: omit #line statments

This restores and finishes my original commit
80e23c68d8, reverted in
68c61a829b

    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
This commit is contained in:
Andrew Bartlett 2012-02-10 08:49:05 +11:00
parent c38ba53677
commit 11c5301491

View File

@ -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."