···11+From 48f7e6d66e2850088b8922024641173776222242 Mon Sep 17 00:00:00 2001
22+From: Nick Cao <nickcao@nichi.co>
33+Date: Thu, 21 Nov 2024 15:30:00 -0500
44+Subject: [PATCH] build: find pre-built heimdal build tools in case of embedded
55+ heimdal
66+77+This patch fixes the case of finding asn1_compile and compile_et for
88+building embedded heimdal, by setting
99+--bundled-libraries='!asn1_compile,!compile_et' as configure flags.
1010+1111+The Heimdal build tools compile_et and asn1_compile are needed *only*
1212+if we use the embedded heimdal (otherwise we don't build heimdal and
1313+use headers that have been generated by those tools elsewhere).
1414+1515+For cross-compilation with embedded heimdal, it is vital to use host build
1616+tools, and so asn1_compile and compile_et must be supplied and not
1717+built. One way of doing this would be to set the COMPILE_ET and
1818+ASN1_COMPILE env vars to the location of supplied binaries. Another way,
1919+which is more commonly used, is to exclude asn1_compile and compile_et
2020+from bundled packages via the switch
2121+-bundled-libraries='!asn1_compile,!compile_et'. When this is done,
2222+the build script searches the path for those tools and sets the
2323+ASN1_COMPILE and COMPILE_ET vars accordingly. (this is admittedly
2424+kind of a round-about way of doing things but this has become the
2525+de-facto standard amongst embedded distro builders).
2626+2727+In commit 8061983d4882f3ba3f12da71443b035d7b672eec, this process of
2828+finding the binaris has been moved to be carried out only in the
2929+system heimdal case. As explained above, we only need these tools,
3030+and hence the check, in bundled mode.
3131+3232+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14164
3333+3434+Signed-off-by: Uri Simchoni <uri@samba.org>
3535+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
3636+[Bachp: rebased for version 4.15.0]
3737+[Mats: rebased for version 4.18.5]
3838+---
3939+ wscript_configure_embedded_heimdal | 11 +++++++++++
4040+ 1 file changed, 11 insertions(+)
4141+4242+diff --git a/wscript_configure_embedded_heimdal b/wscript_configure_embedded_heimdal
4343+index 45f47721de..6c5a4bcf01 100644
4444+--- a/wscript_configure_embedded_heimdal
4545++++ b/wscript_configure_embedded_heimdal
4646+@@ -13,3 +13,14 @@ conf.RECURSE('third_party/heimdal_build')
4747+ # when this will be available also in
4848+ # system libraries...
4949+ conf.define('HAVE_CLIENT_GSS_C_CHANNEL_BOUND_FLAG', 1)
5050++
5151++def check_system_heimdal_binary(name):
5252++ if conf.LIB_MAY_BE_BUNDLED(name):
5353++ return False
5454++ if not conf.find_program(name, var=name.upper()):
5555++ return False
5656++ conf.define('USING_SYSTEM_%s' % name.upper(), 1)
5757++ return True
5858++
5959++check_system_heimdal_binary("compile_et")
6060++check_system_heimdal_binary("asn1_compile")
6161+--
6262+2.47.0
6363+