-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathmeson.build
More file actions
43 lines (38 loc) · 926 Bytes
/
meson.build
File metadata and controls
43 lines (38 loc) · 926 Bytes
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
src = ['common.c', 'fetch.c', 'file.c', 'ftp.c', 'http.c']
strnstr_code = '''
#include <string.h>
int main(void) {
const char big[] = "foo";
const char little[] = "f";
strnstr(big, little, 3);
return 0;
}
'''
enable_strnstr = []
CC = meson.get_compiler('c')
if CC.links(strnstr_code, name: 'strnstr() available')
enable_strnstr = '-DHAVE_STRNSTR'
endif
ftperr = custom_target(
'ftperr',
command: [files('errlist.sh'), 'ftp_errlist', 'FTP', '@INPUT@'],
capture: true,
input: 'ftp.errors',
output: 'ftperr.h',
)
httperr = custom_target(
'httperr',
command: [files('errlist.sh'), 'http_errlist', 'HTTP', '@INPUT@'],
capture: true,
input: 'http.errors',
output: 'httperr.h',
)
libfetch = static_library(
'fetch',
src,
ftperr,
httperr,
c_args: ['-DFTP_COMBINE_CWDS', '-DINET6', '-DWITH_SSL', enable_strnstr],
gnu_symbol_visibility: 'hidden',
include_directories: [xbps_include, '.'],
)