1 # geda-doxygen.m4 -*-Autoconf-*-
4 dnl Optional Doxygen API documentation support
5 dnl Copyright (C) 2009-2011 Peter Brett <peter@peter-b.co.uk>
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.
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.
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],
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
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
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.])
55 # We need pdflatex to create PDF format API docs.
56 AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [no])
57 if test "X$PDFLATEX" = "Xno"; then
58 AC_MSG_ERROR([API documentation generation was requested, but pdflatex was not
59 found. Ensure it is installed and in your path, or configure without
67 AM_CONDITIONAL([ENABLE_DOXYGEN],
68 test "X$enable_doxygen" = "Xyes")
72 ])dnl AX_OPTION_DOXYGEN