Add XML_CATALOG_FILES for MacOS with Homebrew (#3188)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2020-12-21 16:39:32 +01:00 committed by GitHub
parent e66243fcea
commit 57efa41d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -432,6 +432,25 @@ AC_CHECK_PROG([have_asciidoc], asciidoc, true, false)
AC_CHECK_PROG([have_xsltproc], xsltproc, true, false) AC_CHECK_PROG([have_xsltproc], xsltproc, true, false)
if $have_asciidoc && $have_xsltproc; then if $have_asciidoc && $have_xsltproc; then
AM_CONDITIONAL([ASCIIDOC], true) AM_CONDITIONAL([ASCIIDOC], true)
# MacOS with Homebrew requires the environment variable
# XML_CATALOG_FILES for xsltproc.
AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], false)
XML_CATALOG_FILES=
AC_CHECK_PROG([have_brew], brew, true, false)
if $have_brew; then
brew_prefix=$(brew --prefix)
catalog_file=$brew_prefix/etc/xml/catalog
AC_CHECK_FILE($catalog_file,
[
AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], true)
XML_CATALOG_FILES=file:$catalog_file
],
[
AC_MSG_ERROR([Missing file $catalog_file.])
]
)
fi
AC_SUBST([XML_CATALOG_FILES])
else else
AM_CONDITIONAL([ASCIIDOC], false) AM_CONDITIONAL([ASCIIDOC], false)
fi fi

View File

@ -38,8 +38,13 @@ pdf: ${man_MANS:%=%.pdf}
SUFFIXES = .asc .html .pdf SUFFIXES = .asc .html .pdf
.asc: .asc:
-asciidoc -b docbook -d manpage -o - $< | \ if HAVE_XML_CATALOG_FILES
asciidoc -b docbook -d manpage -o - $< | \
XML_CATALOG_FILES=$(XML_CATALOG_FILES) xsltproc --nonet $(man_xslt) -
else
asciidoc -b docbook -d manpage -o - $< | \
xsltproc --nonet $(man_xslt) - xsltproc --nonet $(man_xslt) -
endif
.asc.html: .asc.html:
asciidoc -b html5 -o $@ $< asciidoc -b html5 -o $@ $<