From: Daniel Salzman Date: Tue, 3 Sep 2024 15:34:54 +0000 (+0200) Subject: doc: fix man installation from a tarball X-Git-Tag: v3.5.0~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30442aa44efda25ed6671fcdffc1f1492717ee4e;p=thirdparty%2Fknot-dns.git doc: fix man installation from a tarball --- diff --git a/configure.ac b/configure.ac index 7ac2972826..4f485f9a94 100644 --- a/configure.ac +++ b/configure.ac @@ -121,15 +121,18 @@ AM_CONDITIONAL([HAVE_LIBUTILS], test "$enable_utilities" != "no" -o \ # Build Knot DNS documentation AC_ARG_ENABLE([documentation], AS_HELP_STRING([--disable-documentation], [Don't build Knot DNS documentation]), [], [enable_documentation=yes]) -AS_IF([test "$enable_documentation" = "yes"], [ +AS_IF([test "$enable_documentation" != "no"], [ AC_PATH_PROG([SPHINXBUILD], [sphinx-build], [false]) - AS_IF([test "$SPHINXBUILD" = "false"], - [AC_MSG_WARN([missing 'sphinx-build' executable for documentation generation]) - enable_documentation=no] - ) - AC_PATH_PROG([PDFLATEX], [pdflatex], [false]) + AS_IF([test "$SPHINXBUILD" != "false"], [ + enable_documentation="man html epub" + AC_PATH_PROG([PDFLATEX], [pdflatex], [false]) + AS_IF([test "$PDFLATEX" != "false"], [ + enable_documentation="$enable_documentation pdf" + ]) + ]) ]) -AM_CONDITIONAL([HAVE_DOCS], [test "$enable_documentation" = "yes"]) +AM_CONDITIONAL([HAVE_DOCS], [test "$enable_documentation" != "no"]) +AM_CONDITIONAL([HAVE_SPHINX], [test "$SPHINXBUILD" != "false"]) AM_CONDITIONAL([HAVE_PDFLATEX], test "$PDFLATEX" != "false") ###################### diff --git a/doc/Makefile.am b/doc/Makefile.am index 6ce01dbae3..b38b211f6c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -99,6 +99,7 @@ man_MANS += man/kxdpgun.8 endif # ENABLE_XDP endif # HAVE_UTILS +if HAVE_SPHINX html-local: $(AM_V_SPHINX)$(SPHINXBUILD) -b html -d $(SPHINXBUILDDIR)/doctrees/html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html @echo "The HTML documentation has been built in $(SPHINXBUILDDIR)/html/" @@ -156,6 +157,12 @@ else html-local singlehtml pdf-local epub man install-html-local install-singlehtml install-pdf-local install-epub: @echo "Install 'sphinx-build' and re-run configure to be able to generate documentation!" +$(man_MANS)&: + @if [ ! -f "$@" ]; then \ + echo "Install 'sphinx-build' or disable documentation and re-run configure to generate man pages!"; \ + fi +endif # HAVE_SPHINX + endif # HAVE_DOCS EXTRA_DIST += \