From: Anthony PERARD <anthony@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Anthony PERARD <anthony.perard@vates.tech>
Subject: [XEN PATCH for-4.21] tools: require at least json-c 0.15
Date: Thu, 23 Oct 2025 10:57:30 +0200 [thread overview]
Message-ID: <20251023085730.36628-1-anthony@xenproject.org> (raw)
From: Anthony PERARD <anthony.perard@vates.tech>
If not available, fallback to using YAJL.
The code is using json_c_visit() which was introduced in 0.13.
json_object_new_null() and json_object_new_uint64() where added to
0.14. And the last one json_object_new_array_ext() was introduced in
0.15.
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
tools/configure | 16 ++++++++--------
tools/configure.ac | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/configure b/tools/configure
index 0eb7a0ab6a..d460f25529 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9642,12 +9642,12 @@ if test -n "$libjsonc_CFLAGS"; then
pkg_cv_libjsonc_CFLAGS="$libjsonc_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
- ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+ pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c >= 0.15" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -9659,12 +9659,12 @@ if test -n "$libjsonc_LIBS"; then
pkg_cv_libjsonc_LIBS="$libjsonc_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
- ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+ pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c >= 0.15" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -9685,9 +9685,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+ libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
else
- libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+ libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libjsonc_PKG_ERRORS" >&5
diff --git a/tools/configure.ac b/tools/configure.ac
index 7267d02a04..285b4ea128 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -424,7 +424,7 @@ AC_SUBST([ZLIB_CFLAGS])
AC_SUBST([ZLIB_LIBS])
AX_CHECK_EXTFS
AX_CHECK_PTHREAD
-PKG_CHECK_MODULES([libjsonc], [json-c],
+PKG_CHECK_MODULES([libjsonc], [json-c >= 0.15],
[AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])],
[AC_CHECK_LIB([yajl], [yajl_alloc],
[AC_SUBST([YAJL_LIBS],[-lyajl])
--
Anthony PERARD
next reply other threads:[~2025-10-23 8:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 8:57 Anthony PERARD [this message]
2025-10-23 9:41 ` [XEN PATCH for-4.21] tools: require at least json-c 0.15 Jan Beulich
2025-10-23 14:44 ` Oleksii Kurochko
2025-10-23 14:45 ` Andrew Cooper
2025-10-23 15:04 ` Anthony PERARD
2025-10-23 15:05 ` Andrew Cooper
2025-10-23 15:22 ` Oleksii Kurochko
2025-10-24 19:03 ` Jason Andryuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251023085730.36628-1-anthony@xenproject.org \
--to=anthony@xenproject.org \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=oleksii.kurochko@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.