mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Tools.mk and config.h. conf/Tools.mk is included by tools/Rules.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script. config.h is only used by libxl/xl to detect yajl_version.h. [ tools/config.sub and config.guess copied from autotools-dev 20100122.1 from Debian squeeze i386, which is GPLv2. tools/configure generated using the included ./autogen.sh which ran autoconf 2.67-2 from Debian squeeze i386. autoconf is GPLv3+ but has a special exception for the autoconf output; this exception applies to us and exempts us from complying with GPLv3+ for configure, which is good as Xen is GPL2 only. - Ian Jackson ] Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Tested-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
77 lines
2.1 KiB
C
77 lines
2.1 KiB
C
/*
|
|
* Copyright (C) 2011 Citrix Ltd.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published
|
|
* by the Free Software Foundation; version 2.1 only. with the special
|
|
* exception on linking described in file LICENSE.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*/
|
|
|
|
#ifndef LIBXL_JSON_H
|
|
#define LIBXL_JSON_H
|
|
|
|
#include <yajl/yajl_gen.h>
|
|
#include <yajl/yajl_parse.h>
|
|
|
|
#ifdef HAVE_YAJL_YAJL_VERSION_H
|
|
# include <yajl/yajl_version.h>
|
|
#endif
|
|
|
|
#include <_libxl_types_json.h>
|
|
|
|
/* YAJL version check */
|
|
#if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1)
|
|
# define HAVE_YAJL_V2 1
|
|
#endif
|
|
|
|
#ifdef HAVE_YAJL_V2
|
|
|
|
typedef size_t libxl_yajl_length;
|
|
|
|
static inline yajl_handle libxl__yajl_alloc(const yajl_callbacks *callbacks,
|
|
yajl_alloc_funcs *allocFuncs,
|
|
void *ctx)
|
|
{
|
|
return yajl_alloc(callbacks, allocFuncs, ctx);
|
|
}
|
|
|
|
static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
|
|
{
|
|
return yajl_gen_alloc(allocFuncs);
|
|
}
|
|
|
|
#else /* !HAVE_YAJL_V2 */
|
|
|
|
#define yajl_complete_parse yajl_parse_complete
|
|
|
|
typedef unsigned int libxl_yajl_length;
|
|
|
|
static inline yajl_handle libxl__yajl_alloc(const yajl_callbacks *callbacks,
|
|
const yajl_alloc_funcs *allocFuncs,
|
|
void *ctx)
|
|
{
|
|
yajl_parser_config cfg = {
|
|
.allowComments = 1,
|
|
.checkUTF8 = 1,
|
|
};
|
|
return yajl_alloc(callbacks, &cfg, allocFuncs, ctx);
|
|
}
|
|
|
|
static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
|
|
{
|
|
yajl_gen_config conf = { 1, " " };
|
|
return yajl_gen_alloc(&conf, allocFuncs);
|
|
}
|
|
|
|
#endif /* !HAVE_YAJL_V2 */
|
|
|
|
yajl_gen_status libxl_domain_config_gen_json(yajl_gen hand,
|
|
libxl_domain_config *p);
|
|
|
|
#endif /* LIBXL_JSON_H */
|