diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2012-12-01 17:33:23 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-12-03 09:49:36 -0500 |
commit | e8ce68392016bfdbbdf407dfa240f5644638ff45 (patch) | |
tree | 59ed2be8e4b5ce3f11f36f90249f2b342489cc2b | |
parent | 76dae4f089793eb7cb9eedd6f95a864b17cc50f6 (diff) |
man, configure.ac: Only generate man pages if we can do it offline
Instead of relying on downloading the stylesheet from the Internet for
generating man pages, only generate them if the stylesheet is available
locally.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | doc/man/Makefile.am | 7 |
2 files changed, 19 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 2edc67d..b160de7 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,20 @@ fi AC_PATH_PROG(XSLTPROC, xsltproc) AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"]) +AC_MSG_CHECKING([for docbook manpages stylesheet]) +MANPAGES_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl +AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc], + AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$MANPAGES_STYLESHEET" > /dev/null 2>&1`], + [HAVE_MANPAGES_STYLESHEET=yes])) +if test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"; then + AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], true) + AC_SUBST(MANPAGES_STYLESHEET) + AC_MSG_RESULT([yes]) +else + AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], false) + AC_MSG_RESULT([no]) +fi + AM_CONDITIONAL(BUILD_DOCS, [test x$enable_documentation = xyes]) if test "x$enable_documentation" = "xyes"; then AC_PATH_PROG(DOXYGEN, doxygen) diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index a6a5072..1407953 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -16,6 +16,7 @@ EXTRA_DIST = man_MANS = if HAVE_XSLTPROC +if HAVE_MANPAGES_STYLESHEET CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES) @@ -25,11 +26,12 @@ XSLTPROC_FLAGS = \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \ --stringparam funcsynopsis.style ansi \ - --stringparam man.output.quietly 1 + --stringparam man.output.quietly 1 \ + --nonet XSLTPROC_PROCESS_MAN = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \ + $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) $< && \ $(SED) -i -e 's/^\.so \(.*\)\.\(.\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES) %.1: %.xml @@ -46,4 +48,5 @@ XSLTPROC_PROCESS_MAN = \ wl_display_connect_to_fd.3: wl_display_connect.3 +endif # HAVE_MANPAGES_STYLESHEET endif # HAVE_XSLTPROC |