]> git.eshelyaron.com Git - emacs.git/commitdiff
Always enable native JSON support and remove Jansson references
authorMattias EngdegÄrd <mattiase@acm.org>
Sat, 30 Mar 2024 14:13:24 +0000 (15:13 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 30 Mar 2024 19:37:13 +0000 (20:37 +0100)
* src/json.c (Fjson__available_p): Remove.
* lisp/subr.el (json-available-p): Always return t.
* admin/nt/dist-build/build-dep-zips.py:
* configure.ac:
* doc/lispref/text.texi (Parsing JSON):
* java/INSTALL:
* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* lisp/term/w32-win.el (dynamic-library-alist):
* m4/ndk-build.m4 (ndk_INIT):
* msdos/sed1v2.inp:
* nt/INSTALL:
* nt/INSTALL.W64:
* src/Makefile.in:
* src/emacs.c (main):
* src/lisp.h:
Remove JSON configuration options and references to it and Jansson from
documentation and build files.
* etc/NEWS: Announce.

(cherry picked from commit 1135ce461d188869e0294af45641edc2cbfacbf0)

16 files changed:
admin/nt/dist-build/build-dep-zips.py
configure.ac
doc/lispref/text.texi
etc/NEWS
java/INSTALL
java/org/gnu/emacs/EmacsNative.java
lisp/subr.el
lisp/term/w32-win.el
m4/ndk-build.m4
msdos/sed1v2.inp
nt/INSTALL
nt/INSTALL.W64
src/Makefile.in
src/emacs.c
src/json.c
src/lisp.h

index fb0aca87731a2a7b3be5c6a6257f5bab2d6109fa..0b1cc4d86950648ca0bc5d3698570921af109c38 100755 (executable)
@@ -32,7 +32,6 @@ EMACS_MAJOR_VERSION="28"
 PKG_REQ='''mingw-w64-x86_64-giflib
 mingw-w64-x86_64-gnutls
 mingw-w64-x86_64-harfbuzz
-mingw-w64-x86_64-jansson
 mingw-w64-x86_64-lcms2
 mingw-w64-x86_64-libjpeg-turbo
 mingw-w64-x86_64-libpng
@@ -44,7 +43,6 @@ mingw-w64-x86_64-xpm-nox'''.split()
 DLL_REQ='''libgif
 libgnutls
 libharfbuzz
-libjansson
 liblcms2
 libturbojpeg
 libpng
index b88e3a385462f424fa66e65bce89b4ccf3032b88..b0b454eda44756a7cdac7d3c7f318a9fa88a31d6 100644 (file)
@@ -548,7 +548,6 @@ OPTION_DEFAULT_OFF([cairo-xcb], [use XCB surfaces for Cairo support])
 OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
 OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support])
 OPTION_DEFAULT_ON([native-image-api], [don't use native image APIs (GDI+ on Windows)])
-OPTION_DEFAULT_IFAVAILABLE([json], [compile with native JSON support])
 OPTION_DEFAULT_IFAVAILABLE([tree-sitter], [compile with tree-sitter])
 
 OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])
@@ -1216,7 +1215,6 @@ package will likely install on older systems but crash on startup.])
   passthrough="$passthrough --with-png=$with_png"
   passthrough="$passthrough --with-webp=$with_webp"
   passthrough="$passthrough --with-gif=$with_gif"
-  passthrough="$passthrough --with-json=$with_json"
   passthrough="$passthrough --with-jpeg=$with_jpeg"
   passthrough="$passthrough --with-xml2=$with_xml2"
   passthrough="$passthrough --with-sqlite3=$with_sqlite3"
@@ -1305,7 +1303,6 @@ if test "$ANDROID" = "yes"; then
     with_png=no
     with_webp=no
     with_gif=no
-    with_json=no
     with_jpeg=no
     with_xml2=no
     with_sqlite3=no
@@ -4038,27 +4035,6 @@ fi
 AC_SUBST([LIBSYSTEMD_LIBS])
 AC_SUBST([LIBSYSTEMD_CFLAGS])
 
-HAVE_JSON=no
-JSON_OBJ=
-
-if test "${with_json}" != no; then
-  EMACS_CHECK_MODULES([JSON], [jansson >= 2.7],
-    [HAVE_JSON=yes], [HAVE_JSON=no])
-  if test "${HAVE_JSON}" = yes; then
-    AC_DEFINE([HAVE_JSON], [1], [Define if using Jansson.])
-    JSON_OBJ=json.o
-  fi
-
-  # Windows loads libjansson dynamically
-  if test "${opsys}" = "mingw32"; then
-    JSON_LIBS=
-  fi
-fi
-
-AC_SUBST([JSON_LIBS])
-AC_SUBST([JSON_CFLAGS])
-AC_SUBST([JSON_OBJ])
-
 HAVE_TREE_SITTER=no
 TREE_SITTER_OBJ=
 NEED_DYNLIB=no
@@ -5503,11 +5479,6 @@ case $with_gnutls,$HAVE_GNUTLS in
   *) MISSING="$MISSING gnutls"
      WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gnutls=ifavailable";;
 esac
-case $with_json,$HAVE_JSON in
-  no,* | ifavailable,* | *,yes) ;;
-  *) MISSING="$MISSING json"
-     WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-json=ifavailable";;
-esac
 case $with_tree_sitter,$HAVE_TREE_SITTER in
   no,* | ifavailable,* | *,yes) ;;
   *) MISSING="$MISSING tree-sitter"
@@ -7688,7 +7659,7 @@ Configured for '${canonical}'.
 optsep=
 emacs_config_features=
 for opt in ACL BE_APP CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS \
- HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 \
+ HARFBUZZ IMAGEMAGICK JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 \
  M17N_FLT MODULES NATIVE_COMP NOTIFY NS OLDXMENU PDUMPER PGTK PNG RSVG SECCOMP \
  SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER \
  UNEXEC WEBP X11 XAW3D XDBE XFT XIM XINPUT2 XPM XWIDGETS X_TOOLKIT \
@@ -7764,7 +7735,6 @@ AS_ECHO(["  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D
   Does Emacs use -lotf?                                   ${HAVE_LIBOTF}
   Does Emacs use -lxft?                                   ${HAVE_XFT}
   Does Emacs use -lsystemd?                               ${HAVE_LIBSYSTEMD}
-  Does Emacs use -ljansson?                               ${HAVE_JSON}
   Does Emacs use -ltree-sitter?                           ${HAVE_TREE_SITTER}
   Does Emacs use the GMP library?                         ${HAVE_GMP}
   Does Emacs directly use zlib?                           ${HAVE_ZLIB}
index c1643d9d0ee751836363891012de63df6f92be23..ac235cc1c57b2ce7d6f97b8a82c8fcb2eda25dc9 100644 (file)
@@ -5760,10 +5760,10 @@ non-@code{nil}, indent the @acronym{HTML}/@acronym{XML} logically.
 @cindex JSON
 @cindex JavaScript Object Notation
 
-  When Emacs is compiled with @acronym{JSON} (@dfn{JavaScript Object
-Notation}) support, it provides several functions to convert
-between Lisp objects and JSON values.  Any JSON value can be converted
-to a Lisp object, but not vice versa.  Specifically:
+  The Emacs @acronym{JSON} (@dfn{JavaScript Object Notation}) support
+provides several functions to convert between Lisp objects and JSON
+values.  Any JSON value can be converted to a Lisp object, but not vice
+versa.  Specifically:
 
 @itemize
 @item
@@ -5798,12 +5798,6 @@ represents @code{@{@}}, the empty JSON object; not @code{null},
 @code{false}, or an empty array, all of which are different JSON
 values.
 
-@defun json-available-p
-This predicate returns non-@code{nil} if Emacs has been built with
-@acronym{JSON} support, and the library is available on the current
-system.
-@end defun
-
   If some Lisp object can't be represented in JSON, the serialization
 functions will signal an error of type @code{wrong-type-argument}.
 The parsing functions can also signal the following errors:
index 811cc3a9658241910407e43b8a4bab92b002ba46..5bbd4353a8b43c9244264a5c6ea6f74d83bd0462 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -49,6 +49,12 @@ external packages and to resolve potential incompatibilities between
 Linux and BSD versions of ALSA.  Use '--with-sound=alsa' to build with
 ALSA on these operating systems instead.
 
+---
+** Native JSON support is now always available; libjansson is no longer used.
+No external library is required.  The '--with-json' configure option has
+been removed.  'json-available-p' now always returns non-nil and is only
+kept for compatibility.
+
 \f
 * Startup Changes in Emacs 30.1
 
index f1063b40c2595fb65078c1d645928131a56ca557..6daef59084e7a43269bb139de8796429d9c704ce 100644 (file)
@@ -307,14 +307,6 @@ Many of these dependencies have been migrated over to the
 However, the old ``Android.mk'' Makefiles are still present in older
 branches, and can be easily adapted to newer versions.
 
-In addition, some Emacs dependencies provide `ndk-build' support
-themselves:
-
-  libjansson   - https://github.com/akheron/jansson
-    (You must add LOCAL_EXPORT_INCLUDES := $(LOCAL_C_INCLUDES) before
-     its Android.mk includes $(BUILD_SHARED_LIBRARY), then copy
-     android/jansson_config.h to android/jansson_private_config.h.)
-
 Emacs developers have ported the following dependencies to ARM Android
 systems:
 
index 654e94b1a7d3f6fc61c16be8e8ef3d99d4f97e56..24440bd59531c15c76c4c7b0cee0c0a7a58d48f5 100644 (file)
@@ -337,7 +337,7 @@ public final class EmacsNative
                                 "gnutls_emacs", "gmp_emacs",
                                 "nettle_emacs", "p11-kit_emacs",
                                 "tasn1_emacs", "hogweed_emacs",
-                                "jansson_emacs", "jpeg_emacs",
+                                "jpeg_emacs",
                                 "tiff_emacs", "xml2_emacs",
                                 "icuuc_emacs", "harfbuzz_emacs",
                                 "tree-sitter_emacs", };
index 94529ed959ad61970c503fcf89f1034c0dc3935a..b155e2165e8ad90fd48f63a67d1aa789433464ad 100644 (file)
@@ -7350,9 +7350,8 @@ sentence (see Info node `(elisp) Documentation Tips')."
   (internal--fill-string-single-line (apply #'format string objects)))
 
 (defun json-available-p ()
-  "Return non-nil if Emacs has libjansson support."
-  (and (fboundp 'json--available-p)
-       (json--available-p)))
+  "Return non-nil if Emacs has native JSON support."
+  t)
 
 (defun ensure-list (object)
   "Return OBJECT as a list.
index 9b696475c34e677db3ecc8fb01b5d266a86646ea..3c0acf368f42e53eba4c454ae5ee0cf8581eb5ba 100644 (file)
@@ -288,7 +288,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
        '(libxml2 "libxml2-2.dll" "libxml2.dll")
        '(zlib "zlib1.dll" "libz-1.dll")
        '(lcms2 "liblcms2-2.dll")
-       '(json "libjansson-4.dll")
        '(gccjit "libgccjit-0.dll")
        ;; MSYS2 distributes libtree-sitter.dll, without API version
        ;; number...
index 7012471e046a42ae15d186b121e56ba25ef1dec5..abe06063ab01ac9c2216798796047454f62da88f 100644 (file)
@@ -69,7 +69,7 @@ AS_CASE(["$ndk_ABI"],
 # This is a map between pkg-config style package names and Android
 # ones.
 
-ndk_package_map="libwebpdemux:webpdemux libxml-2.0:libxml2 jansson:libjansson"
+ndk_package_map="libwebpdemux:webpdemux libxml-2.0:libxml2"
 ndk_package_map="$ndk_package_map sqlite3:libsqlite_static_minimal"
 ndk_package_map="$ndk_package_map MagickWand:libmagickwand-7 lcms2:liblcms2"
 
index 632c45a16b6465c2d02733e227df7d8f648d98dd..da0560675488c7d7d4a21ebf4ab054259e1711f5 100644 (file)
@@ -175,9 +175,6 @@ s/ *@WEBP_LIBS@//
 /^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/
 /^W32_OBJ *=/s/@W32_OBJ@//
 /^W32_LIBS *=/s/@W32_LIBS@//
-/^JSON_OBJ *=/s/@JSON_OBJ@//
-/^JSON_CFLAGS *=/s/@JSON_CFLAGS@//
-/^JSON_LIBS *=/s/@JSON_LIBS@//
 /^LIBGCCJIT_OBJ *=/s/@LIBGCCJIT_OBJ@//
 /^LIBGCCJIT_CFLAGS *=/s/@LIBGCCJIT_CFLAGS@//
 /^LIBGCCJIT_LIBS *=/s/@LIBGCCJIT_LIBS@//
index 77626f8a34387f1806a140c8fc5135d3f93c917a..6167365169b94d50beb79d4e81d97750d6f53398 100644 (file)
@@ -508,7 +508,6 @@ build should run on Windows 9X and newer systems).
        Does Emacs use -lotf?                                   no
        Does Emacs use -lxft?                                   no
        Does Emacs use -lsystemd?                               no
-       Does Emacs use -ljansson?                               yes
        Does Emacs use the GMP library?                         yes
        Does Emacs directly use zlib?                           yes
        Does Emacs have dynamic modules support?                yes
@@ -830,13 +829,6 @@ build should run on Windows 9X and newer systems).
   Prebuilt binaries of lcms2 DLL (for 32-bit builds of Emacs) are
   available from the ezwinports site and from the MSYS2 project.
 
-* Optional support for JSON
-
-  Emacs can provide built-in support for JSON parsing and
-  serialization using the libjansson library.  Prebuilt binaries of
-  the libjansson DLL (for 32-bit builds of Emacs) are available from
-  the ezwinports site and from the MSYS2 project.
-
 * Optional support for HarfBuzzz shaping library
 
   Emacs supports display of complex scripts and Arabic shaping.  The
index 2aa05ea0062e385b7ce16658d1d31691eef9efd7..d25fc2e18affa8e1cd820e55a07a4d4d5b506bc2 100644 (file)
@@ -55,7 +55,6 @@ packages (you can copy and paste it into the shell with Shift + Insert):
   mingw-w64-x86_64-librsvg \
   mingw-w64-x86_64-libwebp \
   mingw-w64-x86_64-lcms2 \
-  mingw-w64-x86_64-jansson \
   mingw-w64-x86_64-libxml2 \
   mingw-w64-x86_64-zlib \
   mingw-w64-x86_64-harfbuzz \
index de45b2290f18a1cc4bd0f2d68b6619f717f6c657..f58a3a7761e7dfe17e7b62dea5d57c1fd054811e 100644 (file)
@@ -361,10 +361,6 @@ LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
 LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
 LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
 
-JSON_LIBS = @JSON_LIBS@
-JSON_CFLAGS = @JSON_CFLAGS@
-JSON_OBJ = @JSON_OBJ@
-
 TREE_SITTER_LIBS = @TREE_SITTER_LIBS@
 TREE_SITTER_CFLAGS = @TREE_SITTER_CFLAGS@
 
@@ -438,7 +434,7 @@ EMACS_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
   $(XINPUT_CFLAGS) $(WEBP_CFLAGS) $(WEBKIT_CFLAGS) $(LCMS2_CFLAGS) \
   $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
   $(HARFBUZZ_CFLAGS) $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
-  $(LIBSYSTEMD_CFLAGS) $(JSON_CFLAGS) $(XSYNC_CFLAGS) $(TREE_SITTER_CFLAGS) \
+  $(LIBSYSTEMD_CFLAGS) $(XSYNC_CFLAGS) $(TREE_SITTER_CFLAGS) \
   $(LIBGNUTLS_CFLAGS) $(NOTIFY_CFLAGS) $(CAIRO_CFLAGS) \
   $(WERROR_CFLAGS) $(HAIKU_CFLAGS) $(XCOMPOSITE_CFLAGS) $(XSHAPE_CFLAGS) \
   $(ANDROID_BUILD_CFLAGS) $(GIF_CFLAGS) $(JPEG_CFLAGS) $(SQLITE3_CFLAGS) \
@@ -479,7 +475,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o     \
        itree.o                                                                \
        $(if $(HYBRID_MALLOC),sheap.o)                                         \
        $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)        \
-       $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ) $(JSON_OBJ)                \
+       $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)                            \
        $(HAIKU_OBJ) $(PGTK_OBJ) $(ANDROID_OBJ)
 doc_obj = $(base_obj) $(NS_OBJC_OBJ)
 obj = $(doc_obj) $(HAIKU_CXX_OBJ)
@@ -604,7 +600,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(PGTK_LIBS) $(LIBX_BASE) $(LIBIMAGE
    $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(HARFBUZZ_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
    $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LCMS2_LIBS) \
    $(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS) \
-   $(JSON_LIBS) $(LIBGMP) $(LIBGCCJIT_LIBS) $(XINPUT_LIBS) $(HAIKU_LIBS) \
+   $(LIBGMP) $(LIBGCCJIT_LIBS) $(XINPUT_LIBS) $(HAIKU_LIBS) \
    $(TREE_SITTER_LIBS) $(SQLITE3_LIBS) $(XCOMPOSITE_LIBS) $(XSHAPE_LIBS) \
    $(ANDROID_LIBS)
 
index 4a34bb064257588cc501e26dffd9089a15adde7c..1cb1e70ac65eb773cba64d809b0b91a7a1473bc4 100644 (file)
@@ -2475,10 +2475,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
       syms_of_threads ();
       syms_of_profiler ();
       syms_of_pdumper ();
-
-#ifdef HAVE_JSON
       syms_of_json ();
-#endif
 
       keys_of_keyboard ();
 
index 5bc630696243d9d395b46e13ee01ace7cfd179ae..43b2d1cb4f8b1151a746cf00f2794397a66da6a9 100644 (file)
@@ -98,14 +98,6 @@ json_parse_args (ptrdiff_t nargs,
   }
 }
 
-/* FIXME: Remove completely.  */
-DEFUN ("json--available-p", Fjson__available_p, Sjson__available_p, 0, 0, NULL,
-       doc: /* Return non-nil if libjansson is available (internal use only).  */)
-  (void)
-{
-  return Qt;
-}
-
 /* JSON encoding context.  */
 typedef struct {
   char *buf;
@@ -1966,7 +1958,6 @@ syms_of_json (void)
   DEFSYM (Qplist, "plist");
   DEFSYM (Qarray, "array");
 
-  defsubr (&Sjson__available_p);
   defsubr (&Sjson_serialize);
   defsubr (&Sjson_insert);
   defsubr (&Sjson_parse_string);
index 7c4bd435cd8b17fb03c200b556c302962a21f17b..43a29489a2554ca5d0247444874cae57a492dbfd 100644 (file)
@@ -4325,10 +4325,8 @@ extern void init_fringe_once (void);
 extern int x_bitmap_mask (struct frame *, ptrdiff_t);
 extern void syms_of_image (void);
 
-#ifdef HAVE_JSON
 /* Defined in json.c.  */
 extern void syms_of_json (void);
-#endif
 
 /* Defined in insdel.c.  */
 extern void move_gap_both (ptrdiff_t, ptrdiff_t);