[gxml] * add configuration support for the docs



commit 2d117ad1ea1543d1c34501579eda8f9ecef78afc
Author: Richard Schwarting <aquarichy gmail com>
Date:   Mon Jul 30 18:32:38 2012 +0200

    * add configuration support for the docs

 Makefile.am                 |   12 ++++++
 configure.ac                |   28 +++++++++++++-
 docs/Makefile.am            |   90 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 129 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index af503e9..2a35cb3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,20 @@
 ## Process this file with automake to produce Makefile.in
 ## Created by Anjuta
 
+# What does this do? :D
+ACLOCAL_AMFLAGS = -I m4
+
 SUBDIRS = gxml test po
 
+if HAVE_VALADOC
+SUBDIRS += docs
+endif
+
+DISTCHECK_CONFIGURE_FLAGS = \
+	--enable-docs \
+	$(NULL)
+
+
 gxmldocdir = ${prefix}/doc/gxml
 gxmldoc_DATA = \
 	README\
diff --git a/configure.ac b/configure.ac
index 8247b76..af7f839 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,8 +28,11 @@ AM_GLIB_GNU_GETTEXT
 
 LT_INIT
 
-dnl Check for GLib
+dnl ***************************************************************************
+dnl Dependencies
+dnl ***************************************************************************
 GLIB_REQUIRED=2.16.0
+VALADOC_REQUIRED=0.3.1
 
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
 AC_SUBST(GLIB_CFLAGS)
@@ -73,6 +76,28 @@ AC_SUBST(GIO_LIBS)
 dnl Check for GObject Introspection
 GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
+
+
+AC_ARG_ENABLE([docs],
+              AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
+	      [enable_docs=$enableval], [enable_docs=no])
+AM_CONDITIONAL([ENABLE_DOCS], [test x$enable_docs = xyes])
+
+have_valadoc=no
+if test x$enable_docs = xyes; then
+  # make sure the library is new enough and the program exists
+  PKG_CHECK_MODULES([VALADOC], [valadoc-1.0 >= $VALADOC_REQUIRED])
+  AC_PATH_PROG([VALADOC], [valadoc], [:])
+  AS_IF([test "$VALADOC" != :], have_valadoc=yes)
+fi
+AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
+
+if test "x$enable_docs" = "xyes" -a "x$have_valadoc" != "xyes"; then
+  AC_MSG_ERROR([Doc building requested for valadoc but not installed.])
+fi
+
+
+
 AC_ARG_ENABLE([gi-system-install],
     AS_HELP_STRING([--enable-gi-system-install], [Install GObject Introspection files along with system installed files [default=yes]]),
     [enable_gi_system_install=$enableval],[enable_gi_system_install=yes])
@@ -83,6 +108,7 @@ Makefile
 gxml/libgxml.pc
 gxml/Makefile
 test/Makefile
+docs/Makefile
 po/Makefile.in])
 
 dnl Print configuration summary
diff --git a/docs/Makefile.am b/docs/Makefile.am
new file mode 100644
index 0000000..a04e74c
--- /dev/null
+++ b/docs/Makefile.am
@@ -0,0 +1,90 @@
+# inspired by folks' documentation Makefile.am
+
+# distclean_dirs? 
+# phony_deps? 
+
+gxml_wiki_pages = \
+	concepts \
+	glossary \
+	debugging \
+	$(NULL)
+
+# Huh, gxml_wiki_files isn't defined for a while down below
+EXTRA_DIST = $(gxml_wiki_files)
+
+# ---------------------------------------------------------
+
+gxmldocdir=$(datadir)/devhelp/references/gxml
+gxmlimgdir=$(datadir)/devhelp/references/gxml/img
+
+gxmlgtkdocdir=$(datadir)/gtk-doc/html/gxml
+# gxmlgtkimgdir=$(datadir)/gtk-doc/html/gxml/img
+
+common_doc_files = \
+	*.css \
+	*.png \
+	*.js \
+	index.htm \
+	*.html \
+	$(NULL)
+
+$(gxmldoc_DATA): gxml-docs
+# $(gxmldoc_DATA) ($gxmlimg_DATA): gxml-docs
+$(gxmlgtkdoc_DATA): gxml-gtk-doc
+
+
+# -------------------------------------------------------
+
+# to define:
+# top_builddir AM_V_GEN VALADOC top_srcdir addprefix? PACKAGE_VERSION
+
+valadoc_flags = \
+	--force \
+	--package-version $(PACKAGE_VERSION) \
+	$(NULL)
+
+#	$(top_srcdir)/gxml/internal.vala 
+gxml_doc_files_blacklist = \
+	$(NULL)
+
+gxml_doc_files_all = \
+	$(wildcard $(top_srcdir)/folks/*.vala) \
+	$(NULL)
+
+gxml_wiki_files = \
+	$(addprefix wiki/,$(addsuffix .valadoc,$(folks_wiki_pages))) \
+	$(NULL)
+
+# TODO: Fix this.  Sorting done to "work around the native doclet portino of bgo#662784" - folks
+gxml_doc_files = \
+	$(sort \
+	$(filter-out $(gxml_doc_files_blacklist),$(gxml_doc_files_all)))
+
+# todo: find out what dependencies I want/need to set
+gxml_doc_deps = \
+	$(NULL)
+
+valadoc_flags_gxml = \
+	$(valadoc_flags) \
+	-X $(top_srcdir)/gxml/gxml.h \
+	$(addprefix --pkg=,$(gxml_doc_deps)) \
+	--vapidir=$(top_srcdir)/gxml \
+	--wiki=$(top_srcdir)/docs/wiki \
+	$(gxml_doc_files) \
+	$(NULL)
+
+gxml-doc: $(gxml_doc_files) $(gxml_wiki_files)
+	$(AM_V_GEN)$(VALADOC) \
+		-o gxml/ \
+		--doclet=devhelp \
+		$(valadoc_flags_gxml) \
+		$(NULL)
+
+
+gxml-gtk-doc: $(gxml_doc_files) $(gxml_wiki_files)
+	$(AM_V_GEN)$(VALADOC) \
+		-X -l -X $(top_builddir)/gxml/.libs/libgxml.so \
+		-o gtk-doc/gxml \
+		--doclet=gtkdoc \
+		$(valadoc_flags_gxml) \
+		$(NULL)
diff --git a/docs/wiki/concepts.valadoc b/docs/wiki/concepts.valadoc
new file mode 100644
index 0000000..e69de29
diff --git a/docs/wiki/debugging.valadoc b/docs/wiki/debugging.valadoc
new file mode 100644
index 0000000..e69de29
diff --git a/docs/wiki/glossary.valadoc b/docs/wiki/glossary.valadoc
new file mode 100644
index 0000000..e69de29



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