[xiph-commits] r14061 - in trunk/theora: . doc doc/spec

giles at svn.xiph.org giles at svn.xiph.org
Mon Oct 29 17:03:08 PDT 2007


Author: giles
Date: 2007-10-29 17:03:08 -0700 (Mon, 29 Oct 2007)
New Revision: 14061

Added:
   trunk/theora/doc/spec/Makefile.am
Removed:
   trunk/theora/doc/spec/Makefile
Modified:
   trunk/theora/configure.ac
   trunk/theora/doc/Makefile.am
Log:
Attempt (again) to detect the dependencies for building the format 
specification at configure time and then build the spec if it is
both necessary and possible. Having an up-to-date copy of the spec
is now required for 'make dist'.

The spec document itself has been renamed 'Theora.pdf'.


Modified: trunk/theora/configure.ac
===================================================================
--- trunk/theora/configure.ac	2007-10-29 21:41:38 UTC (rev 14060)
+++ trunk/theora/configure.ac	2007-10-30 00:03:08 UTC (rev 14061)
@@ -55,6 +55,49 @@
         AC_MSG_WARN([*** doxygen not found, API documentation will not be built])
 fi
 
+dnl Check for tools used to build the format specification
+AC_CHECK_PROG(HAVE_PDFLATEX, pdflatex, yes)
+AC_CHECK_PROG(HAVE_BIBTEX, bibtex, yes)
+AC_CHECK_PROG(HAVE_TRANSFIG, fig2dev, yes)
+BUILD_SPEC="false"
+if test -r doc/spec/spec.tex; then
+ if test "x$HAVE_PDFLATEX" = "xyes"; then
+  if test "x$HAVE_BIBTEX" = "xyes"; then
+    if test "x$HAVE_TRANSFIG" = "xyes"; then
+      tex_pkg_list=`fgrep usepackage doc/spec/spec.tex | grep \{`
+      tex_pkg_ok="yes"
+      for pkg_line in $tex_pkg_list; do
+	pkg_name=`echo $pkg_line | sed -e 's/.*{\(.*\)}.*/\1/'`
+	AC_MSG_CHECKING([for Tex package $pkg_name])
+        cat >conftest.tex <<_ACEOF
+\\documentclass{book}
+$pkg_line
+\\begin{document}
+Hello World.
+\\end{document}
+_ACEOF
+	if pdflatex -interaction batchmode -halt-on-error conftest < /dev/null > /dev/null 2>&1; then
+          AC_MSG_RESULT([ok])
+        else
+	  tex_pkg_ok="no"
+	  AC_MSG_RESULT([no])
+        fi
+      done
+      if test -w conftest.tex; then rm conftest.tex; fi
+      if test -w conftest.tex; then rm conftest.aux; fi
+      if test -w conftest.pdf; then rm conftest.pdf; fi
+      if test "x$tex_pkg_ok" = "xyes"; then
+        BUILD_SPEC="true"
+      fi
+    fi
+  fi
+ fi
+fi
+AM_CONDITIONAL(BUILD_SPEC, $BUILD_SPEC)
+if test $BUILD_SPEC = "false"; then
+	AC_MSG_WARN([*** Format Specification will not built.])
+fi
+
 dnl Check for valgrind
 VALGRIND_ENVIRONMENT=""
 ac_enable_valgrind=no
@@ -323,7 +366,7 @@
   lib/Makefile
   include/Makefile include/theora/Makefile
   examples/Makefile
-  doc/Makefile doc/Doxyfile
+  doc/Makefile doc/Doxyfile doc/spec/Makefile
   tests/Makefile
   m4/Makefile
   libtheora.spec
@@ -341,7 +384,11 @@
 else
   doc_build="yes"
 fi
