[Genabel-commits] r1843 - pkg/OmicABELnoMM
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Oct 24 11:17:06 CEST 2014
Author: lckarssen
Date: 2014-10-24 11:17:06 +0200 (Fri, 24 Oct 2014)
New Revision: 1843
Modified:
pkg/OmicABELnoMM/Makefile.am
pkg/OmicABELnoMM/configure.ac
Log:
In OmicABELnoMM: Copied (and slightly adjusted) the code from ProbABEL that enables building the PDF documentation from LaTeX source.
Currently this works when running 'make', but 'make distcheck' fails. Probably has something to do with the fact that OmicABELnoMM uses a non-recursive automake, whereas ProbABEL is still recursive. I'll keep working on a functional version.
Modified: pkg/OmicABELnoMM/Makefile.am
===================================================================
--- pkg/OmicABELnoMM/Makefile.am 2014-10-23 11:40:41 UTC (rev 1842)
+++ pkg/OmicABELnoMM/Makefile.am 2014-10-24 09:17:06 UTC (rev 1843)
@@ -18,12 +18,63 @@
CLEANFILES = tempAL.bin tempB.bin tempY.bin tempAR.bin
-## Stuff needed for documentation in the doc/ directory
-dist_doc_DATA = doc/howtocompile.txt doc/UserGuide.tex \
-COPYING INSTALL ChangeLog AUTHORS
-
## Specify where to store the examples data
exampledir = $(pkgdatadir)/examples
dist_example_DATA = examples/CreateData.R examples/XL.fvd \
examples/XL.fvi examples/XR.fvd examples/XR.fvi \
examples/Y.fvd examples/Y.fvi
+
+
+## Stuff needed for documentation in the doc/ directory
+dist_doc_DATA = doc/howtocompile.txt doc/UserGuide.tex \
+ COPYING INSTALL ChangeLog AUTHORS
+
+## Build the PDF documentation if building of the LaTeX docs is
+## enabled via ./configure.
+if BUILD_latexdoc
+if HAVE_PDFLATEX
+DOCDIR = doc/
+MANNAME = $(DOCDIR)/UserGuide
+MANPDF = $(MANNAME).pdf
+MANTEXSRC = $(MANNAME).tex
+MANAUX = $(MANNAME).aux
+doc_DATA = $(MANPDF)
+PDFLATEXOPTS = --output-directory=$(DOCDIR)
+
+CLEANFILES += $(MANPDF) $(MANNAME).log $(MANNAME).idx $(MANNAME).out \
+ $(MANNAME).toc $(MANNAME).idx $(MANNAME).ilg $(MANNAME).ind $(MANAUX) .btmp
+endif
+endif
+
+
+# Several make rules to generate the PDF from the LaTeX source
+.aux.pdf:
+ @echo === Making PDF: $@ from $^ ===
+ $(PDFLATEX) $(PDFLATEXOPTS) $(srcdir)/$(MANTEXSRC)
+ @while ( grep "Rerun to " \
+ $(MANNAME).log ); do \
+ echo '** Re-running LaTeX **'; \
+ $(PDFLATEX) $(PDFLATEXOPTS) $(srcdir)/$(MANTEXSRC); \
+ done
+ if [ -f $(MANNAME).idx ]; then \
+ echo === Making index ===; \
+ makeindex $(MANNAME); \
+ fi
+ @echo === Making final PDF ===
+ $(PDFLATEX) $(PDFLATEXOPTS) $(srcdir)/$(MANTEXSRC)
+
+.tex.aux:
+ @echo === Making $@ file from $^, we are in $(shell pwd) ===
+ $(PDFLATEX) $(PDFLATEXOPTS) $(srcdir)/$(MANTEXSRC)
+## Look for citations. Make sure grep never returns an error code.
+ @grep "^\\\\citation" $(MANAUX) > .btmp.new || true
+## If the citations are not changed, don't do anything. Otherwise replace
+## the .btmp file to make sure BibTeX will be run.
+ @if ( diff .btmp.new .btmp > /dev/null ); then \
+ rm .btmp.new; \
+ else \
+ mv .btmp.new .btmp; \
+ fi
+
+# A target needed to keep track of the nr. of LaTeX runs
+.btmp:
Modified: pkg/OmicABELnoMM/configure.ac
===================================================================
--- pkg/OmicABELnoMM/configure.ac 2014-10-23 11:40:41 UTC (rev 1842)
+++ pkg/OmicABELnoMM/configure.ac 2014-10-24 09:17:06 UTC (rev 1843)
@@ -93,6 +93,26 @@
AC_FUNC_MALLOC
AC_CHECK_FUNCS([clock_gettime gettimeofday memset])
+# The user can disable building of the PDF of the manual, for example
+# if the required LaTeX packages are not installed
+AC_ARG_ENABLE([latex-doc],
+ [AS_HELP_STRING([--disable-latex-doc], [disable building the PDF
+ documentation from LaTeX source])],
+ [latexdoc=no],
+ [latexdoc=yes])
+
+if test "x$latexdoc" = "xyes"; then
+ AC_MSG_NOTICE([building of the PDF of the user manual from LaTeX source is enabled])
+ # Check for presence of pdfLaTeX
+ AC_CHECK_PROGS(PDFLATEX, pdflatex)
+ if test -z "$PDFLATEX"; then
+ AC_MSG_NOTICE([pdflatex not found - Unable to create PDF version of the user manual])
+ fi
+fi
+AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX")
+AM_CONDITIONAL([BUILD_latexdoc], test "x$latexdoc" = "xyes")
+
+
# Files to be generated by autotools
AC_CONFIG_FILES([
Makefile
More information about the Genabel-commits
mailing list