forked from iputils/iputils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
70 lines (55 loc) · 1.87 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
project('iputils', 'c',
version : '20170717') # version hardcoded
global_cflags = ['-D_GNU_SOURCE', '-O3', '-g', '-fno-strict-aliasing', '-Wstrict-prototypes', '-Wall']
add_project_arguments(global_cflags, language: 'c')
message('meson build is EXPERIMENTAL, please DO NOT USE for production!\n')
cc = meson.get_compiler('c')
m_dep = cc.find_library('m')
resolv_dep = cc.find_library('resolv')
rt_dep = cc.find_library('rt')
opt = get_option('USE_CAP')
if opt == true
cap_dep = cc.find_library('cap')
add_project_arguments('-DCAPABILITIES', language : 'c')
else
cap_dep = []
endif
opt = get_option('USE_IDN')
if opt == '1'
idn_dep = cc.find_library('idn')
add_project_arguments('-DUSE_IDN', language : 'c')
elif opt == '2'
idn_dep = cc.find_library('idn2', required : false)
message('libidn2 is unsupported at this moment.\n')
idn_dep = []
else
idn_dep = []
endif
opt = get_option('USE_CRYPTO')
if opt == 'nettle'
crypto_dep = dependency('nettle')
add_project_arguments('-DUSE_NETTLE', language : 'c')
elif opt == 'gcrypt'
crypto_dep = cc.find_library('gcrypt')
add_project_arguments('-DUSE_GCRYPT', language : 'c')
elif opt == 'openssl'
crypto_dep = dependency('openssl')
add_project_arguments('-DUSE_OPENSSL', language : 'c')
elif opt == 'none'
crypto_dep = []
endif
ping_src = ['ping.c', 'ping_common.c', 'ping6_common.c']
p = executable('ping', ping_src,
dependencies : [m_dep, cap_dep, idn_dep, crypto_dep, resolv_dep])
executable('tracepath', 'tracepath.c',
dependencies : idn_dep)
executable('traceroute6', 'traceroute6.c',
dependencies : [cap_dep, idn_dep])
executable('clockdiff', 'clockdiff.c',
dependencies : [cap_dep])
executable('rdisc', 'rdisc.c')
executable('arping', 'arping.c',
dependencies : [rt_dep, cap_dep, idn_dep])
executable('tftpd', ['tftpd.c', 'tftpsubs.c'])
executable('rarpd', 'rarpd.c')
#test('ping to 127.0.0.1', p, args : ['-p 1', '127.0.0.1'])