build: Reject libjson-c versions older than 0.13.

Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00036.html>.

* DEPENDENCIES: Require libjson-c >= 0.13.
* gettext-tools/configure.ac (LIBJSON_C): Reject libjson-c versions older than
0.13.
This commit is contained in:
Bruno Haible 2025-12-30 22:09:03 +01:00
parent c326dfe6cb
commit 03d7277dec
2 changed files with 8 additions and 4 deletions

View File

@ -52,7 +52,7 @@ The following packages should be installed before GNU gettext is installed
+ If it is installed in a nonstandard directory, pass the option
--with-libxml2-prefix=DIR to 'configure'.
* libjson-c
* libjson-c 0.13 or newer
+ Recommended.
Needed for machine translation.
If not present, 'spit' will be a Python script instead of an executable.

View File

@ -477,15 +477,19 @@ AS_IF([test "$MODULA2_CHOICE" != no],
])
AC_SUBST([BUILDMODULA2])
dnl Check for the libjson-c library.
dnl Check for the libjson-c library, version 0.13 or newer.
dnl Set INCJSON_C to the -I option for the include files.
dnl Set LIBJSON_C to the -L and -l options for the library.
AC_MSG_CHECKING([for the libjson-c library])
LIBJSON_C=?
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <json-c/json_c_version.h>]], [[]])],
[AC_LANG_PROGRAM(
[[#include <json-c/json_c_version.h>
int version_check[2 * (JSON_C_MAJOR_VERSION + (JSON_C_MINOR_VERSION >= 13) > 0) - 1];
]],
[[]])],
[],
[dnl The include files are not present.
[dnl The include files are not present or are too old.
LIBJSON_C=
])
if test "$LIBJSON_C" = "?"; then