0002-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. From 37a6666a532e9cbc42b56301f27919ae7c00d2eb Mon Sep 17 00:00:00 2001
  2. From: Stefano Babic <sbabic@denx.de>
  3. Date: Tue, 23 Jan 2018 16:52:32 +0100
  4. Subject: [PATCH] Fix build if DOWNLOAD is set, but no JSON
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. The downloader does not require JSON, but channel_curl is built
  9. even if not called. Build fails with the error:
  10. corelib/channel_curl.c:27:10: fatal error: json-c/json.h: No such file or directory
  11. Add a CONFIG_CHANNEL_CURL that is automatically set by the modules
  12. reuiring it (suricatta and swuforwarder).
  13. Backported from: 37a6666a532e9cbc42b56301f27919ae7c00d2eb
  14. Signed-off-by: Stefano Babic <sbabic@denx.de>
  15. Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
  16. Acked-by: Jörg Krause <joerg.krause@embedded.rocks>
  17. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  18. ---
  19. Kconfig | 7 +++++++
  20. corelib/Makefile | 2 +-
  21. handlers/Config.in | 8 +++++---
  22. suricatta/Config.in | 3 +--
  23. 4 files changed, 14 insertions(+), 6 deletions(-)
  24. diff --git a/Kconfig b/Kconfig
  25. index 4469096..e344572 100644
  26. --- a/Kconfig
  27. +++ b/Kconfig
  28. @@ -294,6 +294,13 @@ config DOWNLOAD
  29. comment "Image downloading support needs libcurl"
  30. depends on !HAVE_LIBCURL
  31. +config CHANNEL_CURL
  32. + bool
  33. + depends on HAVE_LIBCURL
  34. + depends on HAVE_JSON_C
  35. + select CURL
  36. + select JSON
  37. +
  38. config HASH_VERIFY
  39. bool "Allow to add sha256 hash to each image"
  40. depends on HAVE_LIBSSL
  41. diff --git a/corelib/Makefile b/corelib/Makefile
  42. index 282bffd..4b30f9c 100644
  43. --- a/corelib/Makefile
  44. +++ b/corelib/Makefile
  45. @@ -17,4 +17,4 @@ lib-$(CONFIG_ENCRYPTED_IMAGES) += swupdate_decrypt.o
  46. lib-$(CONFIG_LIBCONFIG) += swupdate_settings.o \
  47. parsing_library_libconfig.o
  48. lib-$(CONFIG_JSON) += parsing_library_libjson.o
  49. -lib-$(CONFIG_CURL) += channel_curl.o
  50. +lib-$(CONFIG_CHANNEL_CURL) += channel_curl.o
  51. diff --git a/handlers/Config.in b/handlers/Config.in
  52. index 596f069..6226b59 100644
  53. --- a/handlers/Config.in
  54. +++ b/handlers/Config.in
  55. @@ -54,7 +54,6 @@ config UBIVIDOFFSET
  56. if your NAND driver incorrectly reports that it can handle
  57. sub-page accesses when it should not.
  58. -
  59. config CFI
  60. bool "cfi"
  61. depends on MTD
  62. @@ -164,8 +163,8 @@ comment "remote handler needs zeromq"
  63. config SWUFORWARDER_HANDLER
  64. bool "SWU forwarder"
  65. depends on HAVE_LIBCURL
  66. - select CURL
  67. - select JSON
  68. + depends on HAVE_JSON_C
  69. + select CHANNEL_CURL
  70. default n
  71. help
  72. This allows to build a chain of updater. A
  73. @@ -174,6 +173,9 @@ config SWUFORWARDER_HANDLER
  74. embedded SWU to the other devices using the
  75. Webserver REST API.
  76. +comment "swuforward handler needs json-c and curl"
  77. + depends on !HAVE_JSON_C || !HAVE_LIBCURL
  78. +
  79. comment "SWU forwarder requires libcurl"
  80. depends on !HAVE_LIBCURL
  81. diff --git a/suricatta/Config.in b/suricatta/Config.in
  82. index 62e448a..2586169 100644
  83. --- a/suricatta/Config.in
  84. +++ b/suricatta/Config.in
  85. @@ -71,8 +71,7 @@ config SURICATTA_HAWKBIT
  86. bool "hawkBit support"
  87. depends on HAVE_LIBCURL
  88. depends on HAVE_JSON_C
  89. - select JSON
  90. - select CURL
  91. + select CHANNEL_CURL
  92. help
  93. Support for hawkBit server.
  94. https://projects.eclipse.org/projects/iot.hawkbit
  95. --
  96. 2.16.1