@@ -2,7 +2,7 @@ docs = []
2
2
alldocs = []
3
3
doc_generated = []
4
4
5
- xmllint = find_program (get_option (' XMLLINT' ), native : true , required : false )
5
+ xmllint_bin = find_program (get_option (' XMLLINT' ), native : true , required : false )
6
6
7
7
8
8
version_sgml = configure_file (
@@ -60,21 +60,31 @@ doc_generated += custom_target('keywords-table.sgml',
60
60
)
61
61
62
62
# For everything else we need at least xmllint
63
- if not xmllint .found()
63
+ if not xmllint_bin .found()
64
64
subdir_done ()
65
65
endif
66
66
67
67
pandoc = find_program (' pandoc' , native : true , required : false )
68
- xsltproc = find_program (get_option (' XSLTPROC' ), native : true , required : false )
68
+ xsltproc_bin = find_program (get_option (' XSLTPROC' ), native : true , required : false )
69
69
fop = find_program (' fop' , native : true , required : false )
70
70
71
+ xmltools_wrapper = [
72
+ python, files (' xmltools_dep_wrapper' ),
73
+ ' --targetname' , ' @OUTPUT@' , ' --depfile' , ' @DEPFILE@'
74
+ ]
75
+
76
+ xmllint = xmltools_wrapper + [
77
+ ' --tool' , xmllint_bin, ' --' ,
78
+ ]
79
+
71
80
# Run validation only once, common to all subsequent targets. While
72
81
# we're at it, also resolve all entities (that is, copy all included
73
82
# files into one big file). This helps tools that don't understand
74
83
# vpath builds (such as dbtoepub).
75
84
postgres_full_xml = custom_target (' postgres-full.xml' ,
76
85
input : ' postgres.sgml' ,
77
86
output : ' postgres-full.xml' ,
87
+ depfile : ' postgres-full.xml.d' ,
78
88
command : [xmllint, ' --noent' , ' --valid' , ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTPUT@' , ' @INPUT@' ],
79
89
depends : doc_generated,
80
90
build_by_default : false ,
@@ -86,18 +96,20 @@ alldocs += postgres_full_xml
86
96
#
87
97
# Full documentation as html, text
88
98
#
89
- if xsltproc .found()
99
+ if xsltproc_bin .found()
90
100
xsltproc_flags = [
91
101
' --stringparam' , ' pg.version' , pg_version,
92
102
' --param' , ' website.stylesheet' , ' 1'
93
103
]
94
104
105
+ xsltproc = xmltools_wrapper + [
106
+ ' --tool' , xsltproc_bin, ' --' ,
107
+ ]
95
108
96
- # FIXME: Should use a wrapper around xsltproc --load-trace to compute a
97
- # depfile
98
109
html = custom_target (' html' ,
99
110
input : [' stylesheet.xsl' , postgres_full_xml],
100
111
output : ' html' ,
112
+ depfile : ' html.d' ,
101
113
depends : doc_generated,
102
114
command : [xsltproc, ' -o' , ' @OUTDIR@/' , xsltproc_flags, ' @INPUT@' ],
103
115
build_by_default : false ,
@@ -110,6 +122,7 @@ if xsltproc.found()
110
122
html_help = custom_target (' html_help' ,
111
123
input : [' stylesheet-hh.xsl' , postgres_full_xml],
112
124
output : ' htmlhelp' ,
125
+ depfile : ' htmlhelp.d' ,
113
126
depends : doc_generated,
114
127
command : [xsltproc, ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTDIR@/' , xsltproc_flags, ' @INPUT@' ],
115
128
build_by_default : false ,
@@ -121,6 +134,7 @@ if xsltproc.found()
121
134
postgres_html = custom_target (' postgres.html' ,
122
135
input : [' stylesheet-html-nochunk.xsl' , postgres_full_xml],
123
136
output : ' postgres.html' ,
137
+ depfile : ' postgres.html.d' ,
124
138
depends : doc_generated,
125
139
command : [xsltproc, ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTPUT@' , xsltproc_flags, ' @INPUT@' ],
126
140
build_by_default : false ,
@@ -144,17 +158,19 @@ endif
144
158
#
145
159
# INSTALL in html, text
146
160
#
147
- if xsltproc .found()
161
+ if xsltproc_bin .found()
148
162
install_xml = custom_target (' INSTALL.xml' ,
149
163
input : [' standalone-profile.xsl' , ' standalone-install.xml' ],
150
164
output : ' INSTALL.xml' ,
165
+ depfile : ' INSTALL.xml.d' ,
151
166
depends : doc_generated + [postgres_full_xml],
152
167
command : [xsltproc, ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTPUT@' , xsltproc_flags, ' --xinclude' , ' @INPUT@' ],
153
168
build_by_default : false ,
154
169
)
155
170
install_html = custom_target (' INSTALL.html' ,
156
171
input : [' stylesheet-text.xsl' , install_xml],
157
172
output : ' INSTALL.html' ,
173
+ depfile : ' INSTALL.html.d' ,
158
174
command : [xsltproc, ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTPUT@' , xsltproc_flags, ' @INPUT@' ],
159
175
build_by_default : false ,
160
176
)
@@ -177,11 +193,12 @@ endif
177
193
#
178
194
# Man pages
179
195
#
180
- if xsltproc .found()
196
+ if xsltproc_bin .found()
181
197
# FIXME: implement / consider sqlmansectnum logic
182
198
man = custom_target (' man' ,
183
199
input : [' stylesheet-man.xsl' , postgres_full_xml],
184
200
output : [' man1' , ' man3' , ' man7' ],
201
+ depfile : ' man.d' ,
185
202
depends : doc_generated,
186
203
command : [xsltproc, ' --path' , ' @OUTDIR@' , ' -o' , ' @OUTDIR@/' , xsltproc_flags, ' @INPUT@' ],
187
204
build_by_default : false ,
@@ -195,17 +212,19 @@ endif
195
212
#
196
213
# Full documentation as PDF
197
214
#
198
- if fop.found() and xsltproc .found()
215
+ if fop.found() and xsltproc_bin .found()
199
216
xsltproc_fo_flags = xsltproc_flags + [' --stringparam' , ' img.src.path' , meson .current_source_dir() + ' /' ]
200
217
201
218
foreach format, detail : {' A4' : ' A4' , ' US' : ' USletter' }
202
219
postgres_x_fo_f = ' postgres-@0@.fo' .format(format)
220
+ postgres_x_fo_dep = ' postgres-@0@.fo.d' .format(format)
203
221
postgres_x_pdf_f = ' postgres-@0@.pdf' .format(format)
204
222
205
223
postgres_x_fo = custom_target (postgres_x_fo_f,
206
224
input : [' stylesheet-fo.xsl' , postgres_full_xml],
207
- output : [ postgres_x_fo_f] ,
225
+ output : postgres_x_fo_f,
208
226
depends : doc_generated,
227
+ depfile : postgres_x_fo_dep,
209
228
command : [xsltproc, ' --path' , ' @OUTDIR@/' , xsltproc_fo_flags,
210
229
' --stringparam' , ' paper.type' , detail,
211
230
' -o' , ' @OUTPUT@' , ' @INPUT@' ],
@@ -230,7 +249,7 @@ endif
230
249
# This was previously implemented using dbtoepub - but that doesn't seem to
231
250
# support running in build != source directory (i.e. VPATH builds already
232
251
# weren't supported).
233
- if pandoc.found() and xsltproc .found()
252
+ if pandoc.found() and xsltproc_bin .found()
234
253
postgres_epub = custom_target (' postgres.epub' ,
235
254
input : postgres_full_xml,
236
255
output : ' postgres.epub' ,
0 commit comments