Hi Jörg,
On 21/01/2018 20:53, Jörg Krause wrote:
> When building SWUpdate with the following defconfig
>
> |
> # CONFIG_LUA is not set
> CONFIG_DOWNLOAD=y
> CONFIG_UBIVOL=y
> CONFIG_CFI=y
> CONFIG_RAW=y
> CONFIG_SHELLSCRIPTHANDLER=y
> |
>
> .. the build process breaks with:
>
> |
> corelib/channel_curl.c:27:10:fatal error:json-c/json.h:Nosuch file
> ordirectory
> #include<json-c/json.h>
> |
>
> A quick look shows that CONFIG_DOWNLOAD depends on HAVE_LIBCURLwhich
> selects CURLwhich in return enables the build of channel_curl.o. I am
> not sure when channel_curl is required, but I guess it is only needed
> for Suricatta support, right?
Not anymore - functions was extracted from suricatta code and moved to
channel_curl to make them available to other modules, not only to suricatta.
The first use case I have is with the swuforward handler.
But you're right, channel_curl depends on CURL *and* JSON.
>
> Maybe we need something like CONFIG_SURICATTA_SERVER_SUPPORT(not tested!):
>
> |
>
>
> config SURICATTA_SERVER_SUPPORT
> bool"Suricatta Server support"
> depends on HAVE_LIBCURL
> depends on HAVE_JSON_C
> selectJSON
> selectCURL
> help
> SurricataServersupport.
>
> config SURICATTA_SERVER_HAWKBIT
> bool"Suricatta hawkBit server support"
> selectSURICATTA_SERVER_SUPPORT
> help
> SupportforhawkBit server.
>
>
> config SURICATTA_SERVER_OTHER
> bool"Suricatta other server support"
> selectSURICATTA_SERVER_SUPPORT
> help
> Supportforother server.
> |
>
> So channel_curl.o can be enabled by:
>
> |
> lib-$(CONFIG_SURICATTA_SERVER_SUPPORT)+=channel_curl.o
No, this breaks the swuforward handler.
What about this one (untested, too):
diff --git a/corelib/Makefile b/corelib/Makefile
index 282bffd..20b3ad0 100644
--- a/corelib/Makefile
+++ b/corelib/Makefile
@@ -17,4 +17,7 @@ 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
+ifeq ($(CONFIG_CURL)$(CONFIG_JSON),yy)
+lib-y += channel_curl.o
+endif
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================