missing NULL terminator in set_config_x
[geda-gaf.git] / m4 / geda-doxygen.m4
blobce7095191c29d504f33640507ddd62752881bd7d
1 # geda-doxygen.m4                                       -*-Autoconf-*-
2 # serial 2
4 dnl Optional Doxygen API documentation support
5 dnl Copyright (C) 2009-2011  Peter Brett <peter@peter-b.co.uk>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 # Check if doxygen documentation is requested, and if so, find doxygen program.
22 AC_DEFUN([AX_OPTION_DOXYGEN],
24   AC_PREREQ([2.69])dnl
25   AC_ARG_VAR([DOXYGEN], [Path to doxygen executable])
27   # Check if the user enabled Doxygen
28   AC_MSG_CHECKING([whether to enable generation of Doxygen API documentation])
29   AC_ARG_ENABLE([doxygen],
30     [AS_HELP_STRING([--enable-doxygen], [enable generation of Doxygen API documentation])])
32   # If user enabled doxygen, find the path to the doxygen
33   # executable. Also check for other required tools.
34   if test "X$enable_doxygen" = "Xyes"; then
35     AC_MSG_RESULT([yes])
36     AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen], [no])
37     if test "X$DOXYGEN" = "Xno"; then
38       AC_MSG_ERROR([API documentation generation was requested, but doxygen was not
39 found. Ensure it is installed and in your path, or configure without
40 --enable-doxygen.])
41     fi
43     # Check for Inkscape
44     AC_CHECK_PROG([INKSCAPE], [inkscape], [inkscape], [no])
45     # Check for ImageMagick
46     AC_CHECK_PROG([CONVERT], [convert], [convert], [no])
48     # We need at least one way of converting SVG files to PNG files!
49     if (test "X$INKSCAPE" = "Xno") && (test "X$CONVERT" = "Xno"); then
50       AC_MSG_ERROR([API documentation generation was requested, but
51 neither Inkscape nor ImageMagick were found. Ensure one of these is
52 installed and in your path, or configure without --enable-doxygen.])
53     fi
55     # Check for graphviz
56     AC_CHECK_PROG([DOT], [dot], [dot], [no])
57     if test "X$DOT" = "Xno"; then
58       AC_MSG_ERROR([API documentation generation was requested,
59 but the program dot (part of Graphviz, see http://www.graphviz.org/) was not found.
60 Ensure it is installed and in your path, or configure without --enable-doxygen.])
61     fi
63     # We need pdflatex to create PDF format API docs.
64     AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [no])
65     if test "X$PDFLATEX" = "Xno"; then
66       AC_MSG_ERROR([API documentation generation was requested, but pdflatex was not
67 found.  Ensure it is installed and in your path, or configure without
68 --enable-doxygen.])
69     fi
71   else
72     AC_MSG_RESULT([no])
73   fi
75   AM_CONDITIONAL([ENABLE_DOXYGEN],
76                  test "X$enable_doxygen" = "Xyes")
77   AC_SUBST([DOXYGEN])
78   AC_SUBST([INKSCAPE])
79   AC_SUBST([CONVERT])
80 ])dnl AX_OPTION_DOXYGEN