aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-01-25 09:03:37 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-01-25 09:03:37 +0000
commit9db0ad0f460926d9667dab832663f3d011407024 (patch)
tree8983e2210327ba4460623a72cf16757b63b98fd4 /docs
parent5806093a20e20209d4b88ab866ae1e6017c95de7 (diff)
downloadxen-9db0ad0f460926d9667dab832663f3d011407024.tar.gz
xen-9db0ad0f460926d9667dab832663f3d011407024.tar.bz2
xen-9db0ad0f460926d9667dab832663f3d011407024.zip
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@amazon.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> (For the change to introduce docs/configure) Acked-by: Roger Pau Monné <roger.pau@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/Docs.mk6
-rw-r--r--docs/Makefile66
-rw-r--r--docs/configure.ac20
-rw-r--r--docs/figs/Makefile2
4 files changed, 69 insertions, 25 deletions
diff --git a/docs/Docs.mk b/docs/Docs.mk
deleted file mode 100644
index db3c19d81a..0000000000
--- a/docs/Docs.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-FIG2DEV := fig2dev
-LATEX2HTML := latex2html
-POD2MAN := pod2man
-POD2HTML := pod2html
-POD2TEXT := pod2text
-MARKDOWN := markdown
diff --git a/docs/Makefile b/docs/Makefile
index 053d7af815..fdebae819a 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -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-index INDEX
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 --git a/docs/configure.ac b/docs/configure.ac
new file mode 100644
index 0000000000..ea0552e43d
--- /dev/null
+++ b/docs/configure.ac
@@ -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@lists.xen.org], [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 --git a/docs/figs/Makefile b/docs/figs/Makefile
index 5ecdae37fe..e128a4364f 100644
--- a/docs/figs/Makefile
+++ b/docs/figs/Makefile
@@ -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