package/poke: add optional json-c dependency
authorRomain Naour <romain.naour@gmail.com>
Mon, 17 May 2021 15:56:27 +0000 (17:56 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Tue, 18 May 2021 14:16:59 +0000 (16:16 +0200)
From [1]:
"The poke machine-interface uses a protocol to communicate with
clients, which is based on JSON.  poke uses the json-c library to
parse and build JSON strings.
If this library is not found, poke will build without machine-interface
support."

[1] https://git.savannah.nongnu.org/cgit/poke.git/tree/DEPENDENCIES?h=releases/poke-1.2#n55

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Jose E. Marchesi <jemarch@gnu.org>
Cc: Luca Saiu <positron@gnu.org>
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/poke/poke.mk

index c0217b6fad598f74c603c4633c92a8d395698c63..7c3c81d93c551289c92781fc0805e3e865351d9d 100644 (file)
@@ -19,7 +19,13 @@ POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
 POKE_CONF_OPTS = \
        --disable-gui \
        --disable-libnbd \
-       --disable-mi \
        --with-libreadline-prefix=$(STAGING_DIR)
 
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+POKE_DEPENDENCIES += json-c
+POKE_CONF_OPTS += --enable-mi
+else
+POKE_CONF_OPTS += --disable-mi
+endif
+
 $(eval $(autotools-package))