[gxml] More fixes on valadoc. Added valac.m4
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] More fixes on valadoc. Added valac.m4
- Date: Sun, 28 Sep 2014 14:36:46 +0000 (UTC)
commit 2b19b6bd2625e8519e8e420bb3f0493b390f700c
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Sep 25 20:10:14 2014 -0500
More fixes on valadoc. Added valac.m4
configure.ac | 8 +--
docs/valadoc/Makefile.am | 136 ++++++++++++++--------------------------------
m4/valac.m4 | 75 +++++++++++++++++++++++++
3 files changed, 119 insertions(+), 100 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 842001e..f9c34f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,10 +123,7 @@ PKG_CHECK_MODULES([GLIB],
gobject-2.0 >= $GLIB_REQUIRED])
# Check for vala
-AM_PROG_VALAC([$VALA_REQUIRED])
-AS_IF([test "x$VALAC" = "x"], [
- AC_MSG_ERROR([Vala requested but valac is not installed])
-])
+VALAC_CHECK
# Check for libgee
PKG_CHECK_MODULES(GEE, gee-0.8 >= $GEE_REQUIRED)
@@ -151,8 +148,9 @@ if test x$enable_docs = xyes; then
then
AC_MSG_RESULT([valadoc documentation not build because not found])
else
- AC_SUBST(VALADOC)
+ VAPIDIR=`$PKG_CONFIG --variable=vapidir libvalac-$VALA_REQUIRED`
have_valadoc="yes"
+ AC_SUBST(VALADOC)
fi
fi
AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
diff --git a/docs/valadoc/Makefile.am b/docs/valadoc/Makefile.am
index c4f1ace..17b0c18 100644
--- a/docs/valadoc/Makefile.am
+++ b/docs/valadoc/Makefile.am
@@ -1,117 +1,63 @@
-# inspired by folks' documentation Makefile.am
-
-# distclean_dirs?
-# phony_deps?
-distclean_dirs = \
- gxml \
- gtk-doc \
- $(NULL)
+-include $(top_srcdir)/git.mk
-phony_deps = \
- gxml-doc \
- gxml-gtk-doc \
- $(NULL)
+VALADOC_FLAGS = \
+ --force \
+ --package-name=GXml \
+ --package-version=$(PACKAGE_VERSION) \
+ $(top_srcdir)/vapi/libxml-2.0.vapi \
+ --pkg glib-2.0 \
+ --pkg gio-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 \
- $(NULL)
+ debugging
+WIKI_FILES = \
+ $(top_srcdir)/docs/valadoc/wiki/*.valadoc
-# Huh, gxml_wiki_files isn't defined for a while down below
-EXTRA_DIST = $(gxml_wiki_files)
+sources= \
+ $(top_srcdir)/gxml/*.vala
+gxmldocdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)
+gxmldoc_DATA = \
+ gxml/GXml/GXml.devhelp2 \
+ gxml/GXml/*.png \
+ gxml/GXml/*.html \
+ gxml/GXml/*.htm
+gxmldocimgdir=$(datadir)/devhelp/books/gxml-$(API_VERSION)/img
+gxmldocimg_DATA=\
+ gxml/GXml/img/*
-# ---------------------------------------------------------
+gxml-doc:
+ $(VALADOC) -o gxml/ --doclet=devhelp $(VALADOC_FLAGS) $(sources)
-gxmldocdir=$(datadir)/devhelp/references/gxml
-gxmlimgdir=$(datadir)/devhelp/references/gxml/img
gxmlgtkdocdir=$(datadir)/gtk-doc/html/gxml
+gxmlgtkdoc_DATA= \
+ gtk-doc/gxml/html/*
-common_doc_files = \
- *.css \
- *.png \
- *.js \
- index.htm \
- *.html \
- $(NULL)
-
-gxmldoc_DATA = \
- gxml/GXml/GXml.devhelp2 \
- $(addprefix gxml/GXml/,$(common_doc_files)) \
- $(NULL)
-
-gxmlgtkdoc_DATA = gtk-doc/gxml/html/*
-
-# gxmlimg_DATA = gxml/gxml/img/*.png
-
-# $(gxmldoc_DATA) ($gxmlimg_DATA): gxml-doc
$(gxmldoc_DATA): gxml-doc
$(gxmlgtkdoc_DATA): gxml-gtk-doc
-
-# -------------------------------------------------------
-
-valadoc_flags = \
- --force \
- --package-name=GXml \
- --package-version=$(PACKAGE_VERSION) \
- $(NULL)
-
-# $(top_srcdir)/gxml/internal.vala
-gxml_doc_files_blacklist = \
- $(NULL)
-
-# this expands the list of files, so we can filter out elements
-gxml_doc_files_all = \
- $(wildcard $(top_srcdir)/gxml/*.vala) \
- $(NULL)
-
-gxml_wiki_files = \
- $(addprefix wiki/,$(addsuffix .valadoc,$(gxml_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 = \
- gio-2.0 \
- gee-0.8 \
- libxml-2.0 \
- $(NULL)
-
-valadoc_flags_gxml = \
- $(valadoc_flags) \
- -X $(top_builddir)/gxml/gxml.h \
- $(addprefix --pkg=,$(gxml_doc_deps)) \
- --vapidir=$(top_srcdir)/gxml \
- --vapidir=$(top_srcdir)/vapi \
- --wiki=$(top_srcdir)/docs/valadoc/wiki \
- $(NULL)
-
-
-# $(AM_V_GEN)$(VALADOC)
-gxml-doc:
- $(VALADOC) -o gxml/ --doclet=devhelp $(valadoc_flags_gxml) $(top_srcdir)/gxml/*.vala
-
-# TODO: need to figure out how to not rely on -0.2 in this Makefile.am
-# AM_V_GEN: what does it do? It appears to prettify output but also obscure errors :D
-# $(AM_V_GEN)$(VALADOC)
gxml-gtk-doc:
- $(VALADOC) -o gtk-doc/gxml --doclet=gtkdoc $(valadoc_flags_gxml) $(top_srcdir)/gxml/*.vala
+ $(VALADOC) -o gtk-doc/gxml --doclet=gtkdoc \
+ -X $(top_builddir)/gxml/gxml.h \
+ $(VALADOC_FLAGS) $(sources)
-.PHONY: $(phony_deps)
+all: gxml-doc gxml-gtk-doc
-distclean:
- rm -rf $(distclean_dirs) Makefile
+distclean_dirs = \
+ gxml \
+ gtk-doc
-# Hack, because I don't know how to make the other ones targets :D
-# all: gxml-gtk-doc gxml-doc
+clean:
+ rm -rf $(distclean_dirs)
--include $(top_srcdir)/git.mk
+EXTRA_DIST = \
+ $(WIKI_FILES)
diff --git a/m4/valac.m4 b/m4/valac.m4
new file mode 100644
index 0000000..97ecce6
--- /dev/null
+++ b/m4/valac.m4
@@ -0,0 +1,75 @@
+dnl vapigen.m4
+dnl
+dnl Copyright 2014 Daniel Espinosa
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# VALAC_CHECK([VERSION], [API_VERSION])
+# --------------------------------------
+# Check valac existence and version.
+m4_define([_VALAC_CHECK_INTERNAL],
+[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AS_IF([ test "x$2" = "x" ], [
+ AM_PROG_VALAC($1)
+ AS_IF([ test "x$VALAC" = "xno"], [
+ check_prog=no
+ 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
+ ])
+ ], [
+ AS_IF([ test "x$1" = "x"], [
+ vala_pkg="libvala-$2"
+ ], [
+ vala_pkg="libvala-$2 >= $1"
+ ])
+ AC_MSG_CHECKING([for $vala_pkg])
+ PKG_CHECK_EXISTS([ $vala_pkg ], [
+ vala_pkg_found=yes
+ VAPIGEN=`$PKG_CONFIG --variable=vapigen libvala-$2`
+ VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir libvala-$2`/vala/Makefile.vapigen
+ VAPIDIR=`$PKG_CONFIG --variable=vapidir libvala-$2`
+ GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect libvala-$2`
+ vala_datadir=`$PKG_CONFIG --variable=datadir libvala-$2`
+ VAPIDIR_UNVERSIONED=$vala_datadir/vala/vapi
+ VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=vala_gen_introspect libvala-$2`
+ ], [
+ vala_pkg_found=no
+ AC_MSG_ERROR([no package libvala-$2 is installed])
+ ])
+ AC_MSG_RESULT([$vala_pkg_found])
+ ])
+ AC_SUBST([VAPIGEN])
+ AC_SUBST([VAPIGEN_VAPIDIR])
+ AC_SUBST([VAPIDIR])
+ AC_SUBST([VAPIDIR_UNVERSIONED])
+ AC_SUBST([VAPIGEN_MAKEFILE])
+ AC_SUBST([GEN_INTROSPECT])
+ AC_SUBST([VALA_GEN_INTROSPECT])
+])
+
+dnl Check VAPIGEN
+# VALAC_CHECK([VERSION], [API_VERSION], [DEFAULT])
+# --------------------------------------
+# Check vapigen existence and version.
+AC_DEFUN([VALAC_CHECK],
+[
+ _VALAC_CHECK_INTERNAL($1,$2,$3)
+]
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]