From ef31eaa7d7037b0dcf4851108fa391967263244e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 9 Apr 2018 19:06:59 +0200 Subject: [PATCH] Don't try to build manpages if asciidoc is missing Commit f9157fd91db9140adacc4d7cd9af5677e4f0163e changed the rules for the documentation, so make always tried to build it and failed if asciidoc was missing since that commit. Now configure tests whether asciidoc is available and builds the documentation conditionally. It also reports that to the user. Signed-off-by: Stefan Weil --- configure.ac | 21 +++++++++++++++++++++ doc/Makefile.am | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/configure.ac b/configure.ac index c4a6ca6875..a9345eb28f 100644 --- a/configure.ac +++ b/configure.ac @@ -414,6 +414,17 @@ AC_SYS_LARGEFILE AC_CHECK_FUNCS([getline]) +# ---------------------------------------- +# Check for programs needed to build documentation. +# ---------------------------------------- + +AC_CHECK_PROG([have_asciidoc], asciidoc, true, false) +if $have_asciidoc; then + AM_CONDITIONAL([ASCIIDOC], true) +else + AM_CONDITIONAL([ASCIIDOC], false) +fi + # ---------------------------------------- # Checks for typedefs, structures, and compiler characteristics. # ---------------------------------------- @@ -513,6 +524,16 @@ echo "You can now build and install $PACKAGE_NAME by running:" echo "" echo "$ make" echo "$ sudo make install" +echo "" + +AM_COND_IF([ASCIIDOC], + [ + echo "This will also build the documentation." + ], [ + echo "Documentation will not be built because asciidoc is missing." + ] +) + # echo "$ sudo make install LANGS=\"eng ara deu\"" # echo " Or:" # echo "$ sudo make install-langs" diff --git a/doc/Makefile.am b/doc/Makefile.am index e016eff2d8..0b9a251edd 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,5 +1,7 @@ # doc/Makefile.am +if ASCIIDOC + asciidoc=asciidoc -d manpage man_MANS = \ @@ -28,3 +30,5 @@ man_MANS = \ $(asciidoc) -o $@ $< MAINTAINERCLEANFILES = $(man_MANS) Doxyfile + +endif