-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
81 lines (73 loc) · 2.12 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
project('nagios-tang', 'c', license: 'GPL3+', version: '7',
default_options: 'c_std=c99')
add_project_arguments(
'-Wall',
'-Wextra',
'-Werror',
'-Wstrict-aliasing',
'-Wchar-subscripts',
'-Wformat-security',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-prototypes',
'-Wtype-limits',
'-Wunused-function',
'-Wno-missing-field-initializers',
'-Wno-unused-command-line-argument',
'-Wno-unused-parameter',
'-Wno-unknown-pragmas',
language: 'c'
)
libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
http = meson.get_compiler('c').find_library('http_parser')
jose = dependency('jose', version: '>=8')
actv = find_program('systemd-socket-activate', required: false)
tang = find_program([
join_paths(libexecdir, 'tangd'),
'/usr/libexec/tangd',
'/usr/local/libexec/tangd',
], required: false)
kgen = find_program([
join_paths(libexecdir, 'tangd-keygen'),
'/usr/libexec/tangd-keygen',
'/usr/local/libexec/tangd-keygen',
], required: false)
updt = find_program([
join_paths(libexecdir, 'tangd-update'),
'/usr/libexec/tangd-update',
'/usr/local/libexec/tangd-update',
], required: false)
if tang.found() and kgen.found() and updt.found() and actv.found()
env = environment()
env.append('PATH',
meson.current_build_dir(),
libexecdir,
'/usr/libexec',
'/usr/local/libexec',
separator: ':'
)
test('tang', find_program(meson.current_source_dir() + '/tang'), env: env)
else
warning('Will not run tests due to missing dependencies!')
endif
a2x = find_program('a2x', required: false)
if a2x.found()
custom_target('nagios-tang.1',
command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
install_dir: join_paths(get_option('mandir'), 'man1'),
input: 'nagios-tang.1.adoc',
output: 'nagios-tang.1',
install: true,
)
else
warning('Will not install man page due to missing dependencies!')
endif
executable('tang', 'tang.c',
install_dir: join_paths(get_option('libdir'), 'nagios', 'plugins'),
dependencies: [http, jose],
install: true,
)