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
|
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)
if tang.found() and kgen.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
asciidoctor = find_program('asciidoctor', required: false)
if asciidoctor.found()
custom_target('check_tang.1',
command: [asciidoctor, '--attribute', 'reproducible', '--backend=manpage', '-D', meson.current_build_dir(), '@INPUT@', '-o', '@OUTPUT@' ],
install_dir: join_paths(get_option('mandir'), 'man1'),
input: 'nagios-tang.1.adoc',
output: 'check_tang.1',
install: true,
)
else
warning('Will not install man page due to missing dependencies!')
endif
executable('check_tang', 'tang.c',
install_dir: join_paths('lib', 'nagios', 'plugins'),
dependencies: [http, jose],
install: true,
)
|