Commit 19a74fa8645b2bcf344ee8b7749cdf0c911afa43
1 parent
267e24a9
Add make doxygen to autotools (including doxygen discovery).
The configuration script now automatically detects doxygen and the Makefile allows creation of the Doxygen documentation using make doxygen.
Showing
3 changed files
with
692 additions
and
3 deletions
Makefile.am
| @@ -44,17 +44,141 @@ dist-hook: | @@ -44,17 +44,141 @@ dist-hook: | ||
| 44 | ) \ | 44 | ) \ |
| 45 | ) | 45 | ) |
| 46 | 46 | ||
| 47 | +# Add Doxygen rules | ||
| 48 | +if DX_COND_doc | ||
| 49 | + | ||
| 50 | +# HTML | ||
| 51 | +if DX_COND_html | ||
| 52 | +DX_CLEAN_HTML = @DX_DOCDIR@/html | ||
| 53 | +endif #DX_COND_html | ||
| 54 | + | ||
| 55 | +# CHI & CHI | ||
| 56 | +if DX_COND_chm | ||
| 57 | +DX_CLEAN_CHM = @DX_DOCDIR@/chm | ||
| 58 | +if DX_COND_chi | ||
| 59 | +DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi | ||
| 60 | +endif #DX_COND_chi | ||
| 61 | +endif #DX_COND_chm | ||
| 62 | + | ||
| 63 | +# MAN | ||
| 64 | +if DX_COND_man | ||
| 65 | +DX_CLEAN_MAN = @DX_DOCDIR@/man | ||
| 66 | +endif #DX_COND_man | ||
| 67 | + | ||
| 68 | +# RTF | ||
| 69 | +if DX_COND_rtf | ||
| 70 | +DX_CLEAN_RTF = @DX_DOCDIR@/rtf | ||
| 71 | +endif #DX_COND_rtf | ||
| 72 | + | ||
| 73 | +# XML | ||
| 74 | +if DX_COND_xml | ||
| 75 | +DX_CLEAN_XML = @DX_DOCDIR@/xml | ||
| 76 | +endif #DX_COND_xml | ||
| 77 | + | ||
| 78 | +# PS | ||
| 79 | +if DX_COND_ps | ||
| 80 | +DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps | ||
| 81 | +DX_PS_GOAL = doxygen-ps | ||
| 82 | +doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps | ||
| 83 | +@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 84 | + cd @DX_DOCDIR@/latex; \ | ||
| 85 | + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ | ||
| 86 | + $(DX_LATEX) refman.tex; \ | ||
| 87 | + $(MAKEINDEX_PATH) refman.idx; \ | ||
| 88 | + $(DX_LATEX) refman.tex; \ | ||
| 89 | + countdown=5; \ | ||
| 90 | + while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ | ||
| 91 | + refman.log > /dev/null 2>&1 \ | ||
| 92 | + && test $$countdown -gt 0; do \ | ||
| 93 | + $(DX_LATEX) refman.tex; \ | ||
| 94 | + countdown=`expr $$countdown - 1`; \ | ||
| 95 | + done; \ | ||
| 96 | + $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi | ||
| 97 | +endif #DX_COND_ps | ||
| 98 | + | ||
| 99 | |||
| 100 | +if DX_COND_pdf | ||
| 101 | +DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf | ||
| 102 | +DX_PDF_GOAL = doxygen-pdf | ||
| 103 | +doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf | ||
| 104 | +@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 105 | + cd @DX_DOCDIR@/latex; \ | ||
| 106 | + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ | ||
| 107 | + $(DX_PDFLATEX) refman.tex; \ | ||
| 108 | + $(DX_MAKEINDEX) refman.idx; \ | ||
| 109 | + $(DX_PDFLATEX) refman.tex; \ | ||
| 110 | + countdown=5; \ | ||
| 111 | + while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ | ||
| 112 | + refman.log > /dev/null 2>&1 \ | ||
| 113 | + && test $$countdown -gt 0; do \ | ||
| 114 | + $(DX_PDFLATEX) refman.tex; \ | ||
| 115 | + countdown=`expr $$countdown - 1`; \ | ||
| 116 | + done; \ | ||
| 117 | + mv refman.pdf ../@PACKAGE@.pdf | ||
| 118 | +endif #DX_COND_pdf | ||
| 119 | + | ||
| 120 | +# LaTeX | ||
| 121 | +if DX_COND_latex | ||
| 122 | +DX_CLEAN_LATEX = @DX_DOCDIR@/latex | ||
| 123 | +endif #DX_COND_latex | ||
| 124 | + | ||
| 125 | +# Rules | ||
| 126 | +#.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 127 | + | ||
| 128 | +.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 129 | + | ||
| 130 | +doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 131 | + | ||
| 132 | +# Make Doxygen files | ||
| 133 | +doxygen: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 134 | + | ||
| 135 | +# Install Doxygen files | ||
| 136 | +DOCDIRS = html/doxygen man/man3 | ||
| 137 | +doxygen-install: | ||
| 138 | + $(mkinstalldirs) $(DESTDIR)$(docdir) | ||
| 139 | + @for dir in $(DOCDIRS) ; do \ | ||
| 140 | + $(mkinstalldirs) $(DESTDIR)$(docdir)/$$dir && \ | ||
| 141 | + for file in $(srcdir)/doc/$$dir/*.* ; do \ | ||
| 142 | + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$$dir" ; \ | ||
| 143 | + $(INSTALL_DATA) "$$file" $(DESTDIR)$(docdir)/$$dir ; \ | ||
| 144 | + done ; \ | ||
| 145 | + done | ||
| 146 | + | ||
| 147 | +# Uninstall Doxygen files | ||
| 148 | +doxygen-uninstall: | ||
| 149 | + for dir in $(DOCDIRS) ; do \ | ||
| 150 | + rm -f -r $(DESTDIR)$(docdir)/$$dir ; \ | ||
| 151 | + done | ||
| 152 | + | ||
| 153 | +@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) | ||
| 154 | + rm -rf @DX_DOCDIR@ | ||
| 155 | + $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) | ||
| 156 | + | ||
| 157 | +DX_CLEANFILES = \ | ||
| 158 | + @DX_DOCDIR@/@PACKAGE@.tag \ | ||
| 159 | + -r \ | ||
| 160 | + $(DX_CLEAN_HTML) \ | ||
| 161 | + $(DX_CLEAN_CHM) \ | ||
| 162 | + $(DX_CLEAN_CHI) \ | ||
| 163 | + $(DX_CLEAN_MAN) \ | ||
| 164 | + $(DX_CLEAN_RTF) \ | ||
| 165 | + $(DX_CLEAN_XML) \ | ||
| 166 | + $(DX_CLEAN_PS) \ | ||
| 167 | + $(DX_CLEAN_PDF) \ | ||
| 168 | + $(DX_CLEAN_LATEX) | ||
| 169 | + | ||
| 170 | +endif #DX_COND_doc | ||
| 47 | 171 | ||
| 48 | # | 172 | # |
| 49 | # Additional install rules | 173 | # Additional install rules |
| 50 | # | 174 | # |
| 51 | 175 | ||
| 52 | # Install HTML files | 176 | # Install HTML files |
| 53 | -DOCDIRS = html html/images | 177 | +HTMLDIRS = html html/images |
| 54 | HTML_INSTALL_DATA_TARGETS = install-data-html | 178 | HTML_INSTALL_DATA_TARGETS = install-data-html |
| 55 | install-data-html: | 179 | install-data-html: |
| 56 | $(mkinstalldirs) $(DESTDIR)$(docdir) | 180 | $(mkinstalldirs) $(DESTDIR)$(docdir) |
| 57 | - @for dir in $(DOCDIRS) ; do \ | 181 | + @for dir in $(HTMLDIRS) ; do \ |
| 58 | $(mkinstalldirs) $(DESTDIR)$(docdir)/$$dir && \ | 182 | $(mkinstalldirs) $(DESTDIR)$(docdir)/$$dir && \ |
| 59 | for file in $(srcdir)/doc/$$dir/*.* ; do \ | 183 | for file in $(srcdir)/doc/$$dir/*.* ; do \ |
| 60 | echo "$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$$dir" ; \ | 184 | echo "$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$$dir" ; \ |
| @@ -65,7 +189,7 @@ install-data-html: | @@ -65,7 +189,7 @@ install-data-html: | ||
| 65 | # Uninstall HTML files | 189 | # Uninstall HTML files |
| 66 | HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html | 190 | HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html |
| 67 | uninstall-data-html: | 191 | uninstall-data-html: |
| 68 | - for dir in $(DOCDIRS) ; do \ | 192 | + for dir in $(HTMLDIRS) ; do \ |
| 69 | rm -f -r $(DESTDIR)$(docdir)/$$dir ; \ | 193 | rm -f -r $(DESTDIR)$(docdir)/$$dir ; \ |
| 70 | done | 194 | done |
| 71 | 195 |
configure.ac
| @@ -862,6 +862,16 @@ AC_SUBST(LIB_LINK_OPTION) | @@ -862,6 +862,16 @@ AC_SUBST(LIB_LINK_OPTION) | ||
| 862 | 862 | ||
| 863 | 863 | ||
| 864 | ############################################################################# | 864 | ############################################################################# |
| 865 | +# Checks for Doxygen # | ||
| 866 | +############################################################################# | ||
| 867 | +DX_HTML_FEATURE(ON) | ||
| 868 | +DX_PS_FEATURE(OFF) | ||
| 869 | +DX_PDF_FEATURE(OFF) | ||
| 870 | +DX_MAN_FEATURE(ON) | ||
| 871 | +DX_INIT_DOXYGEN([ctools], [doc/Doxyfile], [doc/doxygen]) | ||
| 872 | + | ||
| 873 | + | ||
| 874 | +############################################################################# | ||
| 865 | # Set list of output files to be created # | 875 | # Set list of output files to be created # |
| 866 | ############################################################################# | 876 | ############################################################################# |
| 867 | AC_CONFIG_FILES([Makefile | 877 | AC_CONFIG_FILES([Makefile |
| @@ -945,6 +955,13 @@ else | @@ -945,6 +955,13 @@ else | ||
| 945 | echo " - Make Python binding (no)" | 955 | echo " - Make Python binding (no)" |
| 946 | fi | 956 | fi |
| 947 | 957 | ||
| 958 | +# Dump Doxygen information | ||
| 959 | +if test "$DX_DOXYGEN" != ""; then | ||
| 960 | + echo " * Doxygen (yes) $DX_DOXYGEN" | ||
| 961 | +else | ||
| 962 | + echo " - Doxygen (no)" | ||
| 963 | +fi | ||
| 964 | + | ||
| 948 | # Dump compile options | 965 | # Dump compile options |
| 949 | if test "x$enable_openmp" = "xyes"; then | 966 | if test "x$enable_openmp" = "xyes"; then |
| 950 | echo " * Enable OpenMP (yes) (default)" | 967 | echo " * Enable OpenMP (yes) (default)" |
m4/ax_prog_doxygen.m4
0 → 100644
| 1 | +# =========================================================================== | ||
| 2 | +# http://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html | ||
| 3 | +# =========================================================================== | ||
| 4 | +# | ||
| 5 | +# SYNOPSIS | ||
| 6 | +# | ||
| 7 | +# DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR]) | ||
| 8 | +# DX_DOXYGEN_FEATURE(ON|OFF) | ||
| 9 | +# DX_DOT_FEATURE(ON|OFF) | ||
| 10 | +# DX_HTML_FEATURE(ON|OFF) | ||
| 11 | +# DX_CHM_FEATURE(ON|OFF) | ||
| 12 | +# DX_CHI_FEATURE(ON|OFF) | ||
| 13 | +# DX_MAN_FEATURE(ON|OFF) | ||
| 14 | +# DX_RTF_FEATURE(ON|OFF) | ||
| 15 | +# DX_XML_FEATURE(ON|OFF) | ||
| 16 | +# DX_PDF_FEATURE(ON|OFF) | ||
| 17 | +# DX_PS_FEATURE(ON|OFF) | ||
| 18 | +# | ||
| 19 | +# DESCRIPTION | ||
| 20 | +# | ||
| 21 | +# The DX_*_FEATURE macros control the default setting for the given | ||
| 22 | +# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for | ||
| 23 | +# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML | ||
| 24 | +# help (for MS users), 'CHI' for generating a seperate .chi file by the | ||
| 25 | +# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate | ||
| 26 | +# output formats. The environment variable DOXYGEN_PAPER_SIZE may be | ||
| 27 | +# specified to override the default 'a4wide' paper size. | ||
| 28 | +# | ||
| 29 | +# By default, HTML, PDF and PS documentation is generated as this seems to | ||
| 30 | +# be the most popular and portable combination. MAN pages created by | ||
| 31 | +# Doxygen are usually problematic, though by picking an appropriate subset | ||
| 32 | +# and doing some massaging they might be better than nothing. CHM and RTF | ||
| 33 | +# are specific for MS (note that you can't generate both HTML and CHM at | ||
| 34 | +# the same time). The XML is rather useless unless you apply specialized | ||
| 35 | +# post-processing to it. | ||
| 36 | +# | ||
| 37 | +# The macros mainly control the default state of the feature. The use can | ||
| 38 | +# override the default by specifying --enable or --disable. The macros | ||
| 39 | +# ensure that contradictory flags are not given (e.g., | ||
| 40 | +# --enable-doxygen-html and --enable-doxygen-chm, | ||
| 41 | +# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each | ||
| 42 | +# feature will be automatically disabled (with a warning) if the required | ||
| 43 | +# programs are missing. | ||
| 44 | +# | ||
| 45 | +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN | ||
| 46 | +# with the following parameters: a one-word name for the project for use | ||
| 47 | +# as a filename base etc., an optional configuration file name (the | ||
| 48 | +# default is 'Doxyfile', the same as Doxygen's default), and an optional | ||
| 49 | +# output directory name (the default is 'doxygen-doc'). | ||
| 50 | +# | ||
| 51 | +# Automake Support | ||
| 52 | +# | ||
| 53 | +# The following is a template aminclude.am file for use with Automake. | ||
| 54 | +# Make targets and variables values are controlled by the various | ||
| 55 | +# DX_COND_* conditionals set by autoconf. | ||
| 56 | +# | ||
| 57 | +# The provided targets are: | ||
| 58 | +# | ||
| 59 | +# doxygen-doc: Generate all doxygen documentation. | ||
| 60 | +# | ||
| 61 | +# doxygen-run: Run doxygen, which will generate some of the | ||
| 62 | +# documentation (HTML, CHM, CHI, MAN, RTF, XML) | ||
| 63 | +# but will not do the post processing required | ||
| 64 | +# for the rest of it (PS, PDF, and some MAN). | ||
| 65 | +# | ||
| 66 | +# doxygen-man: Rename some doxygen generated man pages. | ||
| 67 | +# | ||
| 68 | +# doxygen-ps: Generate doxygen PostScript documentation. | ||
| 69 | +# | ||
| 70 | +# doxygen-pdf: Generate doxygen PDF documentation. | ||
| 71 | +# | ||
| 72 | +# Note that by default these are not integrated into the automake targets. | ||
| 73 | +# If doxygen is used to generate man pages, you can achieve this | ||
| 74 | +# integration by setting man3_MANS to the list of man pages generated and | ||
| 75 | +# then adding the dependency: | ||
| 76 | +# | ||
| 77 | +# $(man3_MANS): doxygen-doc | ||
| 78 | +# | ||
| 79 | +# This will cause make to run doxygen and generate all the documentation. | ||
| 80 | +# | ||
| 81 | +# The following variable is intended for use in Makefile.am: | ||
| 82 | +# | ||
| 83 | +# DX_CLEANFILES = everything to clean. | ||
| 84 | +# | ||
| 85 | +# Then add this variable to MOSTLYCLEANFILES. | ||
| 86 | +# | ||
| 87 | +# ----- begin aminclude.am ------------------------------------- | ||
| 88 | +# | ||
| 89 | +# ## --------------------------------- ## | ||
| 90 | +# ## Format-independent Doxygen rules. ## | ||
| 91 | +# ## --------------------------------- ## | ||
| 92 | +# | ||
| 93 | +# if DX_COND_doc | ||
| 94 | +# | ||
| 95 | +# ## ------------------------------- ## | ||
| 96 | +# ## Rules specific for HTML output. ## | ||
| 97 | +# ## ------------------------------- ## | ||
| 98 | +# | ||
| 99 | +# if DX_COND_html | ||
| 100 | +# | ||
| 101 | +# DX_CLEAN_HTML = @DX_DOCDIR@/html | ||
| 102 | +# | ||
| 103 | +# endif DX_COND_html | ||
| 104 | +# | ||
| 105 | +# ## ------------------------------ ## | ||
| 106 | +# ## Rules specific for CHM output. ## | ||
| 107 | +# ## ------------------------------ ## | ||
| 108 | +# | ||
| 109 | +# if DX_COND_chm | ||
| 110 | +# | ||
| 111 | +# DX_CLEAN_CHM = @DX_DOCDIR@/chm | ||
| 112 | +# | ||
| 113 | +# if DX_COND_chi | ||
| 114 | +# | ||
| 115 | +# DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi | ||
| 116 | +# | ||
| 117 | +# endif DX_COND_chi | ||
| 118 | +# | ||
| 119 | +# endif DX_COND_chm | ||
| 120 | +# | ||
| 121 | +# ## ------------------------------ ## | ||
| 122 | +# ## Rules specific for MAN output. ## | ||
| 123 | +# ## ------------------------------ ## | ||
| 124 | +# | ||
| 125 | +# if DX_COND_man | ||
| 126 | +# | ||
| 127 | +# DX_CLEAN_MAN = @DX_DOCDIR@/man | ||
| 128 | +# | ||
| 129 | +# endif DX_COND_man | ||
| 130 | +# | ||
| 131 | +# ## ------------------------------ ## | ||
| 132 | +# ## Rules specific for RTF output. ## | ||
| 133 | +# ## ------------------------------ ## | ||
| 134 | +# | ||
| 135 | +# if DX_COND_rtf | ||
| 136 | +# | ||
| 137 | +# DX_CLEAN_RTF = @DX_DOCDIR@/rtf | ||
| 138 | +# | ||
| 139 | +# endif DX_COND_rtf | ||
| 140 | +# | ||
| 141 | +# ## ------------------------------ ## | ||
| 142 | +# ## Rules specific for XML output. ## | ||
| 143 | +# ## ------------------------------ ## | ||
| 144 | +# | ||
| 145 | +# if DX_COND_xml | ||
| 146 | +# | ||
| 147 | +# DX_CLEAN_XML = @DX_DOCDIR@/xml | ||
| 148 | +# | ||
| 149 | +# endif DX_COND_xml | ||
| 150 | +# | ||
| 151 | +# ## ----------------------------- ## | ||
| 152 | +# ## Rules specific for PS output. ## | ||
| 153 | +# ## ----------------------------- ## | ||
| 154 | +# | ||
| 155 | +# if DX_COND_ps | ||
| 156 | +# | ||
| 157 | +# DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps | ||
| 158 | +# | ||
| 159 | +# DX_PS_GOAL = doxygen-ps | ||
| 160 | +# | ||
| 161 | +# doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps | ||
| 162 | +# | ||
| 163 | +# @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 164 | +# cd @DX_DOCDIR@/latex; \ | ||
| 165 | +# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ | ||
| 166 | +# $(DX_LATEX) refman.tex; \ | ||
| 167 | +# $(MAKEINDEX_PATH) refman.idx; \ | ||
| 168 | +# $(DX_LATEX) refman.tex; \ | ||
| 169 | +# countdown=5; \ | ||
| 170 | +# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ | ||
| 171 | +# refman.log > /dev/null 2>&1 \ | ||
| 172 | +# && test $$countdown -gt 0; do \ | ||
| 173 | +# $(DX_LATEX) refman.tex; \ | ||
| 174 | +# countdown=`expr $$countdown - 1`; \ | ||
| 175 | +# done; \ | ||
| 176 | +# $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi | ||
| 177 | +# | ||
| 178 | +# endif DX_COND_ps | ||
| 179 | +# | ||
| 180 | +# ## ------------------------------ ## | ||
| 181 | +# ## Rules specific for PDF output. ## | ||
| 182 | +# ## ------------------------------ ## | ||
| 183 | +# | ||
| 184 | +# if DX_COND_pdf | ||
| 185 | +# | ||
| 186 | +# DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf | ||
| 187 | +# | ||
| 188 | +# DX_PDF_GOAL = doxygen-pdf | ||
| 189 | +# | ||
| 190 | +# doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf | ||
| 191 | +# | ||
| 192 | +# @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 193 | +# cd @DX_DOCDIR@/latex; \ | ||
| 194 | +# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ | ||
| 195 | +# $(DX_PDFLATEX) refman.tex; \ | ||
| 196 | +# $(DX_MAKEINDEX) refman.idx; \ | ||
| 197 | +# $(DX_PDFLATEX) refman.tex; \ | ||
| 198 | +# countdown=5; \ | ||
| 199 | +# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ | ||
| 200 | +# refman.log > /dev/null 2>&1 \ | ||
| 201 | +# && test $$countdown -gt 0; do \ | ||
| 202 | +# $(DX_PDFLATEX) refman.tex; \ | ||
| 203 | +# countdown=`expr $$countdown - 1`; \ | ||
| 204 | +# done; \ | ||
| 205 | +# mv refman.pdf ../@PACKAGE@.pdf | ||
| 206 | +# | ||
| 207 | +# endif DX_COND_pdf | ||
| 208 | +# | ||
| 209 | +# ## ------------------------------------------------- ## | ||
| 210 | +# ## Rules specific for LaTeX (shared for PS and PDF). ## | ||
| 211 | +# ## ------------------------------------------------- ## | ||
| 212 | +# | ||
| 213 | +# if DX_COND_latex | ||
| 214 | +# | ||
| 215 | +# DX_CLEAN_LATEX = @DX_DOCDIR@/latex | ||
| 216 | +# | ||
| 217 | +# endif DX_COND_latex | ||
| 218 | +# | ||
| 219 | +# .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 220 | +# | ||
| 221 | +# .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 222 | +# | ||
| 223 | +# doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag | ||
| 224 | +# | ||
| 225 | +# doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) | ||
| 226 | +# | ||
| 227 | +# @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) | ||
| 228 | +# rm -rf @DX_DOCDIR@ | ||
| 229 | +# $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) | ||
| 230 | +# | ||
| 231 | +# DX_CLEANFILES = \ | ||
| 232 | +# @DX_DOCDIR@/@PACKAGE@.tag \ | ||
| 233 | +# -r \ | ||
| 234 | +# $(DX_CLEAN_HTML) \ | ||
| 235 | +# $(DX_CLEAN_CHM) \ | ||
| 236 | +# $(DX_CLEAN_CHI) \ | ||
| 237 | +# $(DX_CLEAN_MAN) \ | ||
| 238 | +# $(DX_CLEAN_RTF) \ | ||
| 239 | +# $(DX_CLEAN_XML) \ | ||
| 240 | +# $(DX_CLEAN_PS) \ | ||
| 241 | +# $(DX_CLEAN_PDF) \ | ||
| 242 | +# $(DX_CLEAN_LATEX) | ||
| 243 | +# | ||
| 244 | +# endif DX_COND_doc | ||
| 245 | +# | ||
| 246 | +# ----- end aminclude.am --------------------------------------- | ||
| 247 | +# | ||
| 248 | +# LICENSE | ||
| 249 | +# | ||
| 250 | +# Copyright (c) 2009 Oren Ben-Kiki <oren@ben-kiki.org> | ||
| 251 | +# | ||
| 252 | +# Copying and distribution of this file, with or without modification, are | ||
| 253 | +# permitted in any medium without royalty provided the copyright notice | ||
| 254 | +# and this notice are preserved. This file is offered as-is, without any | ||
| 255 | +# warranty. | ||
| 256 | + | ||
| 257 | +#serial 11 | ||
| 258 | + | ||
| 259 | +## ----------## | ||
| 260 | +## Defaults. ## | ||
| 261 | +## ----------## | ||
| 262 | + | ||
| 263 | +DX_ENV="" | ||
| 264 | +AC_DEFUN([DX_FEATURE_doc], ON) | ||
| 265 | +AC_DEFUN([DX_FEATURE_dot], OFF) | ||
| 266 | +AC_DEFUN([DX_FEATURE_man], OFF) | ||
| 267 | +AC_DEFUN([DX_FEATURE_html], ON) | ||
| 268 | +AC_DEFUN([DX_FEATURE_chm], OFF) | ||
| 269 | +AC_DEFUN([DX_FEATURE_chi], OFF) | ||
| 270 | +AC_DEFUN([DX_FEATURE_rtf], OFF) | ||
| 271 | +AC_DEFUN([DX_FEATURE_xml], OFF) | ||
| 272 | +AC_DEFUN([DX_FEATURE_pdf], ON) | ||
| 273 | +AC_DEFUN([DX_FEATURE_ps], ON) | ||
| 274 | + | ||
| 275 | +## --------------- ## | ||
| 276 | +## Private macros. ## | ||
| 277 | +## --------------- ## | ||
| 278 | + | ||
| 279 | +# DX_ENV_APPEND(VARIABLE, VALUE) | ||
| 280 | +# ------------------------------ | ||
| 281 | +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. | ||
| 282 | +AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])]) | ||
| 283 | + | ||
| 284 | +# DX_DIRNAME_EXPR | ||
| 285 | +# --------------- | ||
| 286 | +# Expand into a shell expression prints the directory part of a path. | ||
| 287 | +AC_DEFUN([DX_DIRNAME_EXPR], | ||
| 288 | + [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) | ||
| 289 | + | ||
| 290 | +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) | ||
| 291 | +# ------------------------------------- | ||
| 292 | +# Expands according to the M4 (static) status of the feature. | ||
| 293 | +AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) | ||
| 294 | + | ||
| 295 | +# DX_REQUIRE_PROG(VARIABLE, PROGRAM) | ||
| 296 | +# ---------------------------------- | ||
| 297 | +# Require the specified program to be found for the DX_CURRENT_FEATURE to work. | ||
| 298 | +AC_DEFUN([DX_REQUIRE_PROG], [ | ||
| 299 | +AC_PATH_TOOL([$1], [$2]) | ||
| 300 | +if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then | ||
| 301 | + AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) | ||
| 302 | + AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) | ||
| 303 | +fi | ||
| 304 | +]) | ||
| 305 | + | ||
| 306 | +# DX_TEST_FEATURE(FEATURE) | ||
| 307 | +# ------------------------ | ||
| 308 | +# Expand to a shell expression testing whether the feature is active. | ||
| 309 | +AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) | ||
| 310 | + | ||
| 311 | +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) | ||
| 312 | +# ------------------------------------------------- | ||
| 313 | +# Verify that a required features has the right state before trying to turn on | ||
| 314 | +# the DX_CURRENT_FEATURE. | ||
| 315 | +AC_DEFUN([DX_CHECK_DEPEND], [ | ||
| 316 | +test "$DX_FLAG_$1" = "$2" \ | ||
| 317 | +|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, | ||
| 318 | + requires, contradicts) doxygen-DX_CURRENT_FEATURE]) | ||
| 319 | +]) | ||
| 320 | + | ||
| 321 | +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) | ||
| 322 | +# ---------------------------------------------------------- | ||
| 323 | +# Turn off the DX_CURRENT_FEATURE if the required feature is off. | ||
| 324 | +AC_DEFUN([DX_CLEAR_DEPEND], [ | ||
| 325 | +test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) | ||
| 326 | +]) | ||
| 327 | + | ||
| 328 | +# DX_FEATURE_ARG(FEATURE, DESCRIPTION, | ||
| 329 | +# CHECK_DEPEND, CLEAR_DEPEND, | ||
| 330 | +# REQUIRE, DO-IF-ON, DO-IF-OFF) | ||
| 331 | +# -------------------------------------------- | ||
| 332 | +# Parse the command-line option controlling a feature. CHECK_DEPEND is called | ||
| 333 | +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), | ||
| 334 | +# otherwise CLEAR_DEPEND is called to turn off the default state if a required | ||
| 335 | +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional | ||
| 336 | +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and | ||
| 337 | +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. | ||
| 338 | +AC_DEFUN([DX_ARG_ABLE], [ | ||
| 339 | + AC_DEFUN([DX_CURRENT_FEATURE], [$1]) | ||
| 340 | + AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) | ||
| 341 | + AC_ARG_ENABLE(doxygen-$1, | ||
| 342 | + [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], | ||
| 343 | + [--enable-doxygen-$1]), | ||
| 344 | + DX_IF_FEATURE([$1], [don't $2], [$2]))], | ||
| 345 | + [ | ||
| 346 | +case "$enableval" in | ||
| 347 | +#( | ||
| 348 | +y|Y|yes|Yes|YES) | ||
| 349 | + AC_SUBST([DX_FLAG_$1], 1) | ||
| 350 | + $3 | ||
| 351 | +;; #( | ||
| 352 | +n|N|no|No|NO) | ||
| 353 | + AC_SUBST([DX_FLAG_$1], 0) | ||
| 354 | +;; #( | ||
| 355 | +*) | ||
| 356 | + AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) | ||
| 357 | +;; | ||
| 358 | +esac | ||
| 359 | +], [ | ||
| 360 | +AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) | ||
| 361 | +$4 | ||
| 362 | +]) | ||
| 363 | +if DX_TEST_FEATURE([$1]); then | ||
| 364 | + $5 | ||
| 365 | + : | ||
| 366 | +fi | ||
| 367 | +if DX_TEST_FEATURE([$1]); then | ||
| 368 | + AM_CONDITIONAL(DX_COND_$1, :) | ||
| 369 | + $6 | ||
| 370 | + : | ||
| 371 | +else | ||
| 372 | + AM_CONDITIONAL(DX_COND_$1, false) | ||
| 373 | + $7 | ||
| 374 | + : | ||
| 375 | +fi | ||
| 376 | +]) | ||
| 377 | + | ||
| 378 | +## -------------- ## | ||
| 379 | +## Public macros. ## | ||
| 380 | +## -------------- ## | ||
| 381 | + | ||
| 382 | +# DX_XXX_FEATURE(DEFAULT_STATE) | ||
| 383 | +# ----------------------------- | ||
| 384 | +AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) | ||
| 385 | +AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])]) | ||
| 386 | +AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) | ||
| 387 | +AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) | ||
| 388 | +AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) | ||
| 389 | +AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) | ||
| 390 | +AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) | ||
| 391 | +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) | ||
| 392 | +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) | ||
| 393 | +AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) | ||
| 394 | +AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) | ||
| 395 | + | ||
| 396 | +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) | ||
| 397 | +# --------------------------------------------------------- | ||
| 398 | +# PROJECT also serves as the base name for the documentation files. | ||
| 399 | +# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". | ||
| 400 | +AC_DEFUN([DX_INIT_DOXYGEN], [ | ||
| 401 | + | ||
| 402 | +# Files: | ||
| 403 | +AC_SUBST([DX_PROJECT], [$1]) | ||
| 404 | +AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])]) | ||
| 405 | +AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])]) | ||
| 406 | + | ||
| 407 | +# Environment variables used inside doxygen.cfg: | ||
| 408 | +DX_ENV_APPEND(SRCDIR, $srcdir) | ||
| 409 | +DX_ENV_APPEND(PROJECT, $DX_PROJECT) | ||
| 410 | +DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) | ||
| 411 | +DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) | ||
| 412 | + | ||
| 413 | +# Doxygen itself: | ||
| 414 | +DX_ARG_ABLE(doc, [generate any doxygen documentation], | ||
| 415 | + [], | ||
| 416 | + [], | ||
| 417 | + [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) | ||
| 418 | + DX_REQUIRE_PROG([DX_PERL], perl)], | ||
| 419 | + [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) | ||
| 420 | + | ||
| 421 | +# Dot for graphics: | ||
| 422 | +DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], | ||
| 423 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 424 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 425 | + [DX_REQUIRE_PROG([DX_DOT], dot)], | ||
| 426 | + [DX_ENV_APPEND(HAVE_DOT, YES) | ||
| 427 | + DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], | ||
| 428 | + [DX_ENV_APPEND(HAVE_DOT, NO)]) | ||
| 429 | + | ||
| 430 | +# Man pages generation: | ||
| 431 | +DX_ARG_ABLE(man, [generate doxygen manual pages], | ||
| 432 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 433 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 434 | + [], | ||
| 435 | + [DX_ENV_APPEND(GENERATE_MAN, YES)], | ||
| 436 | + [DX_ENV_APPEND(GENERATE_MAN, NO)]) | ||
| 437 | + | ||
| 438 | +# RTF file generation: | ||
| 439 | +DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], | ||
| 440 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 441 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 442 | + [], | ||
| 443 | + [DX_ENV_APPEND(GENERATE_RTF, YES)], | ||
| 444 | + [DX_ENV_APPEND(GENERATE_RTF, NO)]) | ||
| 445 | + | ||
| 446 | +# XML file generation: | ||
| 447 | +DX_ARG_ABLE(xml, [generate doxygen XML documentation], | ||
| 448 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 449 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 450 | + [], | ||
| 451 | + [DX_ENV_APPEND(GENERATE_XML, YES)], | ||
| 452 | + [DX_ENV_APPEND(GENERATE_XML, NO)]) | ||
| 453 | + | ||
| 454 | +# (Compressed) HTML help generation: | ||
| 455 | +DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], | ||
| 456 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 457 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 458 | + [DX_REQUIRE_PROG([DX_HHC], hhc)], | ||
| 459 | + [DX_ENV_APPEND(HHC_PATH, $DX_HHC) | ||
| 460 | + DX_ENV_APPEND(GENERATE_HTML, YES) | ||
| 461 | + DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], | ||
| 462 | + [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) | ||
| 463 | + | ||
| 464 | +# Seperate CHI file generation. | ||
| 465 | +DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], | ||
| 466 | + [DX_CHECK_DEPEND(chm, 1)], | ||
| 467 | + [DX_CLEAR_DEPEND(chm, 1)], | ||
| 468 | + [], | ||
| 469 | + [DX_ENV_APPEND(GENERATE_CHI, YES)], | ||
| 470 | + [DX_ENV_APPEND(GENERATE_CHI, NO)]) | ||
| 471 | + | ||
| 472 | +# Plain HTML pages generation: | ||
| 473 | +DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], | ||
| 474 | + [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], | ||
| 475 | + [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], | ||
| 476 | + [], | ||
| 477 | + [DX_ENV_APPEND(GENERATE_HTML, YES)], | ||
| 478 | + [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) | ||
| 479 | + | ||
| 480 | +# PostScript file generation: | ||
| 481 | +DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], | ||
| 482 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 483 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 484 | + [DX_REQUIRE_PROG([DX_LATEX], latex) | ||
| 485 | + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) | ||
| 486 | + DX_REQUIRE_PROG([DX_DVIPS], dvips) | ||
| 487 | + DX_REQUIRE_PROG([DX_EGREP], egrep)]) | ||
| 488 | + | ||
| 489 | +# PDF file generation: | ||
| 490 | +DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], | ||
| 491 | + [DX_CHECK_DEPEND(doc, 1)], | ||
| 492 | + [DX_CLEAR_DEPEND(doc, 1)], | ||
| 493 | + [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) | ||
| 494 | + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) | ||
| 495 | + DX_REQUIRE_PROG([DX_EGREP], egrep)]) | ||
| 496 | + | ||
| 497 | +# LaTeX generation for PS and/or PDF: | ||
| 498 | +if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then | ||
| 499 | + AM_CONDITIONAL(DX_COND_latex, :) | ||
| 500 | + DX_ENV_APPEND(GENERATE_LATEX, YES) | ||
| 501 | +else | ||
| 502 | + AM_CONDITIONAL(DX_COND_latex, false) | ||
| 503 | + DX_ENV_APPEND(GENERATE_LATEX, NO) | ||
| 504 | +fi | ||
| 505 | + | ||
| 506 | +# Paper size for PS and/or PDF: | ||
| 507 | +AC_ARG_VAR(DOXYGEN_PAPER_SIZE, | ||
| 508 | + [a4wide (default), a4, letter, legal or executive]) | ||
| 509 | +case "$DOXYGEN_PAPER_SIZE" in | ||
| 510 | +#( | ||
| 511 | +"") | ||
| 512 | + AC_SUBST(DOXYGEN_PAPER_SIZE, "") | ||
| 513 | +;; #( | ||
| 514 | +a4wide|a4|letter|legal|executive) | ||
| 515 | + DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) | ||
| 516 | +;; #( | ||
| 517 | +*) | ||
| 518 | + AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) | ||
| 519 | +;; | ||
| 520 | +esac | ||
| 521 | + | ||
| 522 | +# For debugging: | ||
| 523 | +#echo DX_FLAG_doc=$DX_FLAG_doc | ||
| 524 | +#echo DX_FLAG_dot=$DX_FLAG_dot | ||
| 525 | +#echo DX_FLAG_man=$DX_FLAG_man | ||
| 526 | +#echo DX_FLAG_html=$DX_FLAG_html | ||
| 527 | +#echo DX_FLAG_chm=$DX_FLAG_chm | ||
| 528 | +#echo DX_FLAG_chi=$DX_FLAG_chi | ||
| 529 | +#echo DX_FLAG_rtf=$DX_FLAG_rtf | ||
| 530 | +#echo DX_FLAG_xml=$DX_FLAG_xml | ||
| 531 | +#echo DX_FLAG_pdf=$DX_FLAG_pdf | ||
| 532 | +#echo DX_FLAG_ps=$DX_FLAG_ps | ||
| 533 | +#echo DX_ENV=$DX_ENV | ||
| 534 | + | ||
| 535 | +# Conditionals kluge for old automake versions | ||
| 536 | +if test "x$DX_FLAG_doc" = "x1"; then | ||
| 537 | + AM_CONDITIONAL(DX_COND_doc, test "x$DX_FLAG_doc" = "x1") | ||
| 538 | + AM_CONDITIONAL(DX_COND_html, test "x$DX_FLAG_html" = "x1") | ||
| 539 | + AM_CONDITIONAL(DX_COND_chm, test "x$DX_FLAG_chm" = "x1") | ||
| 540 | + AM_CONDITIONAL(DX_COND_chi, test "x$DX_FLAG_chi" = "x1") | ||
| 541 | + AM_CONDITIONAL(DX_COND_man, test "x$DX_FLAG_man" = "x1") | ||
| 542 | + AM_CONDITIONAL(DX_COND_rtf, test "x$DX_FLAG_rtf" = "x1") | ||
| 543 | + AM_CONDITIONAL(DX_COND_xml, test "x$DX_FLAG_xml" = "x1") | ||
| 544 | + AM_CONDITIONAL(DX_COND_ps, test "x$DX_FLAG_ps" = "x1") | ||
| 545 | + AM_CONDITIONAL(DX_COND_pdf, test "x$DX_FLAG_pdf" = "x1") | ||
| 546 | +fi | ||
| 547 | +]) | ||
| 548 | + |