printing: Avoid zombies in the background daemon
[Samba.git] / source4 / heimdal_build / lexyacc.sh
blob087caac20c7aa54e620a6ca99f52d2fc43e48afa
1 #!/bin/bash
3 # rebuild our heimdal lex/yacc files. Run this manually if you update heimdal
5 yaccfiles="heimdal/lib/asn1/asn1parse.y heimdal/lib/hx509/sel-gram.y heimdal/lib/com_err/parse.y"
7 set -e
9 YACC="yacc"
11 top=$PWD
13 call_yacc() {
14 yfile="$1"
16 echo "Calling $YACC on $yfile"
18 dir=$(dirname $yfile)
19 base=$(basename $yfile .y)
20 cfile=$base".c"
21 yfile=$base".y"
23 cd $dir
25 # -l specified because line directives cause more bother than they solve (issues with lcov finding the source files)
26 $YACC -l -d $yfile || exit 1
27 if [ -r y.tab.h -a -r y.tab.c ];then
28 cat y.tab.h > $base.h
29 cat y.tab.c > $base.c
30 rm -f y.tab.c y.tab.h
31 elif [ ! -r $base.h -a ! -r $base.c]; then
32 echo "$base.h nor $base.c generated."
33 exit 1
35 cd $top
40 for yfile in $yaccfiles; do
41 call_yacc $yfile
42 done