]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
doc: fix man installation from a tarball
authorDaniel Salzman <daniel.salzman@nic.cz>
Tue, 3 Sep 2024 15:34:54 +0000 (17:34 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 4 Sep 2024 14:32:39 +0000 (16:32 +0200)
configure.ac
doc/Makefile.am

index 7ac29728261cebc09c8c326b79ef150c1830995e..4f485f9a940883e15dc863ed1998e16add5c5c9f 100644 (file)
@@ -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")
 
 ######################
index 6ce01dbae3036d8cc79bd6806c96cf617f59289c..b38b211f6c1386c89e097eeb2622337de7c6d465 100644 (file)
@@ -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 += \