[jhbuild/jjardon/autotools: 3/3] Make documentation optional



commit d2c3cab4f17910f88aee93a5aeac4dcbdb410b8e
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Oct 16 18:15:48 2013 +0100

    Make documentation optional

 autogen.sh   |    3 +--
 configure.ac |   21 +++++++++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 1c9374c..a408b3b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,8 +16,7 @@ fi
 GNOMEDOC=`which yelp-build`
 if test -z $GNOMEDOC; then
         echo "*** The tools to build the documentation are not found,"
-        echo "    documentation will not be buildded ***"
-        exit 1
+        echo "    documentation will not be builded ***"
 fi
 
 # if the AC_CONFIG_MACRO_DIR() macro is used, create that directory
diff --git a/configure.ac b/configure.ac
index 20ee4f9..395bf71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,14 +25,23 @@ AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
 
 # Documentation
+have_doc_tools=no
 AC_ARG_ENABLE(
-       doc_installation,
-       AS_HELP_STRING([--enable-doc-installation=@<:@no/yes@:>@], [install the documentation files]),
+       [doc_installation],
+       [AS_HELP_STRING([--enable-doc-installation=@<:@no/yes@:>@],
+                       [Enable build of documentation files])],
        [enable_doc_installation=$enableval],
-       [enable_doc_installation=no])
-AM_CONDITIONAL([DOC_INSTALLATION_ENABLED],[test "x$enable_doc_installation" = "xyes"])
-
-YELP_HELP_INIT
+       [enable_doc_installation=check])
+AS_IF([test "x$enable_doc_installation" != "xno"],
+      [m4_ifdef([YELP_HELP_INIT],
+                [YELP_HELP_INIT
+                 have_doc_tools=yes])
+      ])
+AS_IF([test "x$enable_doc_installation" = "xyes"],
+      [AS_IF([test "x$have_doc_tools" = "xno"],
+             [AC_MSG_ERROR([--enable-doc-installation was given, but yelp-tools were not found])])
+      ])
+AM_CONDITIONAL([DOC_INSTALLATION_ENABLED],[test "x$have_doc_tools" = "xyes"])
 
 AC_CONFIG_FILES([
        Makefile


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]