diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2024-02-13 19:42:04 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2024-02-13 20:12:15 +0100 |
commit | 0f6b39d2f513aae16c7377fc802c25ab81551c42 (patch) | |
tree | e86119a2f1d8b34b4d090a00a70c17fb34ca0577 | |
parent | b7e1a1101133725c79e2170b0870cca8543e5323 (diff) | |
download | expat-0f6b39d2f513aae16c7377fc802c25ab81551c42.tar.gz |
Autotools: Re-work handling of xmlwf.1
File "doc/xmlwf.1" should not be cleaned when building with
"./configure --without-docbook", and re-compilation of the file
should take precedence over a pre-built copy where available.
Also, variable CLEANFILES can be used to simplify things a bit
in Makefile.am.
-rw-r--r-- | expat/configure.ac | 17 | ||||
-rw-r--r-- | expat/doc/Makefile.am | 18 |
2 files changed, 22 insertions, 13 deletions
diff --git a/expat/configure.ac b/expat/configure.ac index a5d1ff93..8a9eddef 100644 --- a/expat/configure.ac +++ b/expat/configure.ac @@ -357,11 +357,22 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], page for xmlwf.])])]) dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will -dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl get it installed, when no working flavor of docbook2man is available (or wanted). dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. AS_IF([test -f "${srcdir}"/doc/xmlwf.1], - [AM_CONDITIONAL(WITH_DOCBOOK, [true])], - [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])]) + ], + [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])], + [AM_CONDITIONAL(WITH_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])]) + AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals diff --git a/expat/doc/Makefile.am b/expat/doc/Makefile.am index c3a3ce59..751365eb 100644 --- a/expat/doc/Makefile.am +++ b/expat/doc/Makefile.am @@ -32,26 +32,24 @@ .PHONY: dist-hook # not inside conditional to avoid automake warning -if WITH_DOCBOOK +if WITH_MANPAGE dist_man_MANS = xmlwf.1 xmlwf.1: xmlwf.xml -rm -f $@ - $(DOCBOOK_TO_MAN) $< + test x$(DOCBOOK_TO_MAN) != x && $(DOCBOOK_TO_MAN) $< test -f $@ || mv XMLWF.1 $@ -else +endif + +if !WITH_DISTRIBUTABLE_MANPAGE dist-hook: @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 @false endif -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +if !WITH_PREBUILT_MANPAGE +CLEANFILES = xmlwf.1 +endif EXTRA_DIST = \ ok.min.css \ |