提交 49a1c160 编写于 作者: D Daniel P. Berrange

Convert HAVE_YAJL into WITH_YAJL

Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 cd699ed1
......@@ -1206,15 +1206,15 @@ if test "x$with_yajl" != "xno"; then
CPPFLAGS="$old_cppflags"
LIBS="$old_libs"
if test "x$with_yajl" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_YAJL], 1,
AC_DEFINE_UNQUOTED([WITH_YAJL], 1,
[whether YAJL is available for JSON parsing/formatting])
fi
if test "x$with_yajl2" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_YAJL2], 1,
AC_DEFINE_UNQUOTED([WITH_YAJL2], 1,
[whether YAJL has API version 2])
fi
fi
AM_CONDITIONAL([HAVE_YAJL], [test "x$with_yajl" = "xyes"])
AM_CONDITIONAL([WITH_YAJL], [test "x$with_yajl" = "xyes"])
AC_SUBST([YAJL_CFLAGS])
AC_SUBST([YAJL_LIBS])
......
......@@ -1144,7 +1144,7 @@ qemuCapsComputeCmdFlags(const char *help,
* backported for libvirt. The benefits of JSON mode now
* outweigh the downside.
*/
#if HAVE_YAJL
#if WITH_YAJL
if (version >= 13000) {
qemuCapsSet(caps, QEMU_CAPS_MONITOR_JSON);
} else if (version >= 12000 &&
......
......@@ -1991,7 +1991,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
goto cleanup;
}
} else {
#if HAVE_YAJL
#if WITH_YAJL
if (qemuCapsGet(priv->caps, QEMU_CAPS_MONITOR_JSON)) {
if (!qemuCapsGet(priv->caps, QEMU_CAPS_NO_SHUTDOWN)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
......@@ -2003,7 +2003,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Reboot is not supported without the JSON monitor"));
goto cleanup;
#if HAVE_YAJL
#if WITH_YAJL
}
#endif
}
......
......@@ -29,11 +29,11 @@
#include "virlog.h"
#include "virutil.h"
#if HAVE_YAJL
#if WITH_YAJL
# include <yajl/yajl_gen.h>
# include <yajl/yajl_parse.h>
# ifdef HAVE_YAJL2
# ifdef WITH_YAJL2
# define yajl_size_t size_t
# else
# define yajl_size_t unsigned int
......@@ -659,7 +659,7 @@ int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key)
}
#if HAVE_YAJL
#if WITH_YAJL
static int virJSONParserInsertValue(virJSONParserPtr parser,
virJSONValuePtr value)
{
......@@ -937,13 +937,13 @@ virJSONValuePtr virJSONValueFromString(const char *jsonstring)
yajl_handle hand;
virJSONParser parser = { NULL, NULL, 0 };
virJSONValuePtr ret = NULL;
# ifndef HAVE_YAJL2
# ifndef WITH_YAJL2
yajl_parser_config cfg = { 1, 1 };
# endif
VIR_DEBUG("string=%s", jsonstring);
# ifdef HAVE_YAJL2
# ifdef WITH_YAJL2
hand = yajl_alloc(&parserCallbacks, NULL, &parser);
if (hand) {
yajl_config(hand, yajl_allow_comments, 1);
......@@ -1061,13 +1061,13 @@ char *virJSONValueToString(virJSONValuePtr object,
const unsigned char *str;
char *ret = NULL;
yajl_size_t len;
# ifndef HAVE_YAJL2
# ifndef WITH_YAJL2
yajl_gen_config conf = { pretty ? 1 : 0, pretty ? " " : " "};
# endif
VIR_DEBUG("object=%p", object);
# ifdef HAVE_YAJL2
# ifdef WITH_YAJL2
g = yajl_gen_alloc(NULL);
if (g) {
yajl_gen_config(g, yajl_gen_beautify, pretty ? 1 : 0);
......
......@@ -146,7 +146,7 @@ if WITH_CIL
test_programs += object-locking
endif
if HAVE_YAJL
if WITH_YAJL
test_programs += jsontest
endif
......
......@@ -56,7 +56,7 @@ static int testHelpStrParsing(const void *data)
&version, &is_kvm, &kvm_version, false) == -1)
goto cleanup;
# ifndef HAVE_YAJL
# ifndef WITH_YAJL
if (qemuCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
# endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册