public inbox for
 help / color / mirror / Atom feed
From: Jon Turney <>
Cc: Jon Turney <>
Subject: [PATCH] Cygwin: Conditionally build documentation
Date: Sat, 18 Dec 2021 17:47:21 +0000	[thread overview]
Message-ID: <> (raw)

Add a configure option '--disable-doc' to disable building of the
documentation by the 'all' target.

Check for the required tools at configure time, and require them if
building documentation is enabled.

Even if building the documentation was diabled with '--disable-doc',
'make -C doc' at the top-level can still make the documentation, if the
documentation tools were found. If the tools were not found, 'missing'
is used to issue a warning about that.

Update instructions for building Cygwin appropriately.

(Building documentation remains the default to increase the chances of
noticing when building the documentation is broken.)
 winsup/             |  6 +++++-
 winsup/            | 25 ++++++++++++++++++++++++-
 winsup/doc/         |  2 +-
 winsup/doc/faq-programming.xml | 14 +++++++++-----
 4 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/winsup/ b/winsup/
index 067f74688..9efdd4cb1 100644
--- a/winsup/
+++ b/winsup/
@@ -14,6 +14,10 @@ cygdoc_DATA = \
-SUBDIRS = cygwin cygserver doc utils testsuite
+SUBDIRS = cygwin cygserver utils testsuite
+SUBDIRS += doc
 cygserver utils testsuite: cygwin
diff --git a/winsup/ b/winsup/
index cf1128b37..4ae20509a 100644
--- a/winsup/
+++ b/winsup/
@@ -88,7 +88,30 @@ AC_SUBST(TLSOFFSETS_H)
 AM_CONDITIONAL(TARGET_X86_64, [test $target_cpu = "x86_64"])
-AC_CHECK_PROGS([DOCBOOK2XTEXI], [docbook2x-texi db2x_docbook2texi], [true])
+	      [AS_HELP_STRING([--enable-doc], [Build documentation])],,
+	      enable_doc=yes)
+AM_CONDITIONAL(BUILD_DOC, [test $enable_doc != "no"])
+AC_CHECK_PROGS([DOCBOOK2XTEXI], [docbook2x-texi db2x_docbook2texi])
+if test -z "$DOCBOOK2XTEXI" ; then
+    if test "x$enable_doc" != "xno"; then
+        AC_MSG_ERROR([docbook2texi is required to build documentation])
+    else
+        unset DOCBOOK2XTEXI
+        AM_MISSING_PROG([DOCBOOK2XTEXI], [docbook2texi])
+    fi
+if test -z "$XMLTO"; then
+    if test "x$enable_doc" != "xno"; then
+        AC_MSG_ERROR([xmlto is required to build documentation])
+    else
+        unset XMLTO
+        AM_MISSING_PROG([XMLTO], [xmlto])
+    fi
 if test "x$with_cross_bootstrap" != "xyes"; then
     AC_CHECK_PROGS(MINGW_CXX, ${target_cpu}-w64-mingw32-g++)
diff --git a/winsup/doc/ b/winsup/doc/
index 534d67480..5164c6e0a 100644
--- a/winsup/doc/
+++ b/winsup/doc/
@@ -16,7 +16,7 @@ doc_DATA = \
 htmldir = $(datarootdir)/doc
-XMLTO=xmlto --skip-validation --with-dblatex
+XMLTO=@XMLTO@ --skip-validation --with-dblatex
 DOCBOOK2XTEXI=@DOCBOOK2XTEXI@ --xinclude --info --utf8trans-map=charmap
 -include Makefile.dep
diff --git a/winsup/doc/faq-programming.xml b/winsup/doc/faq-programming.xml
index 26fcfe921..46dd23ab8 100644
--- a/winsup/doc/faq-programming.xml
+++ b/winsup/doc/faq-programming.xml
@@ -689,12 +689,16 @@ Building for 32-bit Cygwin also requires
 Building for 64-bit Cygwin also requires
 <literal>mingw64-x86_64-gcc-g++</literal> and
 <!-- If you want to run the tests, <literal>dejagnu</literal> is also required. -->
-Normally, building ignores any errors in building the documentation,
-which requires the <literal>dblatex</literal>, <literal>docbook2X</literal>,
-<literal>docbook-xml45</literal>, <literal>docbook-xsl</literal>, and
-<literal>xmlto</literal> packages.  For more information on building the
-documentation, see the README included in the <literal>cygwin-doc</literal> package.
+Building the documentation also requires the <literal>dblatex</literal>,
+<literal>docbook2X</literal>, <literal>docbook-xml45</literal>,
+<literal>docbook-xsl</literal>, and <literal>xmlto</literal> packages.  Building
+the documentation can be disabled with the <literal>--disable-doc</literal>
+option to <literal>configure</literal>.
 <para>Next, check out the Cygwin sources from the

             reply	other threads:[~2021-12-18 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18 17:47 Jon Turney [this message]
2021-12-20  9:55 ` Corinna Vinschen
2022-01-14 20:18 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-01-15  5:04 ` Brian Inglis
2022-01-15 15:06 ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).