|
From: Ralf W. <Ral...@gm...> - 2005-06-25 08:21:56
|
Hi there,
Do you prefer proposed patches via the bug tracker or are mails to this
list ok?
Below is an attempt to make building the documentation possible when
srcdir != builddir. There is a decision to make: either to build the
docs in the source tree or in the build tree. The former is easier to
implement, but prevents multiple concurrent builds from different build
trees. (For example: In order to test packages, I like to fire up
something along these lines:
mkdir build-32 build-64 build-icc
# ... (configure and build each of these from the same source tree)
# days later:
( cd $source_tree && svn update )
( cd build-32 && make distcheck > distchecklog 2>&1 </dev/null )&
( cd build-64 && make distcheck > distchecklog 2>&1 </dev/null )&
( cd build-icc && make distcheck > distchecklog 2>&1 </dev/null )&
This won't work reliably then, an arguably small backdraw.
Furthermore, building docs in source might need yet another workaround
for "distcheck" to work with this -- in a later mail.
The latter (building docs in the build tree) is usually harder to get
right because many doc tools are not prepared for such flexibility.
Since valgrind does not builds docs in the "make all" case anyway, here
is a patch to build in the source tree, and to fix a few more glitches
in that area: For me, pdfxmltex stopped for user input because of a
latex syntax error caused by different xml versions. Without seeing
latex output, it's very confusing to see the build just wait without
load. The other way to solve this would be to invoke latex in batch
mode, and/or redirect stdin to /dev/null. YMMV over the preferred
solution here.
Also, I made LOGFILE contain the output of all pdfxmltex runs, not just
the last one.
Then, there is a small DESTDIR-related glitch fixed.
After this, I still can't get it to work, but remaining problems seem
XML version related.
Regards,
Ralf
CHANGES:
* docs/Makefile.am (valid, html-docs, print-docs):
Build documentation below srcdir: cd to srcdir before doing anything;
correctly bail out on the first error.
(print-docs): Output pdfxmltex errors also to terminal, in order to
allow sensible, possibly necessary user interaction with latex.
(dist-hook): Adjust for docs in srcdir.
(install-data-hook): Fix for DESTDIR install.
Index: docs/Makefile.am
===================================================================
--- docs/Makefile.am (Revision 4015)
+++ docs/Makefile.am (Arbeitskopie)
@@ -37,47 +37,49 @@
all-docs: html-docs print-docs
valid:
- $(XMLLINT) $(XMLLINT_FLAGS) $(xmldir)/index.xml
+ cd $(srcdir) && $(XMLLINT) $(XMLLINT_FLAGS) $(xmldir)/index.xml
# chunked html
html-docs:
@echo "Generating html files..."
- export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
- mkdir -p $(htmldir)
- /bin/rm -fr $(htmldir)/
- mkdir -p $(htmldir)/
- mkdir -p $(htmldir)/images
- cp $(libdir)/vg_basic.css $(htmldir)/
- cp $(imgdir)/*.png $(htmldir)/images
+ cd $(srcdir) && \
+ export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
+ mkdir -p $(htmldir) && \
+ /bin/rm -fr $(htmldir)/ && \
+ mkdir -p $(htmldir)/ && \
+ mkdir -p $(htmldir)/images && \
+ cp $(libdir)/vg_basic.css $(htmldir)/ && \
+ cp $(imgdir)/*.png $(htmldir)/images && \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o $(htmldir)/ $(XSL_HTML_CHUNK_STYLE) $(xmldir)/index.xml
# pdf and postscript
print-docs:
- @echo "Generating PDF file: $(printdir)/index.pdf (please be patient)...";
- export XML_CATALOG_FILES=$(XML_CATALOG_FILES);
- mkdir -p $(printdir);
- mkdir -p $(printdir)/images;
- cp $(imgdir)/massif-graph-sm.png $(printdir)/images;
- $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(printdir)/index.fo $(XSL_FO_STYLE) $(xmldir)/index.xml;
- (cd $(printdir); \
- pdfxmltex index.fo &> $(LOGFILE); \
- pdfxmltex index.fo &> $(LOGFILE); \
- pdfxmltex index.fo &> $(LOGFILE); \
+ @echo "Generating PDF file: $(printdir)/index.pdf (please be patient)..."
+ cd $(srcdir) && \
+ export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
+ mkdir -p $(printdir) && \
+ mkdir -p $(printdir)/images && \
+ cp $(imgdir)/massif-graph-sm.png $(printdir)/images && \
+ $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(printdir)/index.fo $(XSL_FO_STYLE) $(xmldir)/index.xml && \
+ (cd $(printdir) && \
+ ( pdfxmltex index.fo && \
+ pdfxmltex index.fo && \
+ pdfxmltex index.fo ) 2>&1 | tee $(LOGFILE) && \
echo "Generating PS file: $(printdir)/index.ps ..."; \
pdftops index.pdf; \
- rm *.log *.aux *.fo *.out)
+ rm -f *.log *.aux *.fo *.out)
# If the docs have been built, install them. But don't worry if they have
# not -- developers do 'make install' not from a 'make dist'-ified distro all
# the time.
install-data-hook:
if test -r html ; then \
- mkdir -p $(datadir)/doc/valgrind/; \
- cp -r html $(datadir)/doc/valgrind/; \
+ mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \
+ cp -r $(srcdir)/html $(DESTDIR)$(datadir)/doc/valgrind/; \
fi
dist-hook: html-docs
- cp -r html $(distdir)
+ cp -r $(srcdir)/html $(distdir)
distclean-local:
- rm -rf html print
+ cd $(srcdir) && rm -rf html print
|