summaryrefslogtreecommitdiff
path: root/source4/heimdal_build
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2021-03-30 09:39:00 +1300
committerAndrew Bartlett <abartlet@samba.org>2021-04-28 03:43:34 +0000
commite45980ff5de27b4558e7dfe0ce4c7af39d9c8b6b (patch)
treef9e5ae8a89d15f4ce54e50c3bce951d873070fdf /source4/heimdal_build
parentc2c09113e5598ae87dcf470cb85aaf1a62d03ba4 (diff)
downloadsamba-e45980ff5de27b4558e7dfe0ce4c7af39d9c8b6b.tar.gz
build: Use bison at build time rather than lexyacc.sh to build the embedded heimdal
Because the filenames are changed to the *.tab.{h,c} format a transitional header is added. While the built compilers differ, the output of the compilers and the resulting .o files have been verified not to have changed on Ubuntu 20.04. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source4/heimdal_build')
-rw-r--r--source4/heimdal_build/asn1parse.h1
-rwxr-xr-xsource4/heimdal_build/lexyacc.sh42
-rw-r--r--source4/heimdal_build/parse.h1
-rw-r--r--source4/heimdal_build/sel-gram.h1
-rw-r--r--source4/heimdal_build/wscript_build9
-rw-r--r--source4/heimdal_build/wscript_configure6
6 files changed, 14 insertions, 46 deletions
diff --git a/source4/heimdal_build/asn1parse.h b/source4/heimdal_build/asn1parse.h
new file mode 100644
index 00000000000..9e43df34248
--- /dev/null
+++ b/source4/heimdal_build/asn1parse.h
@@ -0,0 +1 @@
+#include "asn1parse.tab.h"
diff --git a/source4/heimdal_build/lexyacc.sh b/source4/heimdal_build/lexyacc.sh
deleted file mode 100755
index 087caac20c7..00000000000
--- a/source4/heimdal_build/lexyacc.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/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
diff --git a/source4/heimdal_build/parse.h b/source4/heimdal_build/parse.h
new file mode 100644
index 00000000000..1456fe0488a
--- /dev/null
+++ b/source4/heimdal_build/parse.h
@@ -0,0 +1 @@
+#include "parse.tab.h"
diff --git a/source4/heimdal_build/sel-gram.h b/source4/heimdal_build/sel-gram.h
new file mode 100644
index 00000000000..bae5fc00044
--- /dev/null
+++ b/source4/heimdal_build/sel-gram.h
@@ -0,0 +1 @@
+#include "sel-gram.tab.h"
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index 10bf2687d23..3d1464b12c4 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -286,7 +286,8 @@ def HEIMDAL_SUBSYSTEM(modname, source,
bld.env.HEIMDAL_PICKY_CFLAGS
else:
samba_cflags = CURRENT_CFLAGS(bld, modname, cflags,
- allow_warnings=True)
+ allow_warnings=True) + \
+ bld.env.HEIMDAL_UNPICKY_WNO_STRICT_OVERFLOW_CFLAGS
return bld(
features = 'c',
@@ -825,7 +826,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.l 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.y',
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',
@@ -910,7 +911,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.l lib/asn1/main.c',
+ 'lib/asn1/asn1parse.y lib/asn1/lex.l lib/asn1/main.c',
use_hostcc=True,
use_global_deps=False,
includes='../heimdal/lib/asn1',
@@ -923,7 +924,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.l lib/com_err/compile_et.c',
+ 'lib/com_err/parse.y lib/com_err/lex.l lib/com_err/compile_et.c',
use_hostcc=True,
use_global_deps=False,
includes='../heimdal/lib/com_err',
diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure
index 3a3d245d2bb..049ea27b5d5 100644
--- a/source4/heimdal_build/wscript_configure
+++ b/source4/heimdal_build/wscript_configure
@@ -82,6 +82,12 @@ for flag in heimdal_no_error_flags:
if len(bld.env.HEIMDAL_PICKY_CFLAGS) == len(heimdal_no_error_flags):
conf.env.enable_heimdal_warnings = True
+else:
+ # Needed on CentOS 7 and Ubuntu 16.04 only for Bison generated
+ # files when we are not doing strict warnings -> errors
+ conf.ADD_NAMED_CFLAGS('HEIMDAL_UNPICKY_WNO_STRICT_OVERFLOW_CFLAGS',
+ '-Wno-strict-overflow',
+ testflags=True)
conf.DEFINE('SAMBA4_USES_HEIMDAL', 1)