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

[Xen-changelog] [xen-unstable] docs: check for documentation generation tools in docs/configure.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 04 Feb 2013 15:44:31 +0000
  • Delivery-date: Mon, 04 Feb 2013 15:44:57 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1359104617 0
# Node ID f57e1546fb08b52a652c259c31384673c9d595e0
# Parent  b25eaeba53f58dabea70b9ef03f7765bc78e08b9
docs: check for documentation generation tools in docs/configure.

It is sometimes hard to discover all the optional tools that should be
on a system to build all available Xen documentation. By checking for
documentation generation tools at ./configure time and displaying a
warning, Xen packagers will more easily learn about new optional build
dependencies, like markdown, when they are introduced.

Based on a patch by Matt Wilson. Changed to use a separate
docs/configure which is called from the top-level in the same manner
as stubdoms.

Rerun autogen.sh and "git add docs/configure" after applying this patch.

Signed-off-by: Matt Wilson <msw@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Matt Wilson <msw@xxxxxxxxxx>
  (For the change to introduce docs/configure)
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r b25eaeba53f5 -r f57e1546fb08 .gitignore
--- a/.gitignore        Fri Jan 25 09:03:36 2013 +0000
+++ b/.gitignore        Fri Jan 25 09:03:37 2013 +0000
@@ -35,6 +35,9 @@ config/Toplevel.mk
 
 build-*
 dist/*
+docs/autom4te.cache/
+docs/config.log
+docs/config.status
 docs/*.aux
 docs/*.dvi
 docs/*.log
@@ -132,6 +135,7 @@ tools/config.status
 tools/config.cache
 config/Tools.mk
 config/Stubdom.mk
+config/Docs.mk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff -r b25eaeba53f5 -r f57e1546fb08 .hgignore
--- a/.hgignore Fri Jan 25 09:03:36 2013 +0000
+++ b/.hgignore Fri Jan 25 09:03:37 2013 +0000
@@ -32,6 +32,10 @@
 ^config/Toplevel\.mk
 ^build-.*$
 ^dist/.*$
+^docs/autom4te\.cache$
+^docs/config\.log$
+^docs/config\.status
+^docs/config/Toplevel\.mk
 ^docs/.*\.aux$
 ^docs/.*\.dvi$
 ^docs/.*\.log$
@@ -322,6 +326,8 @@
 ^tools/config\.status$
 ^tools/config\.cache$
 ^config/Tools\.mk$
+^config/Stubdom\.mk$
+^config/Docs\.mk$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
diff -r b25eaeba53f5 -r f57e1546fb08 README
--- a/README    Fri Jan 25 09:03:36 2013 +0000
+++ b/README    Fri Jan 25 09:03:37 2013 +0000
@@ -57,7 +57,6 @@ provided by your OS distributor:
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
-    * markdown
 
 In addition to the above there are a number of optional build
 prerequisites. Omitting these will cause the related features to be
@@ -66,6 +65,7 @@ disabled at compile time:
       ocaml-findlib). Required to build ocaml components which
       includes the alternative ocaml xenstored.
     * cmake (if building vtpm stub domains)
+    * markdown
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
diff -r b25eaeba53f5 -r f57e1546fb08 autogen.sh
--- a/autogen.sh        Fri Jan 25 09:03:36 2013 +0000
+++ b/autogen.sh        Fri Jan 25 09:03:37 2013 +0000
@@ -1,7 +1,12 @@
 #!/bin/sh -e
 autoconf
-cd tools
-autoconf
-autoheader
-cd ../stubdom
-autoconf
+( cd tools
+  autoconf
+  autoheader
+)
+( cd stubdom
+  autoconf
+)
+( cd docs
+  autoconf
+)
diff -r b25eaeba53f5 -r f57e1546fb08 config/Docs.mk.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/Docs.mk.in Fri Jan 25 09:03:37 2013 +0000
@@ -0,0 +1,13 @@
+# Prefix and install folder
+prefix              := @prefix@
+PREFIX              := $(prefix)
+exec_prefix         := @exec_prefix@
+libdir              := @libdir@
+LIBDIR              := $(libdir)
+
+# Tools
+FIG2DEV             := @FIG2DEV@
+POD2MAN             := @POD2MAN@
+POD2HTML            := @POD2HTML@
+POD2TEXT            := @POD2TEXT@
+MARKDOWN            := @MARKDOWN@
diff -r b25eaeba53f5 -r f57e1546fb08 docs/Docs.mk
--- a/docs/Docs.mk      Fri Jan 25 09:03:36 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-FIG2DEV                := fig2dev
-LATEX2HTML     := latex2html
-POD2MAN                := pod2man
-POD2HTML       := pod2html
-POD2TEXT       := pod2text
-MARKDOWN       := markdown
diff -r b25eaeba53f5 -r f57e1546fb08 docs/Makefile
--- a/docs/Makefile     Fri Jan 25 09:03:36 2013 +0000
+++ b/docs/Makefile     Fri Jan 25 09:03:37 2013 +0000
@@ -2,7 +2,7 @@
 
 XEN_ROOT=$(CURDIR)/..
 include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/docs/Docs.mk
+-include $(XEN_ROOT)/config/Docs.mk
 
 VERSION                = xen-unstable
 
@@ -32,21 +32,27 @@ html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
 txt:
-       @if which $(POD2TEXT) 1>/dev/null 2>/dev/null; then \
-       $(MAKE) $(DOC_TXT); else              \
-       echo "pod2text not installed; skipping text outputs."; fi
+ifdef POD2TEXT
+       $(MAKE) $(DOC_TXT)
+else
+       @echo "pod2text not installed; skipping text outputs."
+endif
 
 .PHONY: figs
 figs:
-       @set -e ; if which $(FIG2DEV) 1>/dev/null 2>/dev/null; then \
-       set -x; $(MAKE) -C figs ; else                   \
-       echo "fig2dev (transfig) not installed; skipping figs."; fi
+ifdef FIG2DEV
+       set -x; $(MAKE) -C figs
+else
+       @echo "fig2dev (transfig) not installed; skipping figs."
+endif
 
 .PHONY: man-pages
 man-pages:
-       @if which $(POD2MAN) 1>/dev/null 2>/dev/null; then \
-       $(MAKE) $(DOC_MAN1) $(DOC_MAN5); else              \
-       echo "pod2man not installed; skipping man-pages."; fi
+ifdef POD2MAN
+       $(MAKE) $(DOC_MAN1) $(DOC_MAN5)
+else
+       @echo "pod2man not installed; skipping man-pages."
+endif
 
 man1/%.1: man/%.pod.1 Makefile
        $(INSTALL_DIR) $(@D)
@@ -69,6 +75,8 @@ clean:
 
 .PHONY: distclean
 distclean: clean
+       rm -rf ../config/Docs.mk config.log config.status config.cache \
+               autom4te.cache
 
 .PHONY: install
 install: all
@@ -84,30 +92,40 @@ html/index.html: $(DOC_HTML) ./gen-html-
        perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
 
 html/%.html: %.markdown
-       @$(INSTALL_DIR) $(@D)
-       @set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
-       echo "Running markdown to generate $*.html ... "; \
+       $(INSTALL_DIR) $(@D)
+ifdef MARKDOWN
+       @echo "Running markdown to generate $*.html ... "
        $(MARKDOWN) $< > $@.tmp ; \
-       $(call move-if-changed,$@.tmp,$@) ; else \
-       echo "markdown not installed; skipping $*.html."; fi
+       $(call move-if-changed,$@.tmp,$@)
+else
+       @echo "markdown not installed; skipping $*.html."
+endif
 
 html/%.txt: %.txt
-       @$(INSTALL_DIR) $(@D)
+       $(INSTALL_DIR) $(@D)
        cp $< $@
 
 html/man/%.1.html: man/%.pod.1 Makefile
        $(INSTALL_DIR) $(@D)
+ifdef POD2HTML
        $(POD2HTML) --infile=$< --outfile=$@.tmp
        $(call move-if-changed,$@.tmp,$@)
+else
+       @echo "pod2html not installed; skipping $<."
+endif
 
 html/man/%.5.html: man/%.pod.5 Makefile
        $(INSTALL_DIR) $(@D)
+ifdef POD2HTML
        $(POD2HTML) --infile=$< --outfile=$@.tmp
        $(call move-if-changed,$@.tmp,$@)
+else
+       @echo "pod2html not installed; skipping $<."
+endif
 
 html/hypercall/index.html: ./xen-headers
        rm -rf $(@D)
-       @$(INSTALL_DIR) $(@D)
+       $(INSTALL_DIR) $(@D)
        ./xen-headers -O $(@D) \
                -T 'arch-x86_64 - Xen public headers' \
                -X arch-ia64 -X arch-x86_32 -X xen-x86_32 -X arch-arm \
@@ -127,11 +145,23 @@ txt/%.txt: %.markdown
 
 txt/man/%.1.txt: man/%.pod.1 Makefile
        $(INSTALL_DIR) $(@D)
+ifdef POD2TEXT
        $(POD2TEXT) $< $@.tmp
        $(call move-if-changed,$@.tmp,$@)
+else
+       @echo "pod2text not installed; skipping $<."
+endif
 
 txt/man/%.5.txt: man/%.pod.5 Makefile
        $(INSTALL_DIR) $(@D)
+ifdef POD2TEXT
        $(POD2TEXT) $< $@.tmp
        $(call move-if-changed,$@.tmp,$@)
+else
+       @echo "pod2text not installed; skipping $<."
+endif
 
+ifeq (,$(findstring clean,$(MAKECMDGOALS)))
+$(XEN_ROOT)/config/Docs.mk:
+       $(error You have to run ./configure before building docs)
+endif
diff -r b25eaeba53f5 -r f57e1546fb08 docs/configure.ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/configure.ac Fri Jan 25 09:03:37 2013 +0000
@@ -0,0 +1,20 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.67])
+AC_INIT([Xen Hypervisor Documentation], m4_esyscmd([../version.sh 
../xen/Makefile]),
+    [xen-devel@xxxxxxxxxxxxx], [xen], [http://www.xen.org/])
+AC_CONFIG_SRCDIR([misc/xen-command-line.markdown])
+AC_CONFIG_FILES([../config/Docs.mk])
+AC_CONFIG_AUX_DIR([../])
+
+# M4 Macro includes
+m4_include([../m4/docs_tool.m4])
+
+AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
+AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
+AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
+AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
+AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
+
+AC_OUTPUT()
diff -r b25eaeba53f5 -r f57e1546fb08 docs/figs/Makefile
--- a/docs/figs/Makefile        Fri Jan 25 09:03:36 2013 +0000
+++ b/docs/figs/Makefile        Fri Jan 25 09:03:37 2013 +0000
@@ -1,7 +1,7 @@
 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/docs/Docs.mk
+-include $(XEN_ROOT)/config/Docs.mk
 
 TARGETS= network-bridge.png network-basic.png
 
diff -r b25eaeba53f5 -r f57e1546fb08 m4/docs_tool.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/m4/docs_tool.m4   Fri Jan 25 09:03:37 2013 +0000
@@ -0,0 +1,17 @@
+AC_DEFUN([AX_DOCS_TOOL_PROG], [
+dnl
+    AC_ARG_VAR([$1], [Path to $2 tool])
+    AC_PATH_PROG([$1], [$2])
+    AS_IF([! test -x "$ac_cv_path_$1"], [
+        AC_MSG_WARN([$2 is not available so some documentation won't be built])
+    ])
+])
+
+AC_DEFUN([AX_DOCS_TOOL_PROGS], [
+dnl
+    AC_ARG_VAR([$1], [Path to $2 tool])
+    AC_PATH_PROGS([$1], [$3])
+    AS_IF([! test -x "$ac_cv_path_$1"], [
+        AC_MSG_WARN([$2 is not available so some documentation won't be built])
+    ])
+])

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.