0002-build-find-pre-built-heimdal-build-tools-in-case-of-.patch 3.5 KB

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