Updated gr-howto-write-a-block; mostly the .m4 macros and configure.ac.
[debian/gnuradio] / gr-howto-write-a-block / config / gr_doxygen.m4
1 dnl
2 dnl Copyright 2003,2005 Free Software Foundation, Inc.
3 dnl 
4 dnl This file is part of GNU Radio
5 dnl 
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
9 dnl any later version.
10 dnl 
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl 
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING.  If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
20 dnl 
21
22 AC_DEFUN([GR_CHECK_DOXYGEN],[
23   AC_ARG_ENABLE(doxygen,
24                 AC_HELP_STRING([--enable-doxygen],
25                                [enable documentation generation with doxygen (no)]))
26   AC_ARG_ENABLE(dot, AC_HELP_STRING([--enable-dot],[use 'dot' to generate graphs in doxygen (auto)]))
27   AC_ARG_ENABLE(html-docs,
28                 AC_HELP_STRING([--enable-html-docs],[enable HTML generation with doxygen (yes)]),
29                 [], [ enable_html_docs=yes])
30   AC_ARG_ENABLE(latex-docs,
31                 AC_HELP_STRING([--enable-latex-docs],
32                                [enable LaTeX doc generation with doxygen (no)]),
33                 [], [ enable_latex_docs=no])
34
35   if test "x$enable_doxygen" = xyes; then
36         AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
37         if test x$DOXYGEN = x; then
38                 if test "x$enable_doxygen" = xyes; then
39                         AC_MSG_ERROR([could not find doxygen])
40                 fi
41                 enable_doc=no
42                 generate_docs=
43         else
44                 enable_doc=yes
45                 generate_docs=docs
46                 AC_PATH_PROG(DOT, dot, , $PATH)
47         fi
48   else 
49         enable_doc=no
50   fi
51
52   AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
53
54   if test x$DOT = x; then
55         if test "x$enable_dot" = xyes; then
56                 AC_MSG_ERROR([could not find dot])
57         fi
58         enable_dot=no
59   else
60         enable_dot=yes
61   fi
62   AC_SUBST(enable_dot)
63   AC_SUBST(enable_html_docs)
64   AC_SUBST(enable_latex_docs)
65   AC_SUBST(generate_docs)
66 ])