diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..c77833905 --- /dev/null +++ b/meson.build | |||
@@ -0,0 +1,63 @@ | |||
1 | ## EXPERIMENTAL --- WORK IN PROGRESS --- USE AT YOUR OWN PERIL --- ## | ||
2 | project('gnunet', 'c', license: 'AGPLv3', version: '0.21.0') | ||
3 | compiler = meson.get_compiler('c') | ||
4 | incdir = include_directories('src/include') | ||
5 | cdata = configuration_data() | ||
6 | |||
7 | # TODO: Set to true to build a single libgnunet | ||
8 | gnunet_monolith = false | ||
9 | |||
10 | message('Building on ' + host_machine.system()) | ||
11 | |||
12 | # TODO: | ||
13 | # - Go through configure.ac and convert all defines/detections | ||
14 | # - Compile all libs into a single libgnunet | ||
15 | |||
16 | # FIXME lots still missing | ||
17 | cdata.set_quoted('PACKAGE_VERSION', '0.21.0') | ||
18 | cdata.set_quoted('GNUNET_DEFAULT_INTERFACE', 'en0') | ||
19 | cdata.set_quoted('VCS_VERSION', 'mesonbuild') | ||
20 | add_project_arguments('-DHAVE_CONFIG_H', language : 'c') | ||
21 | |||
22 | |||
23 | # FIXME: Not all dependencies here yet | ||
24 | ltdl_dep = compiler.find_library('ltdl', required : true) | ||
25 | unistr_dep = compiler.find_library('unistring', required : true) | ||
26 | sqlite_dep = compiler.find_library('sqlite3', required : true) | ||
27 | curl_dep = dependency('libcurl') | ||
28 | zlib_dep = dependency('zlib') | ||
29 | mhd_dep = dependency('libmicrohttpd') | ||
30 | json_dep = compiler.find_library('jansson', required : true) | ||
31 | gnunetdeps = [mhd_dep, | ||
32 | dependency('libgcrypt'), | ||
33 | dependency('libsodium'), | ||
34 | curl_dep, | ||
35 | json_dep, | ||
36 | zlib_dep, | ||
37 | unistr_dep, #dependency('libunistring'), | ||
38 | ltdl_dep, #dependency('ltdl'), | ||
39 | dependency('libidn2')] | ||
40 | |||
41 | add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c') | ||
42 | |||
43 | if compiler.has_header('sys/time.h') | ||
44 | add_project_arguments('-DHAVE_SYS_TIME_H', language : 'c') | ||
45 | endif | ||
46 | |||
47 | if compiler.has_header('idn2.h') | ||
48 | add_project_arguments('-DHAVE_LIBIDN2', language : 'c') | ||
49 | add_project_arguments('-DHAVE_IDN2_H', language : 'c') | ||
50 | endif | ||
51 | |||
52 | |||
53 | if compiler.has_function('strnlen', prefix : '#include <string.h>') | ||
54 | # function exists, do whatever is required. | ||
55 | add_project_arguments('-DHAVE_STRNLEN', language : 'c') | ||
56 | endif | ||
57 | |||
58 | configure_file(#input: 'gnunet_private_config.h.in', | ||
59 | output : 'gnunet_private_config.h', | ||
60 | configuration : cdata) | ||
61 | configuration_inc = include_directories('.') | ||
62 | |||
63 | subdir('src') | ||