Skip to content

Commit

Permalink
Add XML_CATALOG_FILES for MacOS with Homebrew (#3188)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil authored Dec 21, 2020
1 parent e66243f commit 57efa41
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,25 @@ AC_CHECK_PROG([have_asciidoc], asciidoc, true, false)
AC_CHECK_PROG([have_xsltproc], xsltproc, true, false)
if $have_asciidoc && $have_xsltproc; then
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
AM_CONDITIONAL([ASCIIDOC], false)
fi
Expand Down
7 changes: 6 additions & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ pdf: ${man_MANS:%=%.pdf}
SUFFIXES = .asc .html .pdf

.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) -
endif

.asc.html:
asciidoc -b html5 -o $@ $<
Expand Down

0 comments on commit 57efa41

Please sign in to comment.