]> granicus.if.org Git - check/commitdiff
configure: optional build documentation
authorBranden Archer <b.m.archer4@gmail.com>
Mon, 19 Aug 2019 18:32:35 +0000 (20:32 +0200)
committerMikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Thu, 29 Aug 2019 13:06:48 +0000 (15:06 +0200)
Fix issue https://github.com/libcheck/check/issues/206

Applied an uncommitted patch by Branden Archer.
https://sourceforge.net/p/check/bugs/101/

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Makefile.am
configure.ac

index fd7143244ac9e9e2008f0a097fc6f43d94ef2ef6..f04c0e0d1be6601a77f8227f6206fbcd02068cc3 100644 (file)
@@ -2,7 +2,13 @@
 
 ## run tests after everything else
 
-SUBDIRS = lib src doc . checkmk tests
+if MAKE_DOCS
+OPTIONAL_DOC_TARGET = doc
+else
+OPTIONAL_DOC_TARGET =
+endif
+
+SUBDIRS = lib src $(OPTIONAL_DOC_TARGET) . checkmk tests
 
 ## FIXME: maybe we don't need this line
 
index 47c36752b9214a2e008fde7bf5b87a58ef8ea973..7889b324a53adfc9cce02d8d7b3a54dbc7f0a4fe 100644 (file)
@@ -72,6 +72,15 @@ AC_HELP_STRING([--enable-timeout-tests],
   *)   AC_MSG_ERROR(bad value ${enableval} for --enable-timeout-tests) ;;
 esac], [enable_timeout_tests=true ])
 
+AC_ARG_ENABLE(build-docs,
+AC_HELP_STRING([--enable-build-docs],
+           [turn on building documentation @<:@default=yes@:>@]),
+[case "${enableval}" in
+  yes) enable_build_docs=true ;;
+  no)  enable_build_docs=false ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-build-docs) ;;
+esac], [enable_build_docs=true ])
+
 AM_CONDITIONAL(NO_TIMEOUT_TESTS, test x"$enable_timeout_tests" = "xfalse")
 
 AC_ARG_ENABLE(subunit,
@@ -171,12 +180,19 @@ esac
 AC_CHECK_PROGS(GCOV, gcov, false)
 AC_CHECK_PROGS(LCOV, lcov, false)
 AC_CHECK_PROGS(GENHTML, genhtml, false)
-AC_CHECK_PROGS(TEX, tex, false)
-if test "$TEX" = "false"; then
-    # Make it [somewhat] clear to maintainers that tex is missing. Not an error
-    # though because 'make install' (which users need) does not build the docs
-    # anyway.
-    AC_MSG_WARN(tex not installed: cannot rebuild HTML documentation.)
+
+if test "xtrue" = x"$enable_build_docs"; then
+    AC_CHECK_PROGS(TEX, tex, false)
+    if test "$TEX" = "false"; then
+        # Make it [somewhat] clear to maintainers that tex is missing. Not an error
+        # though because 'make install' (which users need) does not build the docs
+        # anyway.
+        AC_MSG_WARN(tex not installed: cannot rebuild HTML documentation.)
+    fi
+
+    AM_CONDITIONAL(MAKE_DOCS, [test x"$TEX" != "xfalse"])
+else
+   AM_CONDITIONAL(MAKE_DOCS, [false])
 fi
 AC_CHECK_PROGS(FILTERDIFF, filterdiff, false)
 if test "$FILTERDIFF" = "false"; then