-dnl need to handle spec build?
+if test $BUILD_SPEC = "false"; then
+  spec_build="no"
+else
+  spec_build="yes"
+fi
 
 AC_MSG_RESULT([
 ------------------------------------------------------------------------
@@ -352,8 +399,9 @@
     Encoding support: ........... ${ac_enable_encode}
     Floating point support: ..... ${ac_enable_float}
     Assembly optimization: ...... ${cpu_optimization}
+    Build example code: ......... ${ac_enable_examples}
     API Documentation: .......... ${doc_build}
-    Build example code: ......... ${ac_enable_examples}
+    Format Documentation: ....... ${spec_build}
 
   Installation paths:
 

Modified: trunk/theora/doc/Makefile.am
===================================================================
--- trunk/theora/doc/Makefile.am	2007-10-29 21:41:38 UTC (rev 14060)
+++ trunk/theora/doc/Makefile.am	2007-10-30 00:03:08 UTC (rev 14061)
@@ -1,21 +1,17 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = #python
+SUBDIRS = spec
 
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
 
-built_docs =
-
 static_docs = vp3-format.txt color.html \
 	draft-ietf-avt-rtp-theora-00.xml \
 	draft-ietf-avt-rtp-theora-00.txt
 
-doc_DATA = $(built_docs) $(static_docs) doxygen-build.stamp
+doc_DATA = $(static_docs) doxygen-build.stamp
 
-EXTRA_DIST = $(built_docs) $(static_docs) spec Doxyfile.in
+EXTRA_DIST = $(static_docs) Doxyfile.in
 
-CLEANFILES = $(built_docs)
-
 if HAVE_DOXYGEN
 doxygen-build.stamp: Doxyfile $(top_srcdir)/include/theora/*.h
 	doxygen
@@ -75,3 +71,4 @@
 clean-local:
 	if test -d libtheora; then rm -rf libtheora; fi
 	if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi
+

Deleted: trunk/theora/doc/spec/Makefile
===================================================================
--- trunk/theora/doc/spec/Makefile	2007-10-29 21:41:38 UTC (rev 14060)
+++ trunk/theora/doc/spec/Makefile	2007-10-30 00:03:08 UTC (rev 14061)
@@ -1,76 +0,0 @@
-# makefile to generate the spec document from it sources
-# requires transfig and pdflatex
-
-# Alias some shell commands, so we might have a chance of running on non-Unix
-#  platforms some day.
-MV = mv
-RM = rm -f
-
-SPEC_SRCS = spec.tex spec.bib
-
-FIG_SRCS = pic-frame.fig hilbert-mb.fig hilbert-block.fig xifish.fig \
-           superblock.fig macroblock.fig raster-block.fig reference-frames.fig \
-           pixel444.fig pixel422.fig pixel420.fig idct.fig fdct.fig \
-           pic_even.fig pic_even_odd.fig pic_odd.fig pic_odd_even.fig
-
-FIG_TEXS = $(FIG_SRCS:.fig=.tex)
-FIG_AUXS = $(FIG_SRCS:.fig=.aux)
-FIG_PDFS = $(FIG_SRCS:.fig=.pdf)
-
-# add any native-pdf figures here
-FIG_OBJS = $(FIG_PDFS)
-
-Theora_spec.pdf : spec.pdf
-	$(MV) $< $@
-
-spec.pdf : $(SPEC_SRCS) $(FIG_OBJS) vp3huff.tex spec.bbl
-	# three times is the charm with references
-	pdflatex --interaction nonstopmode spec.tex
-	pdflatex --interaction nonstopmode spec.tex
-	pdflatex --interaction nonstopmode spec.tex
-
-spec.aux : spec.tex
-	#Long tables require the .aux file to start from scratch
-	-$(RM) spec.aux
-	pdflatex --interaction nonstopmode $<
-
-spec.bbl : spec.aux spec.bib
-	bibtex $<
-
-vp3huff.tex : vp3huff
-	./vp3huff > $@
-
-figures : $(FIG_OBJS)
-
-# rules to generate latex and pdf versions of the xfig figures
-%.tex : %.fig
-	fig2dev -L latex $< $@
-
-%.pdf : %.fig
-	fig2dev -L pdf -p 0 $< $@
-
-.PHONY: clean distclean maintainer-clean
-
-# clean targets
-clean:
-	-$(RM) $(FIG_TEXS)
-	-$(RM) $(FIG_AUXS)
-	-$(RM) $(FIG_PDFS)
-	-$(RM) vp3huff
-	-$(RM) vp3huff.tex
-	-$(RM) vp3huff.aux
-	-$(RM) spec.aux
-	-$(RM) spec.log
-	-$(RM) spec.lof
-	-$(RM) spec.lot
-	-$(RM) spec.out
-	-$(RM) spec.bbl
-	-$(RM) spec.blg
-	-$(RM) spec.toc
-
-distclean: clean
-
-maintainer-clean: distclean
-	-$(RM) Theora_spec.pdf
-
-maintainerclean: maintainer-clean

Copied: trunk/theora/doc/spec/Makefile.am (from rev 13964, trunk/theora/doc/spec/Makefile)
===================================================================
--- trunk/theora/doc/spec/Makefile.am	                        (rev 0)
+++ trunk/theora/doc/spec/Makefile.am	2007-10-30 00:03:08 UTC (rev 14061)
@@ -0,0 +1,85 @@
+## Process this file with automake to produce Makefile.in
+
+# makefile to generate the spec document from sources
+# requires transfig and pdflatex
+
+docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
+
+built_docs = Theora.pdf
+
+doc_DATA = $(built_docs)
+
+SPEC_SRCS = spec.tex spec.bib
+
+FIG_SRCS = pic-frame.fig hilbert-mb.fig hilbert-block.fig xifish.fig \
+           superblock.fig macroblock.fig raster-block.fig reference-frames.fig \
+           pixel444.fig pixel422.fig pixel420.fig idct.fig fdct.fig \
+           pic_even.fig pic_even_odd.fig pic_odd.fig pic_odd_even.fig
+
+FIG_TEXS = $(FIG_SRCS:.fig=.tex)
+FIG_AUXS = $(FIG_SRCS:.fig=.aux)
+FIG_PDFS = $(FIG_SRCS:.fig=.pdf)
+
+# add any native-pdf figures here
+FIG_OBJS = $(FIG_PDFS)
+
+EXTRA_DIST = $(built_docs) $(SPEC_SRCS) $(FIG_SRCS)
+
+if BUILD_SPEC
+# latex three times is the charm with references
+# we get one for free building spec.bbl
+Theora.pdf : $(SPEC_SRCS) $(FIG_OBJS) vp3huff.tex spec.bbl
+	pdflatex -interaction nonstopmode spec.tex
+	pdflatex -interaction nonstopmode spec.tex
+	mv spec.pdf $@
+else
+Theora.pdf : 
+        echo "*** Warning: Missing tools; $@ will not be built."
+endif
+
+# Long tables require the .aux file to start from scratch
+spec.aux : spec.tex
+	-$(RM) spec.aux
+	pdflatex -interaction nonstopmode $<
+
+spec.bbl : spec.aux spec.bib
+	bibtex $<
+
+vp3huff.tex : vp3huff
+	./vp3huff > $@
+
+noinst_PROGRAMS = vp3huff
+vp3huff_SOURCES = vp3huff.c
+ 
+figures : $(FIG_OBJS)
+
+# rules to generate latex and pdf versions of the xfig figures
+.fig.tex:
+	fig2dev -L latex $< $@
+
+.fig.pdf:
+	fig2dev -L pdf -p 0 $< $@
+
+SUFFIXES = .fig .tex .pdf
+
+# clean targets
+clean-local:
+	-$(RM) $(FIG_TEXS)
+	-$(RM) $(FIG_AUXS)
+	-$(RM) $(FIG_PDFS)
+	-$(RM) vp3huff
+	-$(RM) vp3huff.tex
+	-$(RM) vp3huff.aux
+	-$(RM) spec.aux
+	-$(RM) spec.log
+	-$(RM) spec.lof
+	-$(RM) spec.lot
+	-$(RM) spec.out
+	-$(RM) spec.bbl
+	-$(RM) spec.blg
+	-$(RM) spec.toc
+
+maintainer-clean-local:
+	-$(RM) $(built_docs)
+
+maintainerclean: maintainer-clean



More information about the commits mailing list