Cygwin: Conditionally build documentation

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.)
This commit is contained in:
Jon Turney 2021-12-07 14:05:34 +00:00
parent 80f4b7d545
commit f4a26ececa
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
4 changed files with 39 additions and 8 deletions

View File

@ -14,6 +14,10 @@ cygdoc_DATA = \
CYGWIN_LICENSE \ CYGWIN_LICENSE \
COPYING COPYING
SUBDIRS = cygwin cygserver doc utils testsuite SUBDIRS = cygwin cygserver utils testsuite
if BUILD_DOC
SUBDIRS += doc
endif
cygserver utils testsuite: cygwin cygserver utils testsuite: cygwin

View File

@ -88,7 +88,30 @@ AC_SUBST(TLSOFFSETS_H)
AM_CONDITIONAL(TARGET_X86_64, [test $target_cpu = "x86_64"]) AM_CONDITIONAL(TARGET_X86_64, [test $target_cpu = "x86_64"])
AC_CHECK_PROGS([DOCBOOK2XTEXI], [docbook2x-texi db2x_docbook2texi], [true]) AC_ARG_ENABLE(doc,
[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
fi
AC_CHECK_PROGS([XMLTO], [xmlto])
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
fi
if test "x$with_cross_bootstrap" != "xyes"; then if test "x$with_cross_bootstrap" != "xyes"; then
AC_CHECK_PROGS(MINGW_CXX, ${target_cpu}-w64-mingw32-g++) AC_CHECK_PROGS(MINGW_CXX, ${target_cpu}-w64-mingw32-g++)

View File

@ -16,7 +16,7 @@ doc_DATA = \
htmldir = $(datarootdir)/doc htmldir = $(datarootdir)/doc
XMLTO=xmlto --skip-validation --with-dblatex XMLTO=@XMLTO@ --skip-validation --with-dblatex
DOCBOOK2XTEXI=@DOCBOOK2XTEXI@ --xinclude --info --utf8trans-map=charmap DOCBOOK2XTEXI=@DOCBOOK2XTEXI@ --xinclude --info --utf8trans-map=charmap
-include Makefile.dep -include Makefile.dep

View File

@ -689,12 +689,16 @@ Building for 32-bit Cygwin also requires
Building for 64-bit Cygwin also requires Building for 64-bit Cygwin also requires
<literal>mingw64-x86_64-gcc-g++</literal> and <literal>mingw64-x86_64-gcc-g++</literal> and
<literal>mingw64-x86_64-zlib</literal>. <literal>mingw64-x86_64-zlib</literal>.
</para>
<!-- If you want to run the tests, <literal>dejagnu</literal> is also required. --> <!-- 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>, <para>
<literal>docbook-xml45</literal>, <literal>docbook-xsl</literal>, and Building the documentation also requires the <literal>dblatex</literal>,
<literal>xmlto</literal> packages. For more information on building the <literal>docbook2X</literal>, <literal>docbook-xml45</literal>,
documentation, see the README included in the <literal>cygwin-doc</literal> package. <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> </para>
<para>Next, check out the Cygwin sources from the <para>Next, check out the Cygwin sources from the