summaryrefslogtreecommitdiff
path: root/libfetch/meson.build
blob: 18124f74ba9cd8ece6ee6b19bdc42159e0fc3bf1 (plain) (blame)
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
libfetch_src = [
	'common.c',
	'fetch.c',
	'file.c',
	'ftp.c',
	'http.c',
	'openssl-compat.c'
]

errlist_generator = find_program('./errlist.sh')

ftperr_h = custom_target(
	'ftperr.h',
	capture: true,
	command: [errlist_generator, 'ftp_errlist', 'FTP', '@INPUT@'],
	output: 'ftperr.h',
	input: 'ftp.errors',
)

httperr_h = custom_target(
	'httpderr.h',
	capture: true,
	command: [errlist_generator, 'http_errlist', 'HTTP', '@INPUT@'],
	output: 'httperr.h',
	input: 'http.errors',
)

libfetch_src += [ftperr_h, httperr_h]

libfetch_cargs = [
	'-DCA_CERT_FILE="/' + apk_confdir / 'ca.pem"',
	'-DCA_CRL_FILE="/' + apk_confdir / 'crl.pem"',
	'-DCLIENT_CERT_FILE="/' + apk_confdir / 'cert.pem"',
	'-DCLIENT_KEY_FILE="/' + apk_confdir / 'cert.key"',
]

libfetch = static_library(
	'fetch',
	libfetch_src,
	c_args: libfetch_cargs,
	dependencies: static_deps,
)

libfetch_dep = declare_dependency(
	link_whole: libfetch,
	include_directories: include_directories('.'),
)