diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 97 |
1 files changed, 83 insertions, 14 deletions
diff --git a/meson.build b/meson.build index f411a71aa..b3bb62fac 100644 --- a/meson.build +++ b/meson.build | |||
@@ -1,6 +1,6 @@ | |||
1 | ## EXPERIMENTAL --- WORK IN PROGRESS --- USE AT YOUR OWN PERIL --- ## | 1 | ## EXPERIMENTAL --- WORK IN PROGRESS --- USE AT YOUR OWN PERIL --- ## |
2 | project('gnunet', 'c', license: 'AGPLv3', | 2 | project('gnunet', 'c', license: 'AGPLv3', |
3 | version: run_command('sh', 'contrib/get_version.sh', check: true).stdout().strip()) | 3 | version: run_command('sh', 'scripts/get_version.sh', check: true).stdout().strip()) |
4 | 4 | ||
5 | add_project_arguments('-D_GNU_SOURCE', language : 'c') | 5 | add_project_arguments('-D_GNU_SOURCE', language : 'c') |
6 | 6 | ||
@@ -9,13 +9,13 @@ incdir = include_directories('src/include') | |||
9 | cdata = configuration_data() | 9 | cdata = configuration_data() |
10 | 10 | ||
11 | # Version | 11 | # Version |
12 | gnunet_version = run_command('sh', 'contrib/get_version.sh', check: true).stdout().strip() | 12 | gnunet_version = run_command('sh', 'scripts/get_version.sh', check: true).stdout().strip() |
13 | cdata.set('gnunet_version', gnunet_version) | 13 | cdata.set('gnunet_version', gnunet_version) |
14 | r = run_command('sh', 'contrib/get_version.sh', '--major', check: true) | 14 | r = run_command('sh', 'scripts/get_version.sh', '--major', check: true) |
15 | cdata.set('gnunet_major_version', r.stdout().strip()) | 15 | cdata.set('gnunet_major_version', r.stdout().strip()) |
16 | r = run_command('sh', 'contrib/get_version.sh', '--minor', check: true) | 16 | r = run_command('sh', 'scripts/get_version.sh', '--minor', check: true) |
17 | cdata.set('gnunet_minor_version', r.stdout().strip()) | 17 | cdata.set('gnunet_minor_version', r.stdout().strip()) |
18 | r = run_command('sh', 'contrib/get_version.sh', '--micro', check: true) | 18 | r = run_command('sh', 'scripts/get_version.sh', '--micro', check: true) |
19 | cdata.set('gnunet_micro_version', r.stdout().strip()) | 19 | cdata.set('gnunet_micro_version', r.stdout().strip()) |
20 | 20 | ||
21 | pkgcfgdir = get_option('datadir')/'gnunet'/'config.d' | 21 | pkgcfgdir = get_option('datadir')/'gnunet'/'config.d' |
@@ -24,6 +24,22 @@ docdir = get_option('datadir')/'doc'/'gnunet' | |||
24 | install_emptydir(docdir) | 24 | install_emptydir(docdir) |
25 | install_data('README', 'COPYING', install_dir: docdir) | 25 | install_data('README', 'COPYING', install_dir: docdir) |
26 | 26 | ||
27 | gnunet_user = false | ||
28 | getent_bin = find_program('getent', '/usr/bin/getent', required : false) | ||
29 | if getent_bin.found() | ||
30 | gnunet_user = true | ||
31 | if not run_command('getent', 'passwd', 'gnunet', check: false).returncode() == 0 | ||
32 | gnunet_user = false | ||
33 | endif | ||
34 | if not run_command('getent', 'group', 'gnunet', check: false).returncode() == 0 | ||
35 | gnunet_user = false | ||
36 | endif | ||
37 | if not run_command('getent', 'group', 'gnunetdns', check: false).returncode() == 0 | ||
38 | gnunet_user = false | ||
39 | endif | ||
40 | endif | ||
41 | |||
42 | |||
27 | # TODO: Set to true to build a single libgnunet | 43 | # TODO: Set to true to build a single libgnunet |
28 | if get_option('monolith') | 44 | if get_option('monolith') |
29 | add_project_arguments('-DHAVE_GNUNET_MONOLITH', language: 'c') | 45 | add_project_arguments('-DHAVE_GNUNET_MONOLITH', language: 'c') |
@@ -189,6 +205,23 @@ if gopt_bin.found() | |||
189 | add_project_arguments('-DHAVE_GETOPT_BINARY='+gopt_bin.full_path(), language : 'c') | 205 | add_project_arguments('-DHAVE_GETOPT_BINARY='+gopt_bin.full_path(), language : 'c') |
190 | endif | 206 | endif |
191 | 207 | ||
208 | ifconfig_bin = find_program('ifconfig', '/usr/sbin/ifconfig', required : false) | ||
209 | if ifconfig_bin.found() | ||
210 | cdata.set_quoted('IFCONFIG', ifconfig_bin.full_path()) | ||
211 | endif | ||
212 | |||
213 | ip_bin = find_program('ip', '/usr/sbin/ip', required : false) | ||
214 | if ip_bin.found() | ||
215 | cdata.set_quoted('PATH_TO_IP', ip_bin.full_path()) | ||
216 | endif | ||
217 | |||
218 | iptables_bin = find_program('iptables', '/usr/sbin/iptables', required : false) | ||
219 | if iptables_bin.found() | ||
220 | cdata.set_quoted('IPTABLES', iptables_bin.full_path()) | ||
221 | endif | ||
222 | |||
223 | adduser_bin = find_program('adduser', '/usr/sbin/adduser', required : false) | ||
224 | |||
192 | pkgc_bin = find_program('pkg-config', '/usr/bin/pkg-config', required : false) | 225 | pkgc_bin = find_program('pkg-config', '/usr/bin/pkg-config', required : false) |
193 | if pkgc_bin.found() | 226 | if pkgc_bin.found() |
194 | add_project_arguments('-DHAVE_PKG_CONFIG', language : 'c') | 227 | add_project_arguments('-DHAVE_PKG_CONFIG', language : 'c') |
@@ -253,14 +286,19 @@ if ogg_dep.found() | |||
253 | add_project_arguments('-DHAVE_OGG', language : 'c') | 286 | add_project_arguments('-DHAVE_OGG', language : 'c') |
254 | endif | 287 | endif |
255 | 288 | ||
256 | if pulse_dep.found() or ogg_dep.found() or opus_dep.found() | 289 | gst_dep = dependency('libgst', required : false) |
257 | gst_dep = dependency('libgst', required : false) | 290 | if not gst_dep.found() |
258 | if not gst_dep.found() | 291 | gst_dep = cc.find_library('gstreamer', required : false) |
259 | gst_dep = cc.find_library('gstreamer', required : false) | 292 | endif |
260 | endif | 293 | if gst_dep.found() |
261 | if gst_dep.found() | 294 | add_project_arguments('-DHAVE_GST', language : 'c') |
262 | add_project_arguments('-DHAVE_GST', language : 'c') | 295 | endif |
263 | endif | 296 | |
297 | conversation_backend = 'none' | ||
298 | if pulse_dep.found() and opus_dep.found() and ogg_dep.found() | ||
299 | conversation_backend = 'pulse' | ||
300 | elif gst_dep.found() | ||
301 | conversation_backend = 'gst' | ||
264 | endif | 302 | endif |
265 | ## END conversation | 303 | ## END conversation |
266 | 304 | ||
@@ -359,7 +397,12 @@ endif | |||
359 | if cc.has_function('explicit_bzero') | 397 | if cc.has_function('explicit_bzero') |
360 | cdata.set('HAVE_EXPLICIT_BZERO', 1) | 398 | cdata.set('HAVE_EXPLICIT_BZERO', 1) |
361 | endif | 399 | endif |
362 | 400 | if cc.has_function('gethostbyname') | |
401 | cdata.set('HAVE_GETHOSTBYNAME', 1) | ||
402 | endif | ||
403 | if cc.has_function('gethostbyname2') | ||
404 | cdata.set('HAVE_GETHOSTBYNAME2', 1) | ||
405 | endif | ||
363 | 406 | ||
364 | configure_file(#input: 'gnunet_private_config.h.in', | 407 | configure_file(#input: 'gnunet_private_config.h.in', |
365 | output : 'gnunet_private_config.h', | 408 | output : 'gnunet_private_config.h', |
@@ -373,3 +416,29 @@ subdir('doc') | |||
373 | subdir('contrib') | 416 | subdir('contrib') |
374 | 417 | ||
375 | meson.add_dist_script('meson-dist-script') | 418 | meson.add_dist_script('meson-dist-script') |
419 | |||
420 | summary({'host': host_machine.system(), | ||
421 | 'prefix': get_option('prefix'), | ||
422 | 'compiler': cc.get_id(), | ||
423 | 'libdir': get_option('libdir'), | ||
424 | 'datadir': get_option('datadir'), | ||
425 | 'default interface': cdata.get('GNUNET_DEFAULT_INTERFACE'), | ||
426 | 'PostgreSQL': pq_dep.found(), | ||
427 | 'curl w/ gnutls': (cdata.get('curl_gnutls') == 1), | ||
428 | 'ifconfig': ifconfig_bin.found(), | ||
429 | 'iptables': iptables_bin.found() | ||
430 | }, section: 'Detected system') | ||
431 | |||
432 | if not gnunet_user | ||
433 | message('Please make sure NOW to create a user and group \'gnunet\' and additionally a group \'gnunetdns\'. Make sure that \'/var/lib/gnunet\' is owned (and writable) by user \'gnunet\'') | ||
434 | message('Each user of GNUnet should be added to the \'gnunet\' group') | ||
435 | if adduser_bin.found() and not gnunet_user | ||
436 | message('''Create the gnunet user and add users to the gnunetdns group, run: | ||
437 | # addgroup gnunetdns | ||
438 | # adduser --system --disabled-login --home /var/lib/gnunet gnunet''') | ||
439 | message('''To add users to the gnunet group, run: | ||
440 | # adduser USERNAME gnunet | ||
441 | for each of your users, replacing \'USERNAME\' with the respective login name. | ||
442 | Users may have to login again for the changes to take effect.''') | ||
443 | endif | ||
444 | endif | ||