diff options
author | Andres Freund | 2023-04-05 04:29:39 +0000 |
---|---|---|
committer | Andres Freund | 2023-04-05 04:29:39 +0000 |
commit | ef07d351a1860a6e93c89cc7af3ae13366942bf0 (patch) | |
tree | 790f3d304974f127c47f9a72e86914cb8adb2e5e /meson.build | |
parent | 0ba827ecfc677cb449b3a370cf6613b4a770c4f8 (diff) |
meson: add docs, docs_pdf options
Detect and report if the tools necessary to build documentation are available
during configure. This is represented as two new options 'docs' and
'docs_pdf', both defaulting to 'auto'.
This should also fix a meson error about the installdocs target, when none of
the doc tools are found.
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20230325201414.sh7c6xlut2fpunnv@awork3.anarazel.de
Discussion: https://postgr.es/m/ZB8331v5IhUA/pNu@telsasoft.com
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 84b60c8933c..b69aaddb1f8 100644 --- a/meson.build +++ b/meson.build @@ -341,6 +341,8 @@ program_zstd = find_program(get_option('ZSTD'), native: true, required: false) dtrace = find_program(get_option('DTRACE'), native: true, required: get_option('dtrace')) missing = find_program('config/missing', native: true) cp = find_program('cp', required: false, native: true) +xmllint_bin = find_program(get_option('XMLLINT'), native: true, required: false) +xsltproc_bin = find_program(get_option('XSLTPROC'), native: true, required: false) bison_flags = [] if bison.found() @@ -568,6 +570,39 @@ endif ############################################################### +# Option: docs in HTML and man page format +############################################################### + +docs_opt = get_option('docs') +docs_dep = not_found_dep +if not docs_opt.disabled() + if xmllint_bin.found() and xsltproc_bin.found() + docs_dep = declare_dependency() + elif docs_opt.enabled() + error('missing required tools for docs in HTML / man page format') + endif +endif + + + +############################################################### +# Option: docs in PDF format +############################################################### + +docs_pdf_opt = get_option('docs_pdf') +docs_pdf_dep = not_found_dep +if not docs_pdf_opt.disabled() + fop = find_program(get_option('FOP'), native: true, required: docs_pdf_opt) + if xmllint_bin.found() and xsltproc_bin.found() and fop.found() + docs_pdf_dep = declare_dependency() + elif docs_pdf_opt.enabled() + error('missing required tools for docs in PDF format') + endif +endif + + + +############################################################### # Library: GSSAPI ############################################################### @@ -3323,6 +3358,8 @@ if meson.version().version_compare('>=0.57') { 'bonjour': bonjour, 'bsd_auth': bsd_auth, + 'docs': docs_dep, + 'docs_pdf': docs_pdf_dep, 'gss': gssapi, 'icu': icu, 'ldap': ldap, |