Commit 8db79b64 authored by Ralph Giles's avatar Ralph Giles
Browse files

Basic makefile support for generating the documentation. It should

avoid trying to build them on systems without the proper tools.

svn path=/trunk/vorbis/; revision=4069
parent 86e78970
......@@ -41,6 +41,27 @@ CFLAGS="$cflags_save"
AM_PROG_LIBTOOL
dnl docbook xml transform and processing tools
AC_ARG_ENABLE(docs,
AC_HELP_STRING([--disable-docs],[don't build the documentation]),
[case "${enableval}" in
yes) build_docs=true;;
no) build_docs=false;;
*) AC_MSG_ERROR(unknown value ${enableval} for --enable-docs);;
esac],[build_docs=true])
dnl ideally we'd look for other tools and support them
if test x$build_docs = xtrue; then
AC_CHECK_PROGS([XSLTPROC], xsltproc, [/bin/false])
AC_CHECK_PROGS([PDFXMLTEX], pdfxmltex, [/bin/false])
if test "x$XSLTPROC" = "x/bin/false" || test "x$PDFXMLTEX" = "x/bin/false"; then
build_docs=false
AC_MSG_WARN([Documentation will not be built])
fi
fi
AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xtrue])
dnl --------------------------------------------------
dnl Set build flags based on environment
dnl --------------------------------------------------
......
......@@ -6,6 +6,13 @@ SUBDIRS = vorbisfile vorbisenc
docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
# conditionally make the generated documentation
if BUILD_DOCS
built_docs = Vorbis_I_spec.html Vorbis_I_spec.pdf
else
built_docs =
endif !BUILD_DOCS
doc_DATA = components.png \
draft-moffitt-vorbis-rtp-00.txt \
eightphase.png \
......@@ -49,6 +56,42 @@ doc_DATA = components.png \
white-ogg.png \
white-xifish.png \
window1.png \
window2.png
window2.png \
Vorbis_I_spec.html \
$(built_docs)
doc_sources = xml/Vorbis_I_spec.xml \
xml/01-introduction.xml \
xml/02-bitpacking.xml \
xml/03-codebook.xml \
xml/04-codec.xml \
xml/05-comment.xml \
xml/06-floor0.xml \
xml/07-floor1.xml \
xml/08-residue.xml \
xml/09-helper.xml \
xml/10-tables.xml \
xml/a1-encapsulation_ogg.xml \
xml/a2-encapsulation_rtp.xml \
xml/footer.xml \
xml/spec-common.xsl \
xml/spec-fo.xsl \
xml/spec-html.xsl
EXTRA_DIST = $(doc_DATA)
nobase_EXTRA_DIST = $(doc_sources)
# explicit rules for generating docs
Vorbis_I_spec.html:
xsltproc --xinclude --output $@ xml/spec-html.xsl xml/Vorbis_I_spec.xml
Vorbis_I_spec.fo:
xsltproc --xinclude --output $@ xml/spec-fo.xsl xml/Vorbis_I_spec.xml
Vorbis_I_spec.pdf: Vorbis_I_spec.fo
cp $< spec.fo # work around a passivetex bug
pdfxmltex --interaction nonstopmode spec.fo
pdfxmltex --interaction nonstopmode spec.fo
rm spec.fo
mv spec.pdf $@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment