0002-wscript-remove-checks-for-bsd-string.h-fixes-host-co.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 54fbeaa68a59f536819d1cfb2e9204176fbff54b Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Thu, 16 Dec 2021 23:27:35 +0100
  4. Subject: [PATCH] wscript: remove checks for bsd/string.h, fixes host-compile
  5. failure
  6. Fixes the following host-compile failure while cross-compiling
  7. in case target libbsd is found:
  8. [2/2] Compiling build/host/ntpd/ntp_parser.tab.c
  9. In file included from ../../include/ntp.h:15,
  10. from .../build/ntpsec-1_2_1/ntpd/ntp_parser.y:16:
  11. ../../include/ntp_stdlib.h:20:10: fatal error: bsd/string.h: No such file or directory
  12. 20 | #include <bsd/string.h>
  13. | ^~~~~~~~~~~~~~
  14. compilation terminated.
  15. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  16. ---
  17. include/ntp_stdlib.h | 4 ----
  18. wscript | 14 --------------
  19. 2 files changed, 18 deletions(-)
  20. diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h
  21. index fe4d78e5c..73d97084f 100644
  22. --- a/include/ntp_stdlib.h
  23. +++ b/include/ntp_stdlib.h
  24. @@ -16,10 +16,6 @@
  25. #include "ntp_malloc.h"
  26. #include "ntp_syslog.h"
  27. -#ifdef HAVE_BSD_STRING_H
  28. -#include <bsd/string.h>
  29. -#endif
  30. -
  31. #ifdef __GNUC__
  32. #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
  33. #else
  34. diff --git a/wscript b/wscript
  35. index 641073f00..aa04b1d1c 100644
  36. --- a/wscript
  37. +++ b/wscript
  38. @@ -660,19 +660,6 @@ int main(int argc, char **argv) {
  39. prerequisites=ft[1], use=ft[2],
  40. mandatory=ft[3])
  41. - # check for BSD versions outside of libc
  42. - if not ctx.get_define("HAVE_STRLCAT"):
  43. - ret = probe_function(ctx, function='strlcat',
  44. - prerequisites=['bsd/string.h'])
  45. - if ret:
  46. - ctx.define("HAVE_STRLCAT", 1, comment="Using bsd/strlcat")
  47. -
  48. - if not ctx.get_define("HAVE_STRLCPY"):
  49. - ret = probe_function(ctx, function='strlcpy',
  50. - prerequisites=['bsd/string.h'])
  51. - if ret:
  52. - ctx.define("HAVE_STRLCPY", 1, comment="Using bsd/strlcpy")
  53. -
  54. # Nobody uses the symbol, but this seems like a good sanity check.
  55. ctx.check_cc(header_name="stdbool.h", mandatory=True,
  56. comment="Sanity check.")
  57. @@ -691,7 +678,6 @@ int main(int argc, char **argv) {
  58. optional_headers = (
  59. "alloca.h",
  60. ("arpa/nameser.h", ["sys/types.h"]),
  61. - "bsd/string.h", # bsd emulation
  62. ("ifaddrs.h", ["sys/types.h"]),
  63. ("linux/if_addr.h", ["sys/socket.h"]),
  64. ("linux/rtnetlink.h", ["sys/socket.h"]),
  65. --
  66. 2.34.1