aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build97
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 --- ##
2project('gnunet', 'c', license: 'AGPLv3', 2project('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
5add_project_arguments('-D_GNU_SOURCE', language : 'c') 5add_project_arguments('-D_GNU_SOURCE', language : 'c')
6 6
@@ -9,13 +9,13 @@ incdir = include_directories('src/include')
9cdata = configuration_data() 9cdata = configuration_data()
10 10
11# Version 11# Version
12gnunet_version = run_command('sh', 'contrib/get_version.sh', check: true).stdout().strip() 12gnunet_version = run_command('sh', 'scripts/get_version.sh', check: true).stdout().strip()
13cdata.set('gnunet_version', gnunet_version) 13cdata.set('gnunet_version', gnunet_version)
14r = run_command('sh', 'contrib/get_version.sh', '--major', check: true) 14r = run_command('sh', 'scripts/get_version.sh', '--major', check: true)
15cdata.set('gnunet_major_version', r.stdout().strip()) 15cdata.set('gnunet_major_version', r.stdout().strip())
16r = run_command('sh', 'contrib/get_version.sh', '--minor', check: true) 16r = run_command('sh', 'scripts/get_version.sh', '--minor', check: true)
17cdata.set('gnunet_minor_version', r.stdout().strip()) 17cdata.set('gnunet_minor_version', r.stdout().strip())
18r = run_command('sh', 'contrib/get_version.sh', '--micro', check: true) 18r = run_command('sh', 'scripts/get_version.sh', '--micro', check: true)
19cdata.set('gnunet_micro_version', r.stdout().strip()) 19cdata.set('gnunet_micro_version', r.stdout().strip())
20 20
21pkgcfgdir = get_option('datadir')/'gnunet'/'config.d' 21pkgcfgdir = get_option('datadir')/'gnunet'/'config.d'
@@ -24,6 +24,22 @@ docdir = get_option('datadir')/'doc'/'gnunet'
24install_emptydir(docdir) 24install_emptydir(docdir)
25install_data('README', 'COPYING', install_dir: docdir) 25install_data('README', 'COPYING', install_dir: docdir)
26 26
27gnunet_user = false
28getent_bin = find_program('getent', '/usr/bin/getent', required : false)
29if 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
40endif
41
42
27# TODO: Set to true to build a single libgnunet 43# TODO: Set to true to build a single libgnunet
28if get_option('monolith') 44if 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')
190endif 206endif
191 207
208ifconfig_bin = find_program('ifconfig', '/usr/sbin/ifconfig', required : false)
209if ifconfig_bin.found()
210 cdata.set_quoted('IFCONFIG', ifconfig_bin.full_path())
211endif
212
213ip_bin = find_program('ip', '/usr/sbin/ip', required : false)
214if ip_bin.found()
215 cdata.set_quoted('PATH_TO_IP', ip_bin.full_path())
216endif
217
218iptables_bin = find_program('iptables', '/usr/sbin/iptables', required : false)
219if iptables_bin.found()
220 cdata.set_quoted('IPTABLES', iptables_bin.full_path())
221endif
222
223adduser_bin = find_program('adduser', '/usr/sbin/adduser', required : false)
224
192pkgc_bin = find_program('pkg-config', '/usr/bin/pkg-config', required : false) 225pkgc_bin = find_program('pkg-config', '/usr/bin/pkg-config', required : false)
193if pkgc_bin.found() 226if 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')
254endif 287endif
255 288
256if pulse_dep.found() or ogg_dep.found() or opus_dep.found() 289gst_dep = dependency('libgst', required : false)
257 gst_dep = dependency('libgst', required : false) 290if 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) 292endif
260 endif 293if gst_dep.found()
261 if gst_dep.found() 294 add_project_arguments('-DHAVE_GST', language : 'c')
262 add_project_arguments('-DHAVE_GST', language : 'c') 295endif
263 endif 296
297conversation_backend = 'none'
298if pulse_dep.found() and opus_dep.found() and ogg_dep.found()
299 conversation_backend = 'pulse'
300elif gst_dep.found()
301 conversation_backend = 'gst'
264endif 302endif
265## END conversation 303## END conversation
266 304
@@ -359,7 +397,12 @@ endif
359if cc.has_function('explicit_bzero') 397if cc.has_function('explicit_bzero')
360 cdata.set('HAVE_EXPLICIT_BZERO', 1) 398 cdata.set('HAVE_EXPLICIT_BZERO', 1)
361endif 399endif
362 400if cc.has_function('gethostbyname')
401 cdata.set('HAVE_GETHOSTBYNAME', 1)
402endif
403if cc.has_function('gethostbyname2')
404 cdata.set('HAVE_GETHOSTBYNAME2', 1)
405endif
363 406
364configure_file(#input: 'gnunet_private_config.h.in', 407configure_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')
373subdir('contrib') 416subdir('contrib')
374 417
375meson.add_dist_script('meson-dist-script') 418meson.add_dist_script('meson-dist-script')
419
420summary({'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
432if not gnunet_user
433message('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\'')
434message('Each user of GNUnet should be added to the \'gnunet\' group')
435if 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.''')
443endif
444endif