* Generate PDF documentation if a proper LaTeX installation can be found.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
diff --git a/.gitignore b/.gitignore
index b483744..4fbdc93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ demo/FTGLDemo
demo/FTGLMFontDemo
test/CTest
test/CXXTest
-docs/doc-stamp
+docs/stamp-*
docs/doxygen.cfg
docs/html
+docs/latex
diff --git a/configure.ac b/configure.ac
index 6d97080..4f08ea8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,10 +57,34 @@ AC_CHECK_FUNCS([memset])
CPPFLAGS="${CPPFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
CFLAGS="${CFLAGS} -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
-# Utility programs
+# Build HTML documentatin?
AC_PATH_PROG(DOXYGEN, doxygen, no)
AM_CONDITIONAL(HAVE_DOXYGEN, test "$DOXYGEN" != "no")
+# Build PDF documentation?
+AC_PATH_PROG(LATEX, pdflatex, no)
+AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
+AC_PATH_PROG(DVIPS, dvips, no)
+AC_PATH_PROG(EPSTOPDF, epstopdf, no)
+if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no" -o "${EPSTOPDF}" = "no"; then
+ LATEX="no"
+fi
+if test "${LATEX}" != "no"; then
+ AC_MSG_CHECKING(for a4.sty and a4wide.sty)
+ if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
+ if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ else
+ LATEX="no"
+ AC_MSG_RESULT(no)
+ fi
+ else
+ LATEX="no"
+ AC_MSG_RESULT(no)
+ fi
+fi
+AM_CONDITIONAL(HAVE_LATEX, test "${LATEX}" != "no")
+
AC_CONFIG_FILES([
ftgl.pc
])
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 753015b..ac1a078 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -2,6 +2,10 @@
if HAVE_DOXYGEN
htmldocdir = $(datadir)/doc/ftgl/html
htmldoc_DATA = html/doxygen.css
+if HAVE_LATEX
+pdfdocdir = $(datadir)/doc/ftgl
+pdfdoc_DATA = latex/ftgl.pdf
+endif
endif
IMAGES = \
@@ -9,16 +13,25 @@ IMAGES = \
images/metrics.png \
$(NULL)
-html/doxygen.css: doc-stamp
-doc-stamp: doxygen.cfg
+html/doxygen.css: stamp-doxygen
+stamp-doxygen: doxygen.cfg
$(DOXYGEN) $^
cp $(IMAGES) html/
touch $@
+latex/ftgl.pdf: stamp-latex
+stamp-latex: stamp-doxygen
+ rm -f latex/ftgl.tex latex/ftgl.pdf
+ mv latex/refman.tex latex/ftgl.tex
+ sed 's/setlength{/renewcommand{/' latex/ftgl.tex > latex/refman.tex
+ cd latex && $(MAKE) $(AM_CFLAGS) refman.pdf #|| (cat refman.log; exit 1)
+ mv latex/refman.pdf latex/ftgl.pdf
+ touch stamp-latex
+
clean: clean-local
clean-local:
- $(RM) -rf html
- $(RM) doc-stamp
+ $(RM) -rf html latex
+ $(RM) stamp-doxygen stamp-latex
if HAVE_DOXYGEN
install-data-local: html/doxygen.css
diff --git a/docs/doxygen.cfg.in b/docs/doxygen.cfg.in
index b92d25c..65c3fdd 100644
--- a/docs/doxygen.cfg.in
+++ b/docs/doxygen.cfg.in
@@ -593,7 +593,7 @@ EXAMPLE_RECURSIVE = NO
# directories that contain image that are included in the documentation (see
# the \image command).
-IMAGE_PATH =
+IMAGE_PATH = images
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -850,7 +850,7 @@ TREEVIEW_WIDTH = 250
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
-GENERATE_LATEX = NO
+GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -904,20 +904,20 @@ PDF_HYPERLINKS = NO
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
-USE_PDFLATEX = NO
+USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
-LATEX_BATCHMODE = NO
+LATEX_BATCHMODE = YES
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
-LATEX_HIDE_INDICES = NO
+LATEX_HIDE_INDICES = YES
#---------------------------------------------------------------------------
# configuration options related to the RTF output