1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
samba-mirror/source4/heimdal_build/lexyacc.sh
Andrew Bartlett c51c15144e Compile .l files (flex) with the waf rule at runtime
Other parts of Samba already compile these directly.

This makes these files compile with modern compiler warnings.

The primary difference (other than being built with a newer
flex) is the loss of the #include "config.h" but
this is not used in the other .l files elsewehre and does not
seem to matter on modern systems.

The generated output from compile_et asn1_compile has not changed
(so I think the hx509 case is safe).

The mdssvc case just has changed file locations and line numbers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-08-07 03:23:44 +00:00

43 lines
835 B
Bash
Executable File

#!/bin/bash
# rebuild our heimdal lex/yacc files. Run this manually if you update heimdal
yaccfiles="heimdal/lib/asn1/asn1parse.y heimdal/lib/hx509/sel-gram.y heimdal/lib/com_err/parse.y"
set -e
YACC="yacc"
top=$PWD
call_yacc() {
yfile="$1"
echo "Calling $YACC on $yfile"
dir=$(dirname $yfile)
base=$(basename $yfile .y)
cfile=$base".c"
yfile=$base".y"
cd $dir
# -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
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."
exit 1
fi
cd $top
}
for yfile in $yaccfiles; do
call_yacc $yfile
done