1*4882a593SmuzhiyunFrom e002d2ef2688d5433d2bd03aa4d77a0ec5ac4e63 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Uri Simchoni <uri@samba.org>
3*4882a593SmuzhiyunDate: Sun, 20 Oct 2019 00:03:14 +0300
4*4882a593SmuzhiyunSubject: [PATCH] build: find pre-built heimdal build tools in case of embedded
5*4882a593Smuzhiyun heimdal
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunThis patch fixes the case of finding asn1_compile and compile_et for
8*4882a593Smuzhiyunbuilding embedded heimdal, by setting
9*4882a593Smuzhiyun--bundled-libraries='!asn1_compile,!compile_et' as configure flags.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunThe Heimdal build tools compile_et and asn1_compile are needed *only*
12*4882a593Smuzhiyunif we use the embedded heimdal (otherwise we don't build heimdal and
13*4882a593Smuzhiyunuse headers that have been generated by those tools elsewhere).
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunFor cross-compilation with embedded heimdal, it is vital to use host build
16*4882a593Smuzhiyuntools, and so asn1_compile and compile_et must be supplied and not
17*4882a593Smuzhiyunbuilt. One way of doing this would be to set the COMPILE_ET and
18*4882a593SmuzhiyunASN1_COMPILE env vars to the location of supplied binaries. Another way,
19*4882a593Smuzhiyunwhich is more commonly used, is to exclude asn1_compile and compile_et
20*4882a593Smuzhiyunfrom bundled packages via the switch
21*4882a593Smuzhiyun-bundled-libraries='!asn1_compile,!compile_et'. When this is done,
22*4882a593Smuzhiyunthe build script searches the path for those tools and sets the
23*4882a593SmuzhiyunASN1_COMPILE and COMPILE_ET vars accordingly. (this is admittedly
24*4882a593Smuzhiyunkind of a round-about way of doing things but this has become the
25*4882a593Smuzhiyunde-facto standard amongst embedded distro builders).
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunIn commit 8061983d4882f3ba3f12da71443b035d7b672eec, this process of
28*4882a593Smuzhiyunfinding the binaris has been moved to be carried out only in the
29*4882a593Smuzhiyunsystem heimdal case. As explained above, we only need these tools,
30*4882a593Smuzhiyunand hence the check, in bundled mode.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunBUG: https://bugzilla.samba.org/show_bug.cgi?id=14164
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunSigned-off-by: Uri Simchoni <uri@samba.org>
35*4882a593SmuzhiyunSigned-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
36*4882a593Smuzhiyun[Bernd: rebased for version 4.11.13]
37*4882a593Smuzhiyun---
38*4882a593Smuzhiyun wscript_configure_embedded_heimdal | 11 +++++++++++
39*4882a593Smuzhiyun wscript_configure_system_heimdal   | 11 -----------
40*4882a593Smuzhiyun 2 files changed, 11 insertions(+), 11 deletions(-)
41*4882a593Smuzhiyun
42*4882a593Smuzhiyundiff --git a/wscript_configure_embedded_heimdal b/wscript_configure_embedded_heimdal
43*4882a593Smuzhiyunindex 8c55ae2a938..4fdae8062c5 100644
44*4882a593Smuzhiyun--- a/wscript_configure_embedded_heimdal
45*4882a593Smuzhiyun+++ b/wscript_configure_embedded_heimdal
46*4882a593Smuzhiyun@@ -1 +1,12 @@
47*4882a593Smuzhiyun conf.RECURSE('source4/heimdal_build')
48*4882a593Smuzhiyun+
49*4882a593Smuzhiyun+def check_system_heimdal_binary(name):
50*4882a593Smuzhiyun+    if conf.LIB_MAY_BE_BUNDLED(name):
51*4882a593Smuzhiyun+        return False
52*4882a593Smuzhiyun+    if not conf.find_program(name, var=name.upper()):
53*4882a593Smuzhiyun+        return False
54*4882a593Smuzhiyun+    conf.define('USING_SYSTEM_%s' % name.upper(), 1)
55*4882a593Smuzhiyun+    return True
56*4882a593Smuzhiyun+
57*4882a593Smuzhiyun+check_system_heimdal_binary("compile_et")
58*4882a593Smuzhiyun+check_system_heimdal_binary("asn1_compile")
59*4882a593Smuzhiyundiff --git a/wscript_configure_system_heimdal b/wscript_configure_system_heimdal
60*4882a593Smuzhiyunindex 0ff6dad2f55..f77c177442f 100644
61*4882a593Smuzhiyun--- a/wscript_configure_system_heimdal
62*4882a593Smuzhiyun+++ b/wscript_configure_system_heimdal
63*4882a593Smuzhiyun@@ -37,14 +37,6 @@ def check_system_heimdal_lib(name, functions='', headers='', onlyif=None):
64*4882a593Smuzhiyun     conf.define('USING_SYSTEM_%s' % name.upper(), 1)
65*4882a593Smuzhiyun     return True
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun-def check_system_heimdal_binary(name):
68*4882a593Smuzhiyun-    if conf.LIB_MAY_BE_BUNDLED(name):
69*4882a593Smuzhiyun-        return False
70*4882a593Smuzhiyun-    if not conf.find_program(name, var=name.upper()):
71*4882a593Smuzhiyun-        return False
72*4882a593Smuzhiyun-    conf.define('USING_SYSTEM_%s' % name.upper(), 1)
73*4882a593Smuzhiyun-    return True
74*4882a593Smuzhiyun-
75*4882a593Smuzhiyun check_system_heimdal_lib("com_err", "com_right_r com_err", "com_err.h")
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun if check_system_heimdal_lib("roken", "rk_socket_set_reuseaddr", "roken.h"):
78*4882a593Smuzhiyun@@ -96,7 +96,4 @@
79*4882a593Smuzhiyun #if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'):
80*4882a593Smuzhiyun #    conf.define('USING_SYSTEM_TOMMATH', 1)
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun-check_system_heimdal_binary("compile_et")
83*4882a593Smuzhiyun-check_system_heimdal_binary("asn1_compile")
84*4882a593Smuzhiyun-
85*4882a593Smuzhiyun conf.define('USING_SYSTEM_KRB5', 1)
86*4882a593Smuzhiyun--
87*4882a593Smuzhiyun2.20.1
88