diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-09-23 12:08:42 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-09-23 12:08:42 +0200 |
commit | e18ad2888560927947668820de50638c7a526116 (patch) | |
tree | bc727a2e67f252e9e93cf671f89345fd12dfe6a4 /meson.build | |
parent | e73c63f2878aff47d2a72d45bfa7fa7cbd6970be (diff) | |
download | gnunet-e18ad2888560927947668820de50638c7a526116.tar.gz gnunet-e18ad2888560927947668820de50638c7a526116.zip |
BUILD: use check_header
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 55 |
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) | |||
114 | if not mhd_dep.found() | 114 | if not mhd_dep.found() |
115 | mhd_dep = cc.find_library('microhttpd', required : true) | 115 | mhd_dep = cc.find_library('microhttpd', required : true) |
116 | endif | 116 | endif |
117 | json_dep = dependency('libjansson', required : false) | 117 | json_dep = dependency('jansson', required : false) |
118 | if not json_dep.found() | 118 | if not json_dep.found() |
119 | json_dep = cc.find_library('jansson', required : true) | 119 | json_dep = cc.find_library('jansson', required : true) |
120 | endif | 120 | endif |
@@ -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 |
131 | endif | 131 | endif |
132 | sodium_dep = dependency('libsodium', required : false) | 132 | sodium_dep = dependency('libsodium', required : false, version: '>=1.0.18') |
133 | if not sodium_dep.found() | 133 | if not sodium_dep.found() |
134 | sodium_dep = cc.find_library('sodium', required : true) | 134 | sodium_dep = cc.find_library('sodium', required : true) |
135 | endif | 135 | endif |
@@ -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') |
176 | endif | 176 | endif |
177 | 177 | ||
178 | # FIXME we are not doing anything with this right now | ||
179 | sudo_bin = find_program('sudo', '/usr/bin/sudo', required : false) | ||
180 | doas_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') |
201 | endif | 205 | endif |
202 | 206 | ||
207 | ## FIXME conversation: pulse/gst detection in configure.ac obviously | ||
208 | ## broken. Needs reconsideration. No idea for now. | ||
209 | pulse_dep = dependency('libpulse', required : false) | ||
210 | if not pulse_dep.found() | ||
211 | pulse_dep = cc.find_library('pulse', required : false) | ||
212 | endif | ||
213 | if pulse_dep.found() | ||
214 | add_project_arguments('-DHAVE_PULSE', language : 'c') | ||
215 | endif | ||
216 | |||
217 | opus_dep = dependency('libopus', required : false) | ||
218 | if not opus_dep.found() | ||
219 | opus_dep = cc.find_library('opus', required : false) | ||
220 | endif | ||
221 | if opus_dep.found() | ||
222 | add_project_arguments('-DHAVE_OPUS', language : 'c') | ||
223 | endif | ||
224 | |||
225 | ogg_dep = dependency('libogg', required : false) | ||
226 | if not ogg_dep.found() | ||
227 | ogg_dep = cc.find_library('ogg', required : false) | ||
228 | endif | ||
229 | if ogg_dep.found() | ||
230 | add_project_arguments('-DHAVE_OGG', language : 'c') | ||
231 | endif | ||
232 | |||
233 | if 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 | ||
241 | endif | ||
242 | ## END conversation | ||
243 | |||
203 | gnunetdeps = [mhd_dep, | 244 | gnunetdeps = [mhd_dep, |
204 | sodium_dep, | 245 | sodium_dep, |
205 | gcrypt_dep, | 246 | gcrypt_dep, |
@@ -213,16 +254,20 @@ gnunetdeps = [mhd_dep, | |||
213 | 254 | ||
214 | add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c') | 255 | add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c') |
215 | 256 | ||
216 | if cc.has_header('sys/time.h') | 257 | if 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') |
218 | endif | 259 | endif |
219 | if cc.has_header('sys/param.h') | 260 | if 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') |
221 | endif | 262 | endif |
222 | 263 | ||
264 | # NSS | ||
265 | if cc.check_header('nss.h') | ||
266 | add_project_arguments('-DHAVE_GLIBCNSS', language : 'c') | ||
267 | endif | ||
223 | 268 | ||
224 | # GNUTLS DANE | 269 | # GNUTLS DANE |
225 | if cc.has_header('gnutls/dane.h') | 270 | if 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) |