From: Thomas Weißschuh Date: Wed, 31 May 2023 14:56:31 +0000 (+0200) Subject: build-sys: only pass --failure-level if supported X-Git-Tag: v2.39.1~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da22c179c2b11a0c3edaa305a0fde7e6b7f81bfe;p=thirdparty%2Futil-linux.git build-sys: only pass --failure-level if supported Signed-off-by: Thomas Weißschuh --- 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 048bbcd782..6f0375eee3 100644 --- a/configure.ac +++ b/configure.ac @@ -802,6 +802,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 \