| 1 |
# librist. Copyright (c) 2020 SipRadius LLC. All right reserved. |
| 2 |
# Author: Sergio Ammirata, Ph.D. <[email protected]> |
| 3 |
# SPDX-License-Identifier: BSD-2-Clause |
| 4 |
|
| 5 |
tools_dependencies = [] |
| 6 |
tools_deps = [] |
| 7 |
if host_machine.system() == 'windows' |
| 8 |
tools_deps += ['../contrib/getopt-shim.c'] |
| 9 |
tools_dependencies += [ cc.find_library('ws2_32') ] |
| 10 |
endif |
| 11 |
|
| 12 |
tools_deps += [ '../contrib/time-shim.c'] |
| 13 |
tools_deps += [ '../contrib/pthread-shim.c'] |
| 14 |
|
| 15 |
if filter_obj |
| 16 |
tools_deps += [objcopy_fake_file ] |
| 17 |
endif |
| 18 |
|
| 19 |
srp_shared = [] |
| 20 |
if have_srp |
| 21 |
srp_shared += 'srp_shared.c' |
| 22 |
tools_dependencies += crypto_deps |
| 23 |
endif |
| 24 |
|
| 25 |
#On ubuntu cjson does not come with pkgconfig files, hence the extended checking. |
| 26 |
if not builtin_cjson |
| 27 |
cjson_lib = dependency('libcjson', required: false) |
| 28 |
if not cjson_lib.found() |
| 29 |
cjson_lib = cc.find_library('cjson', required: required_library, has_headers: ['cjson/cJSON.h']) |
| 30 |
if not cjson_lib.found() |
| 31 |
builtin_cjson = true |
| 32 |
endif |
| 33 |
endif |
| 34 |
endif |
| 35 |
if builtin_cjson |
| 36 |
message('Using builtin cJSON library') |
| 37 |
cjson_lib = declare_dependency( compile_args : '-DCJSON_HIDE_SYMBOLS', |
| 38 |
sources: '../contrib/contrib_cJSON/cjson/cJSON.c', |
| 39 |
include_directories : include_directories('../contrib/contrib_cJSON')) |
| 40 |
endif |
| 41 |
|
| 42 |
if compile_prometheus |
| •43 |
prometheuslib = static_library('prometheus', 'prometheus-exporter.c', include_directories: inc) |
| 44 |
prometheus_dep = declare_dependency(link_with: prometheuslib, include_directories: include_directories('.'), dependencies: [microhttpd, cjson_lib]) |
| 45 |
tools_dependencies += prometheus_dep |
| 46 |
endif |
| 47 |
|
| 48 |
ristsender_exe = executable('ristsender', |
| 49 |
['ristsender.c', 'yamlparse.c', 'oob_shared.c', srp_shared, tools_deps, rev_target], |
| 50 |
dependencies: [ |
| 51 |
librist_dep, |
| 52 |
threads, |
| 53 |
stdatomic_dependency, |
| 54 |
tools_dependencies, |
| 55 |
cjson_lib, |
| 56 |
], |
| 57 |
include_directories: inc, |
| 58 |
install: should_install) |
| 59 |
|
| 60 |
ristreceiver_exe = executable('ristreceiver', |
| 61 |
['ristreceiver.c', 'yamlparse.c', 'oob_shared.c', srp_shared, tools_deps, rev_target], |
| 62 |
dependencies: [ |
| 63 |
librist_dep, |
| 64 |
tools_dependencies, |
| 65 |
threads, |
| 66 |
cjson_lib, |
| 67 |
], |
| 68 |
|
| 69 |
include_directories: inc, |
| 70 |
install: should_install) |
| 71 |
|
| 72 |
executable('rist2rist', |
| 73 |
['rist2rist.c', 'oob_shared.c', srp_shared, tools_deps, rev_target], |
| 74 |
dependencies: [ |
| 75 |
tools_dependencies, |
| 76 |
threads, |
| 77 |
librist_dep, |
| 78 |
cjson_lib, |
| 79 |
], |
| 80 |
include_directories: inc, |
| 81 |
install: should_install) |
| 82 |
|
| 83 |
executable('udp2udp', |
| 84 |
['udp2udp.c', 'yamlparse.c', 'oob_shared.c', srp_shared, tools_deps, rev_target], |
| 85 |
dependencies: [ |
| 86 |
tools_dependencies, |
| 87 |
threads, |
| 88 |
librist_dep, |
| 89 |
cjson_lib, |
| 90 |
], |
| 91 |
include_directories: inc, |
| 92 |
install: should_install) |
| 93 |
|
| 94 |
# risttunnel: IP tunnel over RIST (TUN support is now in librist) |
| 95 |
if host_machine.system() == 'linux' or host_machine.system() == 'darwin' or host_machine.system() == 'windows' |
| 96 |
executable('risttunnel', |
| 97 |
['risttunnel.c', srp_shared, tools_deps, rev_target], |
| 98 |
dependencies: [ |
| 99 |
librist_dep, |
| 100 |
tools_dependencies, |
| 101 |
threads, |
| 102 |
], |
| 103 |
include_directories: inc, |
| 104 |
install: should_install) |
| 105 |
endif |
| 106 |
|
| 107 |
if mbedcrypto_lib_found or use_nettle |
| 108 |
executable('ristsrppasswd', |
| 109 |
['ristsrppasswd.c', tools_deps], |
| 110 |
dependencies: [ |
| 111 |
librist_dep, |
| 112 |
crypto_deps, |
| 113 |
threads, |
| 114 |
], |
| 115 |
include_directories: inc, |
| 116 |
install: should_install) |
| 117 |
endif |