trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [10/50] [abbrv] git commit: TS-1929: fix sphinx documentation build
Date Tue, 04 Jun 2013 16:46:04 GMT
TS-1929: fix sphinx documentation build

The sphinx documentation was using GNU make extensions for recursive
variable expansion. Recent versions of automake were detecting that
as an error. We can work around it by doing the expansion in the
shell.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/37aabf5e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/37aabf5e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/37aabf5e

Branch: refs/heads/3.3.x
Commit: 37aabf5e7f53fb6028d72a204c2c9d7f43ef1b49
Parents: f697d0d
Author: James Peach <jpeach@apache.org>
Authored: Fri May 31 15:36:50 2013 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Fri May 31 15:36:50 2013 -0700

----------------------------------------------------------------------
 doc/Makefile.am |   31 ++++++++++++++++++-------------
 doc/sbuild      |   27 +++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37aabf5e/doc/Makefile.am
----------------------------------------------------------------------
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d928606..b2e1a4e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -110,15 +110,20 @@ doxygen: Doxyfile
 # You can set these variables from the command line.
 SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
-PAPER         =
+PAPER         = letter
 BUILDDIR      = build
 
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir)/source
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(SPHINXOPTS)
 # the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir)/source
+I18NSPHINXOPTS  = $(SPHINXOPTS)
+
+# The PAPER setting variables requires recursive make variable expansion, which automake
+# detects as non-portable. We bounce this through a shell script and do the expansion there.
+SBUILD = PAPEROPT_a4="$(PAPEROPT_a4)" PAPEROPT_letter="$(PAPEROPT_letter)" PAPER="$(PAPER)"
\
+	 $(srcdir)/sbuild $(SPHINXBUILD) $(ALLSPHINXOPTS)
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
@@ -143,38 +148,38 @@ help:
 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 
 html-local:
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	$(SBUILD) -b html $(srcdir)/source $(BUILDDIR)/html
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
 
 dirhtml:
-	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	$(SBUILD) -b dirhtml $(srcdir)/source $(BUILDDIR)/dirhtml
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
 
 singlehtml:
-	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	$(SBUILD) -b singlehtml $(srcdir)/source $(BUILDDIR)/singlehtml
 	@echo
 	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
 
 pickle:
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	$(SBUILD) -b pickle $(srcdir)/source $(BUILDDIR)/pickle
 	@echo
 	@echo "Build finished; now you can process the pickle files."
 
 json:
-	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	$(SBUILD) -b json $(srcdir)/source $(BUILDDIR)/json
 	@echo
 	@echo "Build finished; now you can process the JSON files."
 
 htmlhelp:
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	$(SBUILD) -b htmlhelp $(srcdir)/source $(BUILDDIR)/htmlhelp
 	@echo
 	@echo "Build finished; now you can run HTML Help Workshop with the" \
 	      ".hhp project file in $(BUILDDIR)/htmlhelp."
 
 qthelp:
-	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	$(SBUILD) -b qthelp $(srcdir)/source $(BUILDDIR)/qthelp
 	@echo
 	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
 	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@@ -183,7 +188,7 @@ qthelp:
 	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ApacheTrafficServer.qhc"
 
 devhelp:
-	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	$(SBUILD) -b devhelp $(srcdir)/source $(BUILDDIR)/devhelp
 	@echo
 	@echo "Build finished."
 	@echo "To view the help file:"
@@ -192,10 +197,10 @@ devhelp:
 	@echo "# devhelp"
 
 epub:
-	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	$(SBUILD) -b epub $(srcdir)/source $(BUILDDIR)/epub
 	@echo
 	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
 
 latex:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	$(SBUILD) -b latex $(srcdir)/source $(BUILDDIR)/latex
 	@echo

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37aabf5e/doc/sbuild
----------------------------------------------------------------------
diff --git a/doc/sbuild b/doc/sbuild
new file mode 100755
index 0000000..ee1a62c
--- /dev/null
+++ b/doc/sbuild
@@ -0,0 +1,27 @@
+#! /usr/bin/env sh
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+# sbuild: trivial sphinx-build wrapper to handle recursive make variable expansion.
+
+SPHINXBUILD="$1"
+shift
+
+exec $SPHINXBUILD \
+  `eval echo \\$PAPEROPT_$PAPER` \
+  "$@"
+


Mime
View raw message