/
meson.build
95 lines (84 loc) · 2 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
85
86
87
88
89
90
91
92
93
94
95
# Copyright (c) Iputils Project, 2017-2019
manpages = []
custom_man_xsl = files('custom-man.xsl')
custom_html_xsl = files('custom-html.xsl')
if build_arping == true
manpages += ['arping']
endif
if build_clockdiff == true
manpages += ['clockdiff']
endif
if build_ping == true
manpages += ['ping']
endif
if build_rdisc == true
manpages += ['rdisc']
endif
if build_tracepath == true
manpages += ['tracepath']
endif
xsltproc = find_program('xsltproc', required : build_mans or build_html_mans)
xsltproc_args = [
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'iputils.version', meson.project_version(),
]
if xsltproc.found()
doc_targets = []
if build_mans
doc_targets += ['manpages']
endif
if build_html_mans
doc_targets += ['html']
endif
xsltproc_works = true
foreach doc_target : doc_targets
xsl = 'http://docbook.sourceforge.net/release/xsl-ns/current/' + doc_target + '/docbook.xsl'
testrun = run_command([xsltproc, '--nonet', xsl])
if testrun.returncode() != 0
xsltproc_works = false
message('WARNING: xsltproc: cannot process ' + xsl)
endif
endforeach
endif
if xsltproc_works == false
message('Docs cannot be built: xsltproc does not work correctly')
build_mans = false
build_html_mans = false
endif
if build_mans
foreach man : manpages
custom_target(man + '.8',
output : man + '.8',
input : man + '.xml',
command : [
xsltproc,
'-o', '@OUTPUT@',
xsltproc_args,
custom_man_xsl,
'@INPUT@',
],
install : true,
install_dir : join_paths(get_option('mandir'), 'man8'),
)
endforeach
endif
if build_html_mans
foreach man : manpages
custom_target(man + '.html',
output : man + '.html',
input : man + '.xml',
command : [
xsltproc,
'-o', '@OUTPUT@',
xsltproc_args,
custom_html_xsl,
'@INPUT@',
],
install : true,
install_dir : join_paths(get_option('datadir'), meson.project_name()),
)
endforeach
endif