From e50eabc64fa339ca9794a3787a151de55ced8bf2 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 28 Oct 2016 18:33:19 -0400 Subject: [PATCH] doc/man: only require asciidoc-attrs.conf when building the man pages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Situations: * If you want to and can build the man pages: * If it's a tarball tree: * Make the man page destinations depend on asciidoc-attrs.conf. Since it's a generated file, its date is greater than the date of the prebuilt man pages, therefore the man pages are built again, which is a good thing because they include the default values of this build. * If it's a Git tree: * Always build the man pages anyway (no prebuilt man pages here). * If you want to, but cannot build the man pages: * If it's a tarball tree: * Make the man page destinations NOT depend on asciidoc-attrs.conf, because its recent date would ask said destinations to be rebuilt and this is not possible because we don't have the tools. However, warn the user at configure time that the prebuilt man pages will be installed, which means that they will contain the project's default values, not this build's default values. * If it's a Git tree: * Not valid: error at configure time as usual. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- configure.ac | 18 ++++++++++++------ doc/man/Makefile.am | 7 ++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 40198a630..65f2439c0 100644 --- a/configure.ac +++ b/configure.ac @@ -595,7 +595,7 @@ AS_IF([test "x$man_pages_opt" = "xyes"], [ # thus asciidoc/xmlto are required because we were asked # to build the man pages AC_MSG_ERROR([ -Both asciidoc and xmlto are needed to build the LTTng man pages. Use +You need asciidoc and xmlto to build the LTTng-tools man pages. Use --disable-man-pages to disable building the man pages, in which case they will not be installed. ]) @@ -604,11 +604,17 @@ they will not be installed. # pages should already be generated at this point, thus # asciidoc/xmlto are not strictly required AC_MSG_WARN([ -Both asciidoc and xmlto are needed to build the LTTng man pages. Note -that the man pages are already built in this distribution tarball, so -asciidoc and xmlto are only needed if you intend to modify their -sources. Use --disable-man-pages to completely disable building -and installing the man pages. +You need asciidoc and xmlto to build the LTTng-tools man pages. + +Note that the man pages are already built in this distribution tarball, +so asciidoc and xmlto are only needed if you intend to modify their +sources. + +Also note that the installed man pages will contain the project's +default command-line option and environment variable values. + +Use --disable-man-pages to completely disable building and installing +the man pages. ]) ]) ], [ diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 5ec6f4faf..1d838e2ba 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -62,7 +62,7 @@ XSL_FILES = \ XSL_SRC_FILES = $(addprefix $(srcdir)/xsl/,$(XSL_FILES)) # common dependencies -COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT) $(ASCIIDOC_ATTRS_CONF) +COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT) # man pages destinations MAN1 = $(addsuffix .1,$(MAN1_NAMES)) @@ -81,6 +81,11 @@ ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage ADOC_DOCBOOK = $(ADOC) -b docbook XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man +# only add this dependency if we can build the man pages because it's +# a file generated by the configure script, so it's more recent than +# the pregenerated man pages in a tarball +COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF) + # recipes %.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS) $(ADOC_DOCBOOK) -o $@ $< -- 2.34.1