[PATCH wayland 3/3] doc: Provide a fallback solution when Publican is not found

Tiago Vignatti tiago.vignatti at intel.com
Wed Nov 14 08:18:23 PST 2012


It provides a simple HTML solution from DocBook.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 configure.ac            |   13 ++++++++++++-
 doc/Wayland/Makefile.am |    5 ++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index a451948..f423991 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,12 @@ AC_ARG_ENABLE([documentation],
 	      [],
 	      [enable_documentation=yes])
 
+AC_ARG_ENABLE([publican],
+	      [AC_HELP_STRING([--disable-publican],
+		              [Disable building the documentation with Publican])],
+	      [],
+	      [enable_publican=yes])
+
 AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
 
 AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
@@ -84,7 +90,12 @@ if test "x$enable_documentation" = "xyes"; then
 		AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
 	fi
 
-	AC_PATH_PROG(PUBLICAN, publican)
+	# fallback to xmllint + a XSLT xsltproc when publican is lacking
+	if test "x$enable_publican" = "xyes"; then
+		AC_PATH_PROG(PUBLICAN, publican)
+	else
+		AC_PATH_PROG(XMLLINT, xmllint)
+	fi
 
 	if test "x$PUBLICAN" != "x"; then
 		PUBLICAN_VERSION=`$PUBLICAN -v | cut -d'=' -f2`
diff --git a/doc/Wayland/Makefile.am b/doc/Wayland/Makefile.am
index 6c328ea..8386942 100644
--- a/doc/Wayland/Makefile.am
+++ b/doc/Wayland/Makefile.am
@@ -68,7 +68,10 @@ Wayland: $(doc_targets)
 	@touch Wayland
 else
 Wayland: $(doc_targets)
-	$(AM_V_GEN)mkdir -p $(srcdir)/Wayland
+	$(AM_V_GEN)$(mkdir_p) $(srcdir)/Wayland/en-US/html/
+	$(AM_V_GEN)cp -rf $(srcdir)/en-US/images/ $(srcdir)/Wayland/en-US/html/
+	$(AM_V_GEN)$(XMLLINT) --xinclude $(builddir)/en-US/Wayland.xml > $(builddir)/en-US/resolved.xml
+	$(AM_V_GEN)$(XSLTPROC) /usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml/docbook.xsl $(builddir)/en-US/resolved.xml > $(srcdir)/Wayland/en-US/html/index.html
 endif
 
 CLEANFILES = en-US/ProtocolSpec.xml en-US/ProtocolInterfaces.xml en-US/WaylandClientAPI.xml $(doc_targets)
-- 
1.7.9.5



More information about the wayland-devel mailing list