From c3db9e6f8fd06d691be04cdd95a6bb21a400481d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Wed, 3 Jul 2019 03:34:17 +0200 Subject: [PATCH] autoconf: Check if --nonet works. Fixes #967 #506. Also give a helpful error message on what package the user likely has to install to make it work. --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index a52830b38..f510f8a97 100644 --- a/configure.ac +++ b/configure.ac @@ -258,6 +258,15 @@ AC_ARG_ENABLE(doc-gen, AC_HELP_STRING([--disable-doc-gen], doc_generate=$enableval, doc_generate=yes) AC_SUBST(doc_generate) +# Check if docbook works without Internet (if not, likely packages providing the .xsl files are not installed) +if test "$doc_generate" = yes; then + AC_MSG_CHECKING([if docbook can run without networking]) + if "$xsltproc" --nonet --novalid http://docbook.sourceforge.net/release/xsl-ns/current/profiling/profile.xsl >&AS_MESSAGE_LOG_FD 2>&1; then + AC_MSG_RESULT(yes) + else + AC_MSG_FAILURE([Building the manual requires 'xsltproc --nonet' to work. It did not. Perhaps you lack the necessary xsl files (e.g. package docbook-xsl-ns on Debian)?]) + fi +fi # Setuid installations. AC_CHECK_FUNCS([setresuid setreuid lchown])