docs: Honour --{en, dis}able-xend when building docs
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Mar 2014 11:24:04 +0000 (11:24 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 1 Apr 2014 10:17:27 +0000 (11:17 +0100)
If a user has specified --disable-xend, they wont want the manpages either.

Propagating this parameters requires reorganising the way in which the
makefile chooses which documents to build.

There is now a split of {MAN1,MAN5,MARKDOWN,TXT}SRC-y to select which
documentation to build, which is separate from the patsubst section which
generates appropriate paths to trigger the later rules.

The manpages are quite easy to split between xend, xl and xenstore, and have
been.  Items from misc/ are much harder and been left.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
[ ijc -- reran autogen.sh as requested. ]

config/Docs.mk.in
docs/Makefile
docs/configure
docs/configure.ac

index a2a72fdcc58443dd432042c425633f8f9a4190d8..03fac601450cd78d1e579d51a22544d22a75c6b6 100644 (file)
@@ -12,3 +12,6 @@ POD2HTML            := @POD2HTML@
 POD2TEXT            := @POD2TEXT@
 MARKDOWN            := @MARKDOWN@
 PERL                := @PERL@
+
+# Subsets of documentation to build
+CONFIG_XEND         := @xend@
index 8d5d48e35547a6a5f073ae506b08e8996ecb0dc4..06a9bc8b34eaabbc9dfe2385bf1c0cbeeab7051f 100644 (file)
@@ -6,20 +6,30 @@ VERSION               := $(shell $(MAKE) -C $(XEN_ROOT)/xen --no-print-directory xenversion)
 
 DOC_ARCHES      := arm x86_32 x86_64
 
-DOC_MAN5SRC    := $(wildcard man/*.pod.5)
-DOC_MAN1SRC    := $(wildcard man/*.pod.1)
-DOC_MAN1       := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
-DOC_MAN5       := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
-DOC_MARKDOWN   := $(wildcard misc/*.markdown)
-DOC_HTML       := $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
-                  $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
-                  $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
-                  $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt)) \
-                  $(patsubst %,html/hypercall/%/index.html,$(DOC_ARCHES))
-DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
-                  $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
-                  $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
-                  $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
+# Documentation sources to build
+MAN1SRC-y := $(wildcard man/xl*.pod.1)
+MAN1SRC-y += $(wildcard man/xenstore*.pod.1)
+MAN1SRC-$(CONFIG_XEND) += man/xm.pod.1
+
+MAN5SRC-y := $(wildcard man/xl*.pod.5)
+MAN5SRC-$(CONFIG_XEND) += man/xend-config.sxp.pod.5 man/xmdomain.cfg.pod.5
+
+MARKDOWNSRC-y := $(wildcard misc/*.markdown)
+
+TXTSRC-y := $(wildcard misc/*.txt)
+
+
+DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(MAN1SRC-y))
+DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(MAN5SRC-y))
+DOC_HTML := $(patsubst %.markdown,html/%.html,$(MARKDOWNSRC-y)) \
+            $(patsubst man/%.pod.1,html/man/%.1.html,$(MAN1SRC-y)) \
+            $(patsubst man/%.pod.5,html/man/%.5.html,$(MAN5SRC-y)) \
+            $(patsubst %.txt,html/%.txt,$(TXTSRC-y)) \
+            $(patsubst %,html/hypercall/%/index.html,$(DOC_ARCHES))
+DOC_TXT  := $(patsubst %.txt,txt/%.txt,$(TXTSRC-y)) \
+            $(patsubst %.markdown,txt/%.txt,$(MARKDOWNSRC-y)) \
+            $(patsubst man/%.pod.1,txt/man/%.1.txt,$(MAN1SRC-y)) \
+            $(patsubst man/%.pod.5,txt/man/%.5.txt,$(MAN5SRC-y))
 
 .PHONY: all
 all: build
index 926da30742cfd47b77db29b7c6924ee1d5d62111..c54f43189ba5aa1e479d75c2b543b6b6c54dd9af 100755 (executable)
@@ -588,6 +588,7 @@ ac_unique_file="misc/xen-command-line.markdown"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 PERL
+xend
 MARKDOWN
 POD2TEXT
 POD2HTML
@@ -634,6 +635,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_xend
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1249,6 +1251,13 @@ if test -n "$ac_init_help"; then
    esac
   cat <<\_ACEOF
 
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-xend           Enable xend toolstack documentation (default is
+                          DISABLED)
+
 Some influential environment variables:
   FIG2DEV     Path to fig2dev tool
   POD2MAN     Path to pod2man tool
@@ -1732,6 +1741,12 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+
+
+
+
+
+
     # Extract the first word of "fig2dev", so it can be a program name with args.
 set dummy fig2dev; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -1981,6 +1996,31 @@ $as_echo "$as_me: WARNING: markdown is not available so some documentation won't
 fi
 
 
+# Enable/disable options
+
+# Check whether --enable-xend was given.
+if test "${enable_xend+set}" = set; then :
+  enableval=$enable_xend;
+fi
+
+
+if test "x$enable_xend" = "xno"; then :
+
+    ax_cv_xend="n"
+
+elif test "x$enable_xend" = "xyes"; then :
+
+    ax_cv_xend="y"
+
+elif test -z $ax_cv_xend; then :
+
+    ax_cv_xend="n"
+
+fi
+xend=$ax_cv_xend
+
+
+
 
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
index f0ebf00fa7f144f778eb9db957528c906e4adb46..7e6d1b1656b67e8fa1c7dbd726ebadcf8e6ea3a4 100644 (file)
@@ -11,6 +11,7 @@ AC_CONFIG_AUX_DIR([../])
 # M4 Macro includes
 m4_include([../m4/docs_tool.m4])
 m4_include([../m4/path_or_fail.m4])
+m4_include([../m4/features.m4])
 
 AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
 AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
@@ -18,6 +19,9 @@ AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
 AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
 AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
 
+# Enable/disable options
+AX_ARG_DEFAULT_DISABLE([xend], [Enable xend toolstack documentation])
+
 AC_ARG_VAR([PERL], [Path to Perl parser])
 AX_PATH_PROG_OR_FAIL([PERL], [perl])