From 25a70dcb2e901ae1e3d9d980743b31bb51e5379b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 31 May 2023 16:56:31 +0200 Subject: [PATCH] build-sys: only pass --failure-level if supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- Makefile.am | 5 ++++- configure.ac | 10 ++++++++++ po-man/Makefile.am | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3da0e8715c..effbb02fc2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -230,10 +230,13 @@ asciidoc_man_cmd = $(ASCIIDOCTOR) \ -a 'package-docdir=$(docdir)' \ -a 'VERSION=$(VERSION)' \ -a 'ADJTIME_PATH=$(ADJTIME_PATH)' \ - --failure-level ERROR \ --load-path '$(abs_srcdir)/tools' \ --require asciidoctor-includetracker +if HAVE_ASCIIDOCTOR_FAILURE_LEVEL +asciidoc_man_cmd += --failure-level ERROR +endif + SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8 .1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8: $(AM_V_GEN) test -f ./$@ || \ diff --git a/configure.ac b/configure.ac index a381f79363..c80ef7bded 100644 --- a/configure.ac +++ b/configure.ac @@ -805,6 +805,16 @@ AC_ARG_ENABLE([asciidoc], UL_BUILD_INIT([asciidoc]) UL_REQUIRES_PROGRAM([asciidoc], [ASCIIDOCTOR], [asciidoctor], [man pages]) AM_CONDITIONAL([ENABLE_ASCIIDOC], [test "x$build_asciidoc" = xyes]) +AS_IF([test "x$build_asciidoc" = xyes], [ + AC_MSG_CHECKING([whether ${ASCIIDOCTOR} supports --failure-level]) + AS_IF([${ASCIIDOCTOR} --help | grep failure-level >/dev/null 2>&1 ], [ + AC_MSG_RESULT([yes]) + AM_CONDITIONAL([HAVE_ASCIIDOCTOR_FAILURE_LEVEL], [true]) + ], [ + AC_MSG_RESULT([no]) + AM_CONDITIONAL([HAVE_ASCIIDOCTOR_FAILURE_LEVEL], [false]) + ]) +]) have_manpages=no AS_IF([test -f "$srcdir/sys-utils/mount.8"], [ diff --git a/po-man/Makefile.am b/po-man/Makefile.am index 9fa5406aa6..399f8faeb5 100644 --- a/po-man/Makefile.am +++ b/po-man/Makefile.am @@ -35,10 +35,13 @@ asciidoc_man_cmd = $(ASCIIDOCTOR) \ -a 'package-docdir=$(docdir)' \ -a 'VERSION=$(VERSION)' \ -a 'ADJTIME_PATH=$(ADJTIME_PATH)' \ - --failure-level ERROR \ --load-path '$(top_srcdir)/tools' \ --require asciidoctor-unicodeconverter +if HAVE_ASCIIDOCTOR_FAILURE_LEVEL +asciidoc_man_cmd += --failure-level ERROR +endif + gen-mans: gen-trans @set -e; \ for l in $(PO_LANGS); do \ -- 2.39.5