summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndres Freund2023-04-05 04:29:39 +0000
committerAndres Freund2023-04-05 04:29:39 +0000
commitef07d351a1860a6e93c89cc7af3ae13366942bf0 (patch)
tree790f3d304974f127c47f9a72e86914cb8adb2e5e /doc/src
parent0ba827ecfc677cb449b3a370cf6613b4a770c4f8 (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 <[email protected]> Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/ZB8331v5IhUA/[email protected]
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/installation.sgml33
-rw-r--r--doc/src/sgml/meson.build23
2 files changed, 40 insertions, 16 deletions
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 713952f107..0191add030 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -2893,6 +2893,39 @@ ninja install
</variablelist>
</sect3>
+ <sect3 id="meson-options-docs">
+ <title>Documentation</title>
+
+ <para>
+ See <xref linkend="docguide-toolsets"/> for the tools needed for building
+ the documentation.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="configure-docs-meson">
+ <term><option>-Ddocs={ auto | enabled | disabled }</option></term>
+ <listitem>
+ <para>
+ Enables building the documentation in <acronym>HTML</acronym> and
+ <acronym>man</acronym> format. It defaults to auto.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="configure-docs-pdf-meson">
+ <term><option>-Ddocs_pdf={ auto | enabled | disabled }</option></term>
+ <listitem>
+ <para>
+ Enables building the documentation in <acronym>PDF</acronym>
+ format. It defaults to auto.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect3>
+
<sect3 id="meson-options-misc">
<title>Miscellaneous</title>
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index b1784a33a8..f293eca612 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -5,9 +5,6 @@ installdocs = []
alldocs = []
doc_generated = []
-xmllint_bin = find_program(get_option('XMLLINT'), native: true, required: false)
-
-
version_sgml = configure_file(
input: 'version.sgml.in',
output: 'version.sgml',
@@ -68,8 +65,6 @@ if not xmllint_bin.found()
endif
pandoc = find_program('pandoc', native: true, required: false)
-xsltproc_bin = find_program(get_option('XSLTPROC'), native: true, required: false)
-fop = find_program('fop', native: true, required: false)
xmltools_wrapper = [
python, files('xmltools_dep_wrapper'),
@@ -117,7 +112,7 @@ endif
#
# Full documentation as html, text
#
-if xsltproc_bin.found()
+if docs_dep.found()
html = custom_target('html',
input: ['stylesheet.xsl', postgres_full_xml],
output: 'html',
@@ -167,7 +162,7 @@ endif
#
# INSTALL in html, text
#
-if xsltproc_bin.found()
+if docs_dep.found()
# Depend on postgres_full_xml, so validity errors are raised in one place,
# and so dependencies don't need to be re-specified.
install_xml = custom_target('INSTALL.xml',
@@ -204,7 +199,7 @@ endif
#
# Man pages
#
-if xsltproc_bin.found()
+if docs_dep.found()
# FIXME: implement / consider sqlmansectnum logic
man = custom_target('man',
input: ['stylesheet-man.xsl', postgres_full_xml],
@@ -233,7 +228,7 @@ endif
#
# Full documentation as PDF
#
-if fop.found() and xsltproc_bin.found()
+if docs_pdf_dep.found()
xsltproc_fo_flags = xsltproc_flags + [
'--stringparam', 'img.src.path', meson.current_source_dir() + '/'
]
@@ -291,7 +286,7 @@ db2x_xsltproc = find_program('db2x_xsltproc', native: true, required: false)
db2x_texixml = find_program('db2x_texixml', native: true, required: false)
makeinfo = find_program('makeinfo', native: true, required: false)
-if db2x_texixml.found() and db2x_xsltproc.found() and makeinfo.found()
+if xsltproc_bin.found() and db2x_texixml.found() and db2x_xsltproc.found() and makeinfo.found()
postgres_texixml = custom_target('postgres.texixml',
output: 'postgres.texixml',
command: [db2x_xsltproc, '-s', 'texi',
@@ -315,15 +310,11 @@ if db2x_texixml.found() and db2x_xsltproc.found() and makeinfo.found()
endif
-if docs.length() == 0
- run_target('docs', command: [missing, 'xsltproc'])
-else
+if docs_dep.found()
alias_target('docs', docs)
alias_target('install-docs', installdocs)
endif
-if alldocs.length() == 0
- run_target('alldocs', command: [missing, 'xsltproc'])
-else
+if alldocs.length() != 0
alias_target('alldocs', alldocs)
endif