-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
95 lines (85 loc) · 1.77 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
project('mss-nfqws',
'c',
version: '3558e7c8',
license: 'MIT',
default_options: [
'buildtype=plain',
'c_std=gnu99'
]
)
add_global_arguments(
[
'-Wno-logical-op-parentheses',
'-fno-builtin',
],
language: 'c'
)
# deps
dep_libnetfilter_queue = dependency('libnetfilter_queue')
dep_zlib = dependency('zlib')
nfq_deps = [
dep_libnetfilter_queue,
dep_zlib
]
# src
crypto_src = [
'src/crypto/aes-gcm.c',
'src/crypto/aes.c',
'src/crypto/gcm.c',
'src/crypto/hkdf.c',
'src/crypto/hmac.c',
'src/crypto/sha224-256.c',
'src/crypto/usha.c'
]
nfq_src = [
'src/checksum.c',
'src/conntrack.c',
'src/darkmagic.c',
'src/desync.c',
'src/gzip.c',
'src/helpers.c',
'src/hostlist.c',
'src/nfqws.c',
'src/pools.c',
'src/protocol.c',
'src/sec.c'
]
# set bindir
openwrt = get_option('openwrt')
if openwrt
bindir = '/bin'
else
bindir = '/usr/bin'
endif
# build
crypto = static_library('crypto',
crypto_src,
install: false
)
executable('nfqws',
nfq_src,
dependencies: nfq_deps,
link_with: crypto,
install: true,
install_dir: bindir
)
# init script
openwrt = get_option('openwrt')
if openwrt
install_data(
'init.d/mss-nfqws',
install_dir: '/etc/init.d/'
)
else
install_data(
'systemd/mss-nfqws.service',
install_dir: '/usr/lib/systemd/system/'
)
install_data(
'systemd/nfqws-handler',
install_dir: '/usr/share/mss-nfqws'
)
endif
message('OPTS:')
message(' - openwrt: ', openwrt)
message(' - bindir: ', bindir)