1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

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>
This commit is contained in:
Andrew Bartlett 2020-05-27 21:31:43 +12:00 committed by Douglas Bagnall
parent 8a148193da
commit c51c15144e
6 changed files with 6 additions and 6429 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,52 +2,14 @@
# rebuild our heimdal lex/yacc files. Run this manually if you update heimdal
lexfiles="heimdal/lib/asn1/lex.l heimdal/lib/hx509/sel-lex.l heimdal/lib/com_err/lex.l"
yaccfiles="heimdal/lib/asn1/asn1parse.y heimdal/lib/hx509/sel-gram.y heimdal/lib/com_err/parse.y"
set -e
LEX="lex"
YACC="yacc"
top=$PWD
call_lex() {
lfile="$1"
echo "Calling $LEX on $lfile"
dir=$(dirname $lfile)
base=$(basename $lfile .l)
cfile=$base".c"
lfile=$base".l"
cd $dir
# --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
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
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
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."
exit 1
fi
cd $top
}
call_yacc() {
yfile="$1"
@ -75,10 +37,6 @@ call_yacc() {
for lfile in $lexfiles; do
call_lex $lfile
done
for yfile in $yaccfiles; do
call_yacc $yfile
done

View File

@ -820,7 +820,7 @@ if not bld.CONFIG_SET("USING_SYSTEM_HX509"):
options="-q -P comment -p")
HEIMDAL_LIBRARY('hx509',
'lib/hx509/ca.c lib/hx509/cert.c lib/hx509/cms.c lib/hx509/collector.c lib/hx509/crypto.c lib/hx509/error.c lib/hx509/env.c lib/hx509/file.c lib/hx509/keyset.c lib/hx509/ks_dir.c lib/hx509/ks_file.c lib/hx509/ks_keychain.c lib/hx509/ks_mem.c lib/hx509/ks_null.c lib/hx509/ks_p11.c lib/hx509/ks_p12.c lib/hx509/lock.c lib/hx509/name.c lib/hx509/peer.c lib/hx509/print.c lib/hx509/req.c lib/hx509/revoke.c lib/hx509/sel.c lib/hx509/hx509_err.c lib/hx509/sel-lex.c lib/hx509/sel-gram.c',
'lib/hx509/ca.c lib/hx509/cert.c lib/hx509/cms.c lib/hx509/collector.c lib/hx509/crypto.c lib/hx509/error.c lib/hx509/env.c lib/hx509/file.c lib/hx509/keyset.c lib/hx509/ks_dir.c lib/hx509/ks_file.c lib/hx509/ks_keychain.c lib/hx509/ks_mem.c lib/hx509/ks_null.c lib/hx509/ks_p11.c lib/hx509/ks_p12.c lib/hx509/lock.c lib/hx509/name.c lib/hx509/peer.c lib/hx509/print.c lib/hx509/req.c lib/hx509/revoke.c lib/hx509/sel.c lib/hx509/hx509_err.c lib/hx509/sel-lex.l lib/hx509/sel-gram.c',
includes='../heimdal/lib/hx509',
deps='roken com_err asn1 hcrypto asn1 HEIMDAL_OCSP_ASN1 HEIMDAL_PKCS8_ASN1 HEIMDAL_PKCS9_ASN1 HEIMDAL_PKCS12_ASN1 HEIMDAL_PKCS10_ASN1 wind',
vnum='5.0.0',
@ -905,7 +905,7 @@ if not bld.CONFIG_SET('USING_SYSTEM_ASN1_COMPILE'):
'lib/asn1/gen_decode.c lib/asn1/gen_encode.c lib/asn1/gen_free.c '
'lib/asn1/gen_glue.c lib/asn1/gen_length.c lib/asn1/gen_seq.c '
'lib/asn1/gen_template.c lib/asn1/hash.c lib/asn1/symbol.c '
'lib/asn1/asn1parse.c lib/asn1/lex.c lib/asn1/main.c',
'lib/asn1/asn1parse.c lib/asn1/lex.l lib/asn1/main.c',
use_hostcc=True,
use_global_deps=False,
cflags='-DSOCKET_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
@ -919,7 +919,7 @@ if not bld.CONFIG_SET('USING_SYSTEM_ASN1_COMPILE'):
if not bld.CONFIG_SET('USING_SYSTEM_COMPILE_ET'):
HEIMDAL_BINARY('compile_et',
'lib/com_err/parse.c lib/com_err/lex.c lib/com_err/compile_et.c',
'lib/com_err/parse.c lib/com_err/lex.l lib/com_err/compile_et.c',
use_hostcc=True,
use_global_deps=False,
includes='../heimdal/lib/com_err',

View File

@ -371,6 +371,9 @@ def configure(conf):
msg="Checking compiler for full RELRO support"):
conf.env['ENABLE_RELRO'] = True
# #line statements in these generated files cause issues for lcov
conf.env.FLEXFLAGS += ["--noline"]
conf.SAMBA_CONFIG_H('include/config.h')
def etags(ctx):