]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Reject libjson-c versions older than 0.13.
authorBruno Haible <bruno@clisp.org>
Tue, 30 Dec 2025 21:09:03 +0000 (22:09 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 30 Dec 2025 21:09:03 +0000 (22:09 +0100)
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.

DEPENDENCIES
gettext-tools/configure.ac

index 9cdce74b65722b60116505c7dada32b5d4485558..278835d3a2194545e84c62dd6f2492715f7e6a57 100644 (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.
index 58e59a912cebd7531ad36e231bce3df71db10f21..769d2512bd69dd1abe25d8080e1bec102d08e914 100644 (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