|
| 1 | +# SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 | +project( |
| 3 | + 'ell', 'c', |
| 4 | + version: '0.82', |
| 5 | + license: 'LGPL-2.1-or-later', |
| 6 | + default_options: [ |
| 7 | + 'default_library=shared' |
| 8 | + ], |
| 9 | + meson_version: '>= 1.3.0' |
| 10 | +) |
| 11 | + |
| 12 | +cc = meson.get_compiler('c') |
| 13 | +find_program('awk', required: true) |
| 14 | +config_h = configuration_data() |
| 15 | + |
| 16 | +checked_funcs = [ |
| 17 | + 'explicit_bzero', |
| 18 | + 'rawmemchr', |
| 19 | +] |
| 20 | + |
| 21 | +foreach func: checked_funcs |
| 22 | + config_h.set('HAVE_' + func.to_upper(), cc.has_function(func)) |
| 23 | +endforeach |
| 24 | + |
| 25 | +required_funcs = [ |
| 26 | + 'getrandom', |
| 27 | + 'signalfd', |
| 28 | + 'timerfd_create', |
| 29 | + 'epoll_create' |
| 30 | +] |
| 31 | + |
| 32 | +foreach func: required_funcs |
| 33 | + cc.has_function(func, required: true) |
| 34 | +endforeach |
| 35 | + |
| 36 | +required_headers = [ |
| 37 | + 'linux/types.h', |
| 38 | + 'linux/if_alg.h' |
| 39 | +] |
| 40 | + |
| 41 | +foreach header: required_headers |
| 42 | + cc.has_header(header, required: true) |
| 43 | +endforeach |
| 44 | + |
| 45 | +glib_dep = dependency('glib-2.0', version: '>= 2.32', required: get_option('glib')) |
| 46 | +openssl = find_program('openssl', required: get_option('cert-tests')) |
| 47 | +sh = find_program('sh', required: get_option('cert-tests')) |
| 48 | +xxd = find_program('xxd', required: get_option('cert-tests')) |
| 49 | + |
| 50 | +if openssl.found() |
| 51 | + r = run_command(openssl, 'list', '-providers', check: false) |
| 52 | + if r.returncode() == 0 |
| 53 | + openssl_legacy = [ '-provider', 'legacy', '-provider', 'default' ] |
| 54 | + else |
| 55 | + openssl_legacy = '' |
| 56 | + endif |
| 57 | +endif |
| 58 | + |
| 59 | +add_project_arguments('-DHAVE_CONFIG_H', language: 'c') |
| 60 | +configure_file( |
| 61 | + output: 'config.h', |
| 62 | + configuration: config_h |
| 63 | +) |
| 64 | + |
| 65 | +subdir('ell') |
| 66 | +subdir('tools') |
| 67 | +subdir('unit') |
| 68 | +subdir('examples') |
0 commit comments