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



commit 4631db8bef300f87214409b27007fb145cbc7148
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 19a68c5..4b90d2b 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
 
 INTLTOOLIZE=`which intltoolize`
diff --git a/configure.ac b/configure.ac
index 0d80da5..ad937e1 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-idoc-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]