Always enable native JSON support and remove Jansson references

* 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.
scratch/interpreted-function
Mattias Engdegård 2024-03-30 15:13:24 +01:00
parent 890edfd2bb
commit 1135ce461d
16 changed files with 18 additions and 90 deletions

View File

@ -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

View 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
@ -4005,27 +4002,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
@ -5470,11 +5446,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"
@ -7655,7 +7626,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 \
@ -7731,7 +7702,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}

View File

@ -5752,10 +5752,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
@ -5790,12 +5790,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:

View File

@ -43,6 +43,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.
* Startup Changes in Emacs 30.1

View 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:

View 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", };

View File

@ -7346,9 +7346,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.

View 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...

View 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"

View 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@//

View 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

View 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 \

View 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)

View 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 ();

View 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);

View 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);