diff configure.ac @ 28624:aae9d7f098bd

Support for RapidJSON 1.1.0 with jsonencode and jsondecode * configure.ac: Define HAVE_RAPIDJSON for RapidJSON 1.1.0 and HAVE_RAPIDJSON_DEV for the development or newer release in the future containing the `rapidjson/cursorstreamwrapper.h` header file. * libinterp/corefcn/jsondecode.cc: Improve docstrings and comments. * libinterp/corefcn/jsonencode.cc (Fjsonencode): Enable the 'PrettyWriter' option only if HAVE_RAPIDJSON_DEV is set to "1". Sort header includes. Improve docstrings and comments. This is the result of GSoC 2020 by Abdallah Elshamy and an addition to cset 5da49e37a6c9.
author Abdallah Elshamy <abdallah.k.elshamy@gmail.com>
date Tue, 18 Aug 2020 14:44:22 +0900
parents 5da49e37a6c9
children 6dc23a4126b9
line wrap: on
line diff
--- a/configure.ac	Sat Aug 15 23:41:26 2020 -0400
+++ b/configure.ac	Tue Aug 18 14:44:22 2020 +0900
@@ -1337,11 +1337,14 @@
 AC_CHECK_HEADER([rapidjson/rapidjson.h], [have_rapidjson=yes], [have_rapidjson=no
   rapid_json_warning="RapidJSON library not found.  Octave will not be able to read or write JSON files."])
 if test "$have_rapidjson" = yes; then
-  AC_CHECK_HEADER([rapidjson/cursorstreamwrapper.h], [have_rapidjson=yes], [have_rapidjson=no
-    rapid_json_warning="RapidJSON 1.1.0 or older found, but latest development version needed.  Octave will not be able to read or write JSON files."])
+  AC_CHECK_HEADER([rapidjson/cursorstreamwrapper.h], [have_rapidjson_dev=yes], [have_rapidjson_dev=no
+    rapid_json_warning="RapidJSON 1.1.0 or older found.  Octave will not support the 'PrettyWriter' option in 'jsonencode'."])
 fi
 if test "$have_rapidjson" = yes; then
   AC_DEFINE(HAVE_RAPIDJSON, 1, [Define to 1 if RapidJSON is available.])
+  if test "$have_rapidjson_dev" = yes; then
+    AC_DEFINE(HAVE_RAPIDJSON_DEV, 1, [Define to 1 if the development version of RapidJSON is available.])
+  fi
 else
   OCTAVE_CONFIGURE_WARNING([rapid_json_warning])
 fi