Do not install documentation if configure --disable-docs (new option)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 3 Aug 2017 21:47:56 +0000 (00:47 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 3 Aug 2017 21:47:56 +0000 (00:47 +0300)
* configure.ac (docs): New AC_ARG_ENABLE.
* configure.ac (ENABLE_DOCS): New AM_CONDITIONAL.
* doc/doc.am (dist_doc_DATA): Define only if ENABLE_DOCS.

configure.ac
doc/doc.am

index 8190cef..5826eeb 100644 (file)
@@ -965,6 +965,11 @@ if test "$enable_gcov" = "yes"; then
   CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/-O\(1\|2\|3\|4\|s\|fast\)\?//g'`
 fi
 
+AC_ARG_ENABLE(docs,
+        [AC_HELP_STRING([--disable-docs],
+                        [Do not build and install documentation])])
+AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs != xno)
+
 # Atomic Ops
 # ----------
 
index 73197ac..1eec9f9 100644 (file)
@@ -11,7 +11,7 @@
 ## Process this file with automake to produce Makefile.in.
 
 # installed documentation
-#
+if ENABLE_DOCS
 dist_doc_DATA = \
         AUTHORS \
         README.md \
@@ -47,3 +47,4 @@ dist_doc_DATA = \
         doc/scale.md \
         doc/simple_example.md \
         doc/tree.md
+endif