Skip to content

Commit

Permalink
Fix build if DOWNLOAD is set, but no JSON
Browse files Browse the repository at this point in the history
The downloader does not require JSON, but channel_curl is built
even if not called. Build fails with the error:

corelib/channel_curl.c:27:10: fatal error: json-c/json.h: No such file or directory

Add a CONFIG_CHANNEL_CURL that is automatically set by the modules
reuiring it (suricatta and swuforwarder).

Signed-off-by: Stefano Babic <sbabic@denx.de>
Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
Acked-by: Jörg Krause <joerg.krause@embedded.rocks>
  • Loading branch information
sbabic committed Jan 24, 2018
1 parent 18bd219 commit 37a6666
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Kconfig
Expand Up @@ -294,6 +294,13 @@ config DOWNLOAD
comment "Image downloading support needs libcurl"
depends on !HAVE_LIBCURL

config CHANNEL_CURL
bool
depends on HAVE_LIBCURL
depends on HAVE_JSON_C
select CURL
select JSON

config HASH_VERIFY
bool "Allow to add sha256 hash to each image"
depends on HAVE_LIBSSL
Expand Down
2 changes: 1 addition & 1 deletion corelib/Makefile
Expand Up @@ -17,4 +17,4 @@ lib-$(CONFIG_ENCRYPTED_IMAGES) += swupdate_decrypt.o
lib-$(CONFIG_LIBCONFIG) += swupdate_settings.o \
parsing_library_libconfig.o
lib-$(CONFIG_JSON) += parsing_library_libjson.o
lib-$(CONFIG_CURL) += channel_curl.o
lib-$(CONFIG_CHANNEL_CURL) += channel_curl.o
8 changes: 5 additions & 3 deletions handlers/Config.in
Expand Up @@ -54,7 +54,6 @@ config UBIVIDOFFSET
if your NAND driver incorrectly reports that it can handle
sub-page accesses when it should not.


config CFI
bool "cfi"
depends on MTD
Expand Down Expand Up @@ -164,8 +163,8 @@ comment "remote handler needs zeromq"
config SWUFORWARDER_HANDLER
bool "SWU forwarder"
depends on HAVE_LIBCURL
select CURL
select JSON
depends on HAVE_JSON_C
select CHANNEL_CURL
default n
help
This allows to build a chain of updater. A
Expand All @@ -174,6 +173,9 @@ config SWUFORWARDER_HANDLER
embedded SWU to the other devices using the
Webserver REST API.

comment "swuforward handler needs json-c and curl"
depends on !HAVE_JSON_C || !HAVE_LIBCURL

comment "SWU forwarder requires libcurl"
depends on !HAVE_LIBCURL

Expand Down
3 changes: 1 addition & 2 deletions suricatta/Config.in
Expand Up @@ -71,8 +71,7 @@ config SURICATTA_HAWKBIT
bool "hawkBit support"
depends on HAVE_LIBCURL
depends on HAVE_JSON_C
select JSON
select CURL
select CHANNEL_CURL
help
Support for hawkBit server.
https://projects.eclipse.org/projects/iot.hawkbit
Expand Down

0 comments on commit 37a6666

Please sign in to comment.