Switch from YAJL to Jansson

While YAJL mostly works fine, it did not see any active development in
the last 3 years.  OTOH, Jansson is another JSON C implementation, with
a very liberal license, and a much nicer API.

Hence, switch all of libguestfs from YAJL to Jansson:
- configure checks, and buildsystem in general
- packages pulled in the appliance
- actual implementations
- contrib scripts
- documentation

This also makes use of the better APIs available (e.g. json_object_get,
json_array_foreach, and json_object_foreach).  This does not change the
API of our OCaml Yajl module.
This commit is contained in:
Pino Toscano
2018-02-12 11:24:06 +01:00
parent d0e5a819e8
commit bd1c5c9f4d
12 changed files with 168 additions and 230 deletions

View File

@@ -53,8 +53,8 @@ case $osversion in
# This just forces configure to ignore these missing dependencies.
export LIBTINFO_CFLAGS=-D_GNU_SOURCE
export LIBTINFO_LIBS=-lncurses
export YAJL_CFLAGS=-D_GNU_SOURCE
export YAJL_LIBS=-lyajl
export JANSSON_CFLAGS=-D_GNU_SOURCE
export JANSSON_LIBS=-ljansson
# Remove some unsupported flags that the configure script hard codes.
sed -i -e 's/-fno-strict-overflow//' configure
sed -i -e 's/-Wno-strict-overflow//' configure
@@ -66,8 +66,8 @@ case $osversion in
# This just forces configure to ignore these missing dependencies.
export LIBTINFO_CFLAGS=-D_GNU_SOURCE
export LIBTINFO_LIBS=-lncurses
export YAJL_CFLAGS=-D_GNU_SOURCE
export YAJL_LIBS=-lyajl
export JANSSON_CFLAGS=-D_GNU_SOURCE
export JANSSON_LIBS=-ljansson
;;
esac

View File

@@ -86,7 +86,6 @@ done
# Various hacks for different versions of RHEL.
if=virtio
netdev=virtio-net-pci
pkgs="$pkgs,yajl-devel"
declare -a epel
case $osversion in
rhel-5.*|centos-5.*)
@@ -105,10 +104,12 @@ case $osversion in
rhel-6.*|centos-6.*)
epel[0]="--run-command"
epel[1]="yum install -y --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
pkgs="$pkgs,jansson-devel"
;;
rhel-7.*|centos-7.*)
epel[0]="--run-command"
epel[1]="yum install -y --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
pkgs="$pkgs,jansson-devel"
;;
esac