[PATCH v2 1/2] Allow building without gtk-doc installed



This requires creating minimal gtk-doc.make and check for GTK_DOC_CHECK
availability in configure.ac.

Signed-off-by: Petr Vorel <petr vorel gmail com>
---
 autogen.sh   | 14 +++++++++++++-
 configure.ac |  7 ++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 5ec9a5a..a7e1c17 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -22,7 +22,19 @@ PKG_NAME=NetworkManager
 
 cd $srcdir
 
-gtkdocize
+GTKDOCIZE=`which gtkdocize` || true
+if test -z $GTKDOCIZE; then
+    echo "**Warning**: No GTK-Doc found, documentation won't be generated" >&2
+    echo " and 'make dist' and 'make distcheck' will not work." >&2
+
+    # create minimal gtk-doc.make if missing as we depend on it
+    if test -f gtk-doc.make; then :; else
+       printf "EXTRA_DIST = \nCLEANFILES = \n" > gtk-doc.make
+    fi
+else
+    gtkdocize || exit $?
+fi
+
 autopoint --force
 AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
 
diff --git a/configure.ac b/configure.ac
index e1a1917..c776d3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -898,7 +898,12 @@ AS_IF([test "$with_valgrind" != "no"],
        AC_SUBST(VALGRIND_RULES, []))
 AM_CONDITIONAL(WITH_VALGRIND, test "${with_valgrind}" != "no")
 
-GTK_DOC_CHECK(1.0)
+# Check for GTK_DOC_CHECK availability. The GTK_DOC_CHECK invocation
+# must be on its own line, gtkdocize relies on it
+m4_ifdef([GTK_DOC_CHECK], [
+GTK_DOC_CHECK([1.0])
+])
+AM_CONDITIONAL(ENABLE_GTK_DOC, test "$enable_gtk_doc" = "yes")
 
 # check for pregenerated manpages to be installed
 install_pregen_manpages=no
-- 
2.1.4



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