[gxml] Added initial on GIR documentation



commit a3e76fa47a86a58a66d7d1a358559367553677db
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Sep 30 13:17:40 2014 -0500

    Added initial on GIR documentation

 configure.ac                      |   42 ++++++++++++++++---
 docs/valadoc/Makefile.am          |   78 +++----------------------------------
 docs/valadoc/devhelp/Makefile.am  |   41 +++++++++++++++++++
 docs/valadoc/gir-docs/Makefile.am |   34 ++++++++++++++++
 docs/valadoc/gtk-doc/Makefile.am  |   38 ++++++++++++++++++
 gxml/Makefile.am                  |    1 +
 m4/valac.m4                       |    7 ++-
 7 files changed, 159 insertions(+), 82 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 188dcc0..c782387 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,6 +138,10 @@ PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED)
 # Check for GIO
 PKG_CHECK_MODULES(GIO, $GIO_MODULES)
 
+
+# Check for GObject Introspection
+GOBJECT_INTROSPECTION_CHECK([1.32.0])
+
 # Documentation with Valadoc
 AC_ARG_ENABLE([docs],
               AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
@@ -163,12 +167,21 @@ AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
 AC_ARG_ENABLE([devhelp-docs],
               AS_HELP_STRING([--enable-devhelp-docs],[Enable DevHelp documentation generation]),
              [enable_devhelp_docs=$enableval], [enable_devhelp_docs=no])
+
 AC_ARG_ENABLE([gtk-docs],
               AS_HELP_STRING([--enable-gtk-docs],[Enable gtk-doc documentation generation]),
              [enable_gtk_docs=$enableval], [enable_gtk_docs=no])
 
+AC_ARG_ENABLE([gir-docs],
+              AS_HELP_STRING([--enable-gir-docs],[Enable documented GIR generation]),
+             [enable_gir_docs=$enableval], [enable_gir_docs=no])
+
+
 dnl Find yelp-build program
 enable_mallard_doc="no"
+girdocs=no
+devhelpdocs=no
+gtkdocs=no
 if test x$enable_docs = xyes; then
   AC_PATH_PROG(YELP_BUILD, [yelp-build], [no])
   if test "x$YELP_BUILD" = "xno";
@@ -179,10 +192,24 @@ if test x$enable_docs = xyes; then
       AC_SUBST(YELP_BUILD)
       enable_mallard_doc="yes"
   fi
+  if test x$enable_devhelp_docs = xyes; then
+    devhelpdocs=yes
+  fi
+  if test x$enable_gtk_docs = xyes; then
+    gtkdocs=yes
+  fi
+  if test x$enable_gir_docs = xyes; then
+    if test x$found_introspection = xyes; then
+      girdocs=yes
+    else
+      girdocs="no, use --enable-introspection"
+    fi
+  fi
 fi
 AM_CONDITIONAL(ENABLE_MALLARD_DOC, [test "$enable_mallard_doc" = "yes"])
-AM_CONDITIONAL([ENABLE_DEVHELP_DOCS], [test "x$enable_docs" = "xyes" -a "x$enable_devhelp_docs" = "xyes"])
-AM_CONDITIONAL([ENABLE_GTK_DOCS], [test "x$enable_docs" = "xyes" -a "x$enable_gtk_docs" = "xyes"])
+AM_CONDITIONAL([ENABLE_GIR_DOCS], [test "x$girdocs" = "xyes"])
+AM_CONDITIONAL([ENABLE_DEVHELP_DOCS], [test "x$devhelpdocs" = "xyes"])
+AM_CONDITIONAL([ENABLE_GTK_DOCS], [test "x$gtkdocs" = "xyes"])
 
 debug=no
 AC_ARG_ENABLE(debug,
@@ -191,9 +218,6 @@ AC_ARG_ENABLE(debug,
 
 AM_CONDITIONAL(DEBUG, [test $debug = yes])
 
-# Check for GObject Introspection
-GOBJECT_INTROSPECTION_CHECK([1.32.0])
-
 dnl Check Cross Compile
 dnl ******************************
 dnl Check for Operating System
@@ -242,6 +266,9 @@ test/test_out_stream_expected.xml
 test/test_with_ns.xml
 docs/Makefile
 docs/valadoc/Makefile
+docs/valadoc/devhelp/Makefile
+docs/valadoc/gtk-doc/Makefile
+docs/valadoc/gir-docs/Makefile
 docs/mallard/Makefile
 docs/mallard/C/Makefile
 examples/Makefile
@@ -261,7 +288,8 @@ echo " Configuration summary for GXml-$GXML_VERSION"
 echo "   Installation prefix:   $prefix"
 echo "   GObject Introspection: $found_introspection"
 echo "   Documentation:         ${enable_docs}"
-echo "       DevHelp Doc:       `if test x${enable_docs} = xyes -a x${enable_devhelp_docs} = xyes; then echo 
yes; else echo no; fi`"
-echo "       Gtk-Doc:           `if test x${enable_docs} = xyes -a x${enable_gtk_docs} = xyes; then echo 
yes; else echo no; fi`"
+echo "       DevHelp Doc:       `if test x${devhelpdocs} = xyes; then echo yes; else echo no; fi`"
+echo "       Gtk-Doc:           `if test x${gtkdocs} = xyes; then echo yes; else echo no; fi`"
+echo "       GIR Documented:    $girdocs"
 echo "   Platform:              $host"
 echo ""
diff --git a/docs/valadoc/Makefile.am b/docs/valadoc/Makefile.am
index 6d81987..c546597 100644
--- a/docs/valadoc/Makefile.am
+++ b/docs/valadoc/Makefile.am
@@ -1,82 +1,16 @@
 -include $(top_srcdir)/git.mk
 CLEANFILES=
-
-VALADOC_FLAGS = \
-       --force \
-       --package-name=gxml-$(API_VERSION) \
-       --package-version=$(PACKAGE_VERSION) \
-       --pkg glib-2.0 \
-       --pkg gio-2.0 \
-       --pkg libxml-2.0 \
-       --pkg gee-0.8 \
-       --vapidir=$(top_srcdir)/gxml \
-       --vapidir=$(top_srcdir)/vapi \
-       --wiki=$(top_srcdir)/docs/valadoc/wiki
-
-gxml_wiki_pages = \
-       concepts \
-       glossary \
-       debugging
-
-WIKI_FILES = \
-       $(top_srcdir)/docs/valadoc/wiki/*.valadoc
-
-sources= \
-       $(top_srcdir)/gxml/*.vala
-
-distclean_dirs=
+SUBDIRS=
 
 if ENABLE_DEVHELP_DOCS
-gxmldocdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)
-gxmldoc_DATA = \
-       gxml/gxml-$(API_VERSION)/gxml-$(API_VERSION).devhelp2 \
-       gxml/gxml-$(API_VERSION)/*.png \
-       gxml/gxml-$(API_VERSION)/*.html \
-       gxml/gxml-$(API_VERSION)/*.htm \
-       gxml/gxml-$(API_VERSION)/*.css \
-       gxml/gxml-$(API_VERSION)/*.js
-
-gxmldocimgdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)/img
-gxmldocimg_DATA=\
-       gxml/gxml-$(API_VERSION)/img/*
-
-$(gxmldoc_DATA) $(gxmldocimg_DATA): gxml-doc
-
-gxml-doc:
-       $(VALADOC) -o gxml --doclet=devhelp $(VALADOC_FLAGS) $(sources)
-
-all: gxml-doc
-
-clean-local: clean-local-gxml-doc
-.PHONY: clean-local-gxml-doc
-clean-local-gxml-doc:
-       -rm -rf gxml
-
+SUBDIRS+=devhelp
 endif
 
 if ENABLE_GTK_DOCS
-gxmlgtkdocdir=$(datadir)/gtk-doc/html/gxml
-gxmlgtkdoc_DATA= \
-       gtk-doc/gxml/*.txt \
-       gtk-doc/gxml/html/*.bak \
-       gtk-doc/gxml/html/*.types \
-       gtk-doc/gxml/html/sgml.stamp
-
-$(gxmlgtkdoc_DATA): gxml-gtk-doc
-
-gxml-gtk-doc:
-       $(VALADOC) -o gtk-doc/gxml --doclet=gtkdoc \
-       -X $(top_builddir)/gxml/gxml.h \
-       $(VALADOC_FLAGS) $(sources)
-
-all: gxml-gtk-doc
-
-clean-local: clean-local-gtk-doc
-.PHONY: clean-local-gtk-doc
-clean-local-gtk-doc:
-       -rm -rf gtk-doc
+SUBDIRS+=gtk-doc
+endif
 
+if ENABLE_GIR_DOCS
+SUBDIRS+=gir-docs
 endif
 
-EXTRA_DIST = \
-       $(WIKI_FILES)
diff --git a/docs/valadoc/devhelp/Makefile.am b/docs/valadoc/devhelp/Makefile.am
new file mode 100644
index 0000000..5b99272
--- /dev/null
+++ b/docs/valadoc/devhelp/Makefile.am
@@ -0,0 +1,41 @@
+-include $(top_srcdir)/git.mk
+CLEANFILES=
+
+VALADOC_FLAGS = \
+       --driver $(VALAC_VERSION) \
+       --force \
+       --package-name=gxml-$(API_VERSION) \
+       --package-version=$(PACKAGE_VERSION) \
+       --pkg glib-2.0 \
+       --pkg gio-2.0 \
+       --pkg libxml-2.0 \
+       --pkg gee-0.8 \
+       --vapidir=$(top_srcdir)/gxml \
+       --vapidir=$(top_srcdir)/vapi
+
+sources= \
+       $(top_srcdir)/gxml/*.vala
+
+
+gxmldocdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)
+gxmldoc_DATA = \
+       gxml/gxml-$(API_VERSION)/gxml-$(API_VERSION).devhelp2 \
+       gxml/gxml-$(API_VERSION)/*.png \
+       gxml/gxml-$(API_VERSION)/*.html \
+       gxml/gxml-$(API_VERSION)/*.htm \
+       gxml/gxml-$(API_VERSION)/*.css \
+       gxml/gxml-$(API_VERSION)/*.js
+
+gxmldocimgdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)/img
+gxmldocimg_DATA=\
+       gxml/gxml-$(API_VERSION)/img/*
+
+$(gxmldoc_DATA) $(gxmldocimg_DATA): gxml-doc
+
+gxml-doc:
+       $(VALADOC) -o gxml --doclet=devhelp $(VALADOC_FLAGS) $(sources)
+
+clean-local: clean-local-gxml-doc
+.PHONY: clean-local-gxml-doc
+clean-local-gxml-doc:
+       -rm -rf gxml
diff --git a/docs/valadoc/gir-docs/Makefile.am b/docs/valadoc/gir-docs/Makefile.am
new file mode 100644
index 0000000..65a620b
--- /dev/null
+++ b/docs/valadoc/gir-docs/Makefile.am
@@ -0,0 +1,34 @@
+-include $(top_srcdir)/git.mk
+CLEANFILES=
+
+VALADOC_FLAGS = \
+       --driver $(VALAC_VERSION) \
+       --force \
+       --package-name=gxml-$(API_VERSION) \
+       --package-version=$(PACKAGE_VERSION) \
+       --pkg glib-2.0 \
+       --pkg gio-2.0 \
+       --pkg libxml-2.0 \
+       --pkg gee-0.8 \
+       --vapidir=$(top_srcdir)/gxml \
+       --vapidir=$(top_srcdir)/vapi
+
+sources= \
+       $(top_srcdir)/gxml/*.vala
+
+distclean_dirs=
+
+docgirdir = $(INTROSPECTION_GIRDIR)
+docgir_DATA = GXml-$(API_VERSION).gir
+
+$(docgir_DATA): girdoc
+
+girdoc:
+       $(VALADOC) -o . $(VALADOC_FLAGS) \
+       --gir $(top_builddir)/gxml/GXml-$(API_VERSION).gir $(sources)
+
+CLEANFILES+= $(gxmldocgir_DATA)
+
+#endif
+
+
diff --git a/docs/valadoc/gtk-doc/Makefile.am b/docs/valadoc/gtk-doc/Makefile.am
new file mode 100644
index 0000000..99e2096
--- /dev/null
+++ b/docs/valadoc/gtk-doc/Makefile.am
@@ -0,0 +1,38 @@
+-include $(top_srcdir)/git.mk
+CLEANFILES=
+
+VALADOC_FLAGS = \
+       --driver $(VALAC_VERSION) \
+       --force \
+       --package-name=gxml-$(API_VERSION) \
+       --package-version=$(PACKAGE_VERSION) \
+       --pkg glib-2.0 \
+       --pkg gio-2.0 \
+       --pkg libxml-2.0 \
+       --pkg gee-0.8 \
+       --vapidir=$(top_srcdir)/gxml \
+       --vapidir=$(top_srcdir)/vapi
+
+sources= \
+       $(top_srcdir)/gxml/*.vala
+
+gxmlgtkdocdir=$(datadir)/gtk-doc/html/gxml
+gxmlgtkdoc_DATA= \
+       gtk-doc/gxml/*.txt \
+       gtk-doc/gxml/html/*.bak \
+       gtk-doc/gxml/html/*.types \
+       gtk-doc/gxml/html/sgml.stamp
+
+$(gxmlgtkdoc_DATA): gxml-gtk-doc
+
+gxml-gtk-doc:
+       $(VALADOC) -o gtk-doc/gxml --doclet=gtkdoc \
+       -X $(top_builddir)/gxml/gxml.h \
+       $(VALADOC_FLAGS) $(sources)
+
+all: gxml-gtk-doc
+
+clean-local: clean-local-gtk-doc
+.PHONY: clean-local-gtk-doc
+clean-local-gtk-doc:
+       -rm -rf gtk-doc
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index e5de0fa..4bc36b9 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -176,6 +176,7 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(INTROSPECTION_TYPELIBDIR)
 typelib_DATA = GXml-0.4.typelib
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
 endif
 
 if PLATFORM_WIN32
diff --git a/m4/valac.m4 b/m4/valac.m4
index 97ecce6..f889bef 100644
--- a/m4/valac.m4
+++ b/m4/valac.m4
@@ -29,9 +29,9 @@ m4_define([_VALAC_CHECK_INTERNAL],
       AC_MSG_ERROR([valac is not installed])
     ], [
       check_prog=yes
-      valac_version=`$VALAC --version`
-      VAPIDIR=$datadir/vala-$valac_version/vapi
-      VAPIDIR_UNVERSIONED=$datadir/vala-$valac_version/vapi
+      VALAC_VERSION=`$VALAC --api-version`
+      VAPIDIR=$datadir/vala-$VALAC_VERSION/vapi
+      VAPIDIR_UNVERSIONED=$datadir/vala-$VALAC_VERSION/vapi
     ])
   ], [
     AS_IF([ test "x$1" = "x"], [
@@ -62,6 +62,7 @@ m4_define([_VALAC_CHECK_INTERNAL],
        AC_SUBST([VAPIGEN_MAKEFILE])
        AC_SUBST([GEN_INTROSPECT])
        AC_SUBST([VALA_GEN_INTROSPECT])
+       AC_SUBST([VALAC_VERSION])
 ])
 
 dnl Check VAPIGEN


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