forked from fkie-cad/libdesock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
84 lines (76 loc) · 2.1 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
project('libdesock', 'c', license: 'MIT', version: '1.1')
if get_option('interpreter') == ''
r = run_command('sh', '-c', 'readelf -l /bin/ls | grep "program interpreter" | cut -d: -f2 | sed -e "s/^.//" -e "s/.$//"', check: true)
interpreter = r.stdout().strip()
else
interpreter = get_option('interpreter')
endif
args = [
'-O2',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-sign-compare',
'-Wno-discarded-qualifiers',
'-fvisibility=hidden',
'-D DESOCKARCH="@0@"'.format(get_option('arch')),
'-D MAX_CONNS=1',
'-D FD_TABLE_SIZE=@0@'.format(get_option('fd_table_size')),
'-D INTERPRETER="@0@"'.format(interpreter)
]
if get_option('debug_desock')
args += '-D DEBUG'
endif
if get_option('desock_client')
args += '-D DESOCK_CONNECT'
endif
if get_option('desock_server')
args += '-D DESOCK_BIND'
endif
sources = [
'libdesock/src/accept.c',
'libdesock/src/bind.c',
'libdesock/src/close.c',
'libdesock/src/connect.c',
'libdesock/src/desock.c',
'libdesock/src/dup.c',
'libdesock/src/epoll.c',
'libdesock/src/getpeername.c',
'libdesock/src/getsockname.c',
'libdesock/src/listen.c',
'libdesock/src/peekbuffer.c',
'libdesock/src/poll.c',
'libdesock/src/read.c',
'libdesock/src/select.c',
'libdesock/src/sendfile.c',
'libdesock/src/shutdown.c',
'libdesock/src/socket.c',
'libdesock/src/sockopt.c',
'libdesock/src/syscall.c',
'libdesock/src/write.c',
'libdesock/src/hooks.c',
]
include_directories = [
include_directories('libdesock/include'),
include_directories('libdesock/include/arch/' + get_option('arch'))
]
shared_library('desock',
sources : sources,
include_directories : include_directories,
c_args : args,
link_args : '-Wl,-e,desock_main',
install : false,
dependencies : [
dependency('threads')
]
)
static_library('desock',
sources : sources,
include_directories : include_directories,
c_args : args,
link_args : '-Wl,-e,desock_main',
install : false,
dependencies : [
dependency('threads')
]
)