aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-09-23 12:08:42 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-09-23 12:08:42 +0200
commite18ad2888560927947668820de50638c7a526116 (patch)
treebc727a2e67f252e9e93cf671f89345fd12dfe6a4 /meson.build
parente73c63f2878aff47d2a72d45bfa7fa7cbd6970be (diff)
downloadgnunet-e18ad2888560927947668820de50638c7a526116.tar.gz
gnunet-e18ad2888560927947668820de50638c7a526116.zip
BUILD: use check_header
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build55
1 files changed, 50 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index a827c1796..17ce5cea1 100644
--- a/meson.build
+++ b/meson.build
@@ -114,7 +114,7 @@ mhd_dep = dependency('libmicrohttpd', required : false)
114if not mhd_dep.found() 114if not mhd_dep.found()
115 mhd_dep = cc.find_library('microhttpd', required : true) 115 mhd_dep = cc.find_library('microhttpd', required : true)
116endif 116endif
117json_dep = dependency('libjansson', required : false) 117json_dep = dependency('jansson', required : false)
118if not json_dep.found() 118if not json_dep.found()
119 json_dep = cc.find_library('jansson', required : true) 119 json_dep = cc.find_library('jansson', required : true)
120endif 120endif
@@ -129,7 +129,7 @@ if not gnutls_dep.found()
129 gnutls_dep = cc.find_library('gnutls-dane', required : true) 129 gnutls_dep = cc.find_library('gnutls-dane', required : true)
130 endif 130 endif
131endif 131endif
132sodium_dep = dependency('libsodium', required : false) 132sodium_dep = dependency('libsodium', required : false, version: '>=1.0.18')
133if not sodium_dep.found() 133if not sodium_dep.found()
134 sodium_dep = cc.find_library('sodium', required : true) 134 sodium_dep = cc.find_library('sodium', required : true)
135endif 135endif
@@ -175,6 +175,10 @@ if ssh_bin.found()
175 add_project_arguments('-DHAVE_SSH_BINARY', language : 'c') 175 add_project_arguments('-DHAVE_SSH_BINARY', language : 'c')
176endif 176endif
177 177
178# FIXME we are not doing anything with this right now
179sudo_bin = find_program('sudo', '/usr/bin/sudo', required : false)
180doas_bin = find_program('doas', '/usr/bin/doas', required : false)
181
178# Optional dependencies 182# Optional dependencies
179 183
180# FIXME: I think we wanted to retire mysql support 184# FIXME: I think we wanted to retire mysql support
@@ -200,6 +204,43 @@ if zbar_dep.found()
200 add_project_arguments('-DHAVE_ZBAR', language : 'c') 204 add_project_arguments('-DHAVE_ZBAR', language : 'c')
201endif 205endif
202 206
207## FIXME conversation: pulse/gst detection in configure.ac obviously
208## broken. Needs reconsideration. No idea for now.
209pulse_dep = dependency('libpulse', required : false)
210if not pulse_dep.found()
211 pulse_dep = cc.find_library('pulse', required : false)
212endif
213if pulse_dep.found()
214 add_project_arguments('-DHAVE_PULSE', language : 'c')
215endif
216
217opus_dep = dependency('libopus', required : false)
218if not opus_dep.found()
219 opus_dep = cc.find_library('opus', required : false)
220endif
221if opus_dep.found()
222 add_project_arguments('-DHAVE_OPUS', language : 'c')
223endif
224
225ogg_dep = dependency('libogg', required : false)
226if not ogg_dep.found()
227 ogg_dep = cc.find_library('ogg', required : false)
228endif
229if ogg_dep.found()
230 add_project_arguments('-DHAVE_OGG', language : 'c')
231endif
232
233if pulse_dep.found() or ogg_dep.found() or opus_dep.found()
234 gst_dep = dependency('libgst', required : false)
235 if not gst_dep.found()
236 gst_dep = cc.find_library('gstreamer', required : false)
237 endif
238 if gst_dep.found()
239 add_project_arguments('-DHAVE_GST', language : 'c')
240 endif
241endif
242## END conversation
243
203gnunetdeps = [mhd_dep, 244gnunetdeps = [mhd_dep,
204 sodium_dep, 245 sodium_dep,
205 gcrypt_dep, 246 gcrypt_dep,
@@ -213,16 +254,20 @@ gnunetdeps = [mhd_dep,
213 254
214add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c') 255add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c')
215 256
216if cc.has_header('sys/time.h') 257if cc.check_header('sys/time.h')
217 add_project_arguments('-DHAVE_SYS_TIME_H', language : 'c') 258 add_project_arguments('-DHAVE_SYS_TIME_H', language : 'c')
218endif 259endif
219if cc.has_header('sys/param.h') 260if cc.check_header('sys/param.h')
220 add_project_arguments('-DHAVE_SYS_PARAM_H', language : 'c') 261 add_project_arguments('-DHAVE_SYS_PARAM_H', language : 'c')
221endif 262endif
222 263
264# NSS
265if cc.check_header('nss.h')
266 add_project_arguments('-DHAVE_GLIBCNSS', language : 'c')
267endif
223 268
224# GNUTLS DANE 269# GNUTLS DANE
225if cc.has_header('gnutls/dane.h') 270if cc.check_header('gnutls/dane.h')
226 if cc.has_function('dane_verify_crt_raw', 271 if cc.has_function('dane_verify_crt_raw',
227 prefix: '#include <gnutls/dane.h>', 272 prefix: '#include <gnutls/dane.h>',
228 dependencies: gnutls_dep) 273 dependencies: gnutls_dep)