-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* Copied from jansson_private_config.h.in and replaced #undef with #mesondefine. */ | ||
|
||
/* Define to 1 if gcc's __atomic builtins are available */ | ||
#mesondefine HAVE_ATOMIC_BUILTINS | ||
|
||
/* Define to 1 if you have the `close' function. */ | ||
#mesondefine HAVE_CLOSE | ||
|
||
/* Define to 1 if you have the <dlfcn.h> header file. */ | ||
#mesondefine HAVE_DLFCN_H | ||
|
||
/* Define to 1 if you have the <endian.h> header file. */ | ||
#mesondefine HAVE_ENDIAN_H | ||
|
||
/* Define to 1 if you have the <fcntl.h> header file. */ | ||
#mesondefine HAVE_FCNTL_H | ||
|
||
/* Define to 1 if you have the `getpid' function. */ | ||
#mesondefine HAVE_GETPID | ||
|
||
/* Define to 1 if you have the `gettimeofday' function. */ | ||
#mesondefine HAVE_GETTIMEOFDAY | ||
|
||
/* Define to 1 if you have the <inttypes.h> header file. */ | ||
#mesondefine HAVE_INTTYPES_H | ||
|
||
/* Define to 1 if you have the `localeconv' function. */ | ||
#mesondefine HAVE_LOCALECONV | ||
|
||
/* Define to 1 if you have the <locale.h> header file. */ | ||
#mesondefine HAVE_LOCALE_H | ||
|
||
/* Define to 1 if the system has the type 'long long int'. */ | ||
#mesondefine HAVE_LONG_LONG_INT | ||
|
||
/* Define to 1 if you have the <memory.h> header file. */ | ||
#mesondefine HAVE_MEMORY_H | ||
|
||
/* Define to 1 if you have the `open' function. */ | ||
#mesondefine HAVE_OPEN | ||
|
||
/* Define to 1 if you have the `read' function. */ | ||
#mesondefine HAVE_READ | ||
|
||
/* Define to 1 if you have the <sched.h> header file. */ | ||
#mesondefine HAVE_SCHED_H | ||
|
||
/* Define to 1 if you have the `sched_yield' function. */ | ||
#mesondefine HAVE_SCHED_YIELD | ||
|
||
/* Define to 1 if you have the <stdint.h> header file. */ | ||
#mesondefine HAVE_STDINT_H | ||
|
||
/* Define to 1 if you have the <stdlib.h> header file. */ | ||
#mesondefine HAVE_STDLIB_H | ||
|
||
/* Define to 1 if you have the <strings.h> header file. */ | ||
#mesondefine HAVE_STRINGS_H | ||
|
||
/* Define to 1 if you have the <string.h> header file. */ | ||
#mesondefine HAVE_STRING_H | ||
|
||
/* Define to 1 if you have the `strtoll' function. */ | ||
#mesondefine HAVE_STRTOLL | ||
|
||
/* Define to 1 if gcc's __sync builtins are available */ | ||
#mesondefine HAVE_SYNC_BUILTINS | ||
|
||
/* Define to 1 if you have the <sys/param.h> header file. */ | ||
#mesondefine HAVE_SYS_PARAM_H | ||
|
||
/* Define to 1 if you have the <sys/stat.h> header file. */ | ||
#mesondefine HAVE_SYS_STAT_H | ||
|
||
/* Define to 1 if you have the <sys/time.h> header file. */ | ||
#mesondefine HAVE_SYS_TIME_H | ||
|
||
/* Define to 1 if you have the <sys/types.h> header file. */ | ||
#mesondefine HAVE_SYS_TYPES_H | ||
|
||
/* Define to 1 if you have the <unistd.h> header file. */ | ||
#mesondefine HAVE_UNISTD_H | ||
|
||
/* Define to 1 if the system has the type 'unsigned long long int'. */ | ||
#mesondefine HAVE_UNSIGNED_LONG_LONG_INT | ||
|
||
/* Number of buckets new object hashtables contain is 2 raised to this power. | ||
E.g. 3 -> 2^3 = 8. */ | ||
#mesondefine INITIAL_HASHTABLE_ORDER | ||
|
||
/* Define to the sub-directory where libtool stores uninstalled libraries. */ | ||
#mesondefine LT_OBJDIR | ||
|
||
/* Name of package */ | ||
#mesondefine PACKAGE | ||
|
||
/* Define to the address where bug reports for this package should be sent. */ | ||
#mesondefine PACKAGE_BUGREPORT | ||
|
||
/* Define to the full name of this package. */ | ||
#mesondefine PACKAGE_NAME | ||
|
||
/* Define to the full name and version of this package. */ | ||
#mesondefine PACKAGE_STRING | ||
|
||
/* Define to the one symbol short name of this package. */ | ||
#mesondefine PACKAGE_TARNAME | ||
|
||
/* Define to the home page for this package. */ | ||
#mesondefine PACKAGE_URL | ||
|
||
/* Define to the version of this package. */ | ||
#mesondefine PACKAGE_VERSION | ||
|
||
/* Define to 1 if you have the ANSI C header files. */ | ||
#mesondefine STDC_HEADERS | ||
|
||
/* Define to 1 if /dev/urandom should be used for seeding the hash function */ | ||
#mesondefine USE_URANDOM | ||
|
||
/* Define to 1 if CryptGenRandom should be used for seeding the hash function | ||
*/ | ||
#mesondefine USE_WINDOWS_CRYPTOAPI | ||
|
||
/* Version number of package */ | ||
#mesondefine VERSION | ||
|
||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, | ||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the | ||
#define below would cause a syntax error. */ | ||
#mesondefine _UINT32_T | ||
|
||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, | ||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the | ||
#define below would cause a syntax error. */ | ||
#mesondefine _UINT8_T | ||
|
||
/* Define to `__inline__' or `__inline' if that's what the C compiler | ||
calls it, or to nothing if 'inline' is not supported under any name. */ | ||
#ifndef __cplusplus | ||
#mesondefine inline | ||
#endif | ||
|
||
/* Define to the type of a signed integer type of width exactly 32 bits if | ||
such a type exists and the standard includes do not define it. */ | ||
#mesondefine int32_t | ||
|
||
/* Define to the type of an unsigned integer type of width exactly 16 bits if | ||
such a type exists and the standard includes do not define it. */ | ||
#mesondefine uint16_t | ||
|
||
/* Define to the type of an unsigned integer type of width exactly 32 bits if | ||
such a type exists and the standard includes do not define it. */ | ||
#mesondefine uint32_t | ||
|
||
/* Define to the type of an unsigned integer type of width exactly 8 bits if | ||
such a type exists and the standard includes do not define it. */ | ||
#mesondefine uint8_t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
project('jansson', 'c', version : '2.11', license : 'MIT') | ||
|
||
cc = meson.get_compiler('c') | ||
cdata = configuration_data() | ||
check_headers = [ | ||
['HAVE_DLFCN_H', 'dlfcn.h'], | ||
['HAVE_ENDIAN_H', 'endian.h'], | ||
['HAVE_FCNTL_H', 'fcntl.h'], | ||
['HAVE_INTTYPES_H', 'inttypes.h'], | ||
['HAVE_LOCALE_H', 'locale.h'], | ||
['HAVE_MEMORY_H', 'memory.h'], | ||
['HAVE_SCHED_H', 'sched.h'], | ||
['HAVE_STDINT_H', 'stdint.h'], | ||
['HAVE_STDLIB_H', 'stdlib.h'], | ||
['HAVE_STRINGS_H', 'strings.h'], | ||
['HAVE_STRING_H', 'string.h'], | ||
['HAVE_SYS_PARAM_H', 'sys/param.h'], | ||
['HAVE_SYS_STAT_H', 'sys/stat.h'], | ||
['HAVE_SYS_TIME_H', 'sys/time.h'], | ||
['HAVE_SYS_TYPES_H', 'sys/types.h'], | ||
['HAVE_UNISTD_H', 'unistd.h'], | ||
] | ||
|
||
foreach h : check_headers | ||
if cc.has_header(h.get(1)) | ||
cdata.set(h.get(0), 1) | ||
endif | ||
endforeach | ||
|
||
check_functions = [ | ||
# check token ('HAVE_ATOMIC_BUILTINS',) | ||
# check token ('HAVE_CLOSE',) | ||
['HAVE_GETPID', 'getpid', '#include<unistd.h>'], | ||
['HAVE_GETTIMEOFDAY', 'gettimeofday', '#include<sys/time.h>'], | ||
# check token ('HAVE_LOCALECONV',) | ||
# check token ('HAVE_LONG_LONG_INT',) | ||
# check token ('HAVE_OPEN',) | ||
# check token ('HAVE_READ',) | ||
# check token ('HAVE_SCHED_YIELD',) | ||
['HAVE_STRTOLL', 'strtoll', '#include<stdlib.h>'], | ||
# check token ('HAVE_SYNC_BUILTINS',) | ||
# check token ('HAVE_UNSIGNED_LONG_LONG_INT',) | ||
] | ||
|
||
foreach f : check_functions | ||
if cc.has_function(f.get(1), prefix : f.get(2)) | ||
cdata.set(f.get(0), 1) | ||
endif | ||
endforeach | ||
|
||
# FIXME: These variables set features to be explicitly disabled. The tests for | ||
# these are missing from the check_functions block above and are also prefixed | ||
# by 'json_'. Also these are used by an extra 'src/jansson_config.h.in' file. | ||
# This means we may miss out on some platform specific performance improvemnts. | ||
cdata.set('var', 'var') # avoid warning; bogus variable found in comment. | ||
cdata.set('json_inline', '') | ||
cdata.set('json_have_long_long', 0) | ||
cdata.set('json_have_localeconv', 0) | ||
cdata.set('json_have_atomic_builtins', 0) | ||
cdata.set('json_have_sync_builtins', 0) | ||
|
||
configure_file(input : 'config.h.meson', | ||
output : 'jansson_private_config.h', | ||
configuration : cdata) | ||
|
||
configure_file(input : 'src/jansson_config.h.in', | ||
output : 'jansson_config.h', | ||
configuration : cdata) | ||
|
||
jansson_lib = library('jansson', | ||
'src/dump.c', | ||
'src/error.c', | ||
'src/hashtable.c', | ||
'src/hashtable_seed.c', | ||
'src/load.c', | ||
'src/memory.c', | ||
'src/pack_unpack.c', | ||
'src/strbuffer.c', | ||
'src/strconv.c', | ||
'src/utf.c', | ||
'src/value.c', | ||
c_args : '-DHAVE_CONFIG_H' | ||
) | ||
|
||
jansson_dep = declare_dependency( | ||
link_with : jansson_lib, | ||
include_directories : include_directories('src') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[wrap-file] | ||
directory = jansson-2.11 | ||
|
||
source_url = http://www.digip.org/jansson/releases/jansson-2.11.tar.bz2 | ||
source_filename = jansson-2.11.tar.bz2 | ||
source_hash = 783132e2fc970feefc2fa54199ef65ee020bd8e0e991a78ea44b8586353a0947 |