]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/kyua/m4/doxygen.m4
ping(8): Fix a mandoc related issue
[FreeBSD/FreeBSD.git] / contrib / kyua / m4 / doxygen.m4
1 dnl Copyright 2010 The Kyua Authors.
2 dnl All rights reserved.
3 dnl
4 dnl Redistribution and use in source and binary forms, with or without
5 dnl modification, are permitted provided that the following conditions are
6 dnl met:
7 dnl
8 dnl * Redistributions of source code must retain the above copyright
9 dnl   notice, this list of conditions and the following disclaimer.
10 dnl * Redistributions in binary form must reproduce the above copyright
11 dnl   notice, this list of conditions and the following disclaimer in the
12 dnl   documentation and/or other materials provided with the distribution.
13 dnl * Neither the name of Google Inc. nor the names of its contributors
14 dnl   may be used to endorse or promote products derived from this software
15 dnl   without specific prior written permission.
16 dnl
17 dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 dnl
30 dnl KYUA_DOXYGEN
31 dnl
32 dnl Adds a --with-doxygen flag to the configure script and, when Doxygen support
33 dnl is requested by the user, sets DOXYGEN to the path of the Doxygen binary and
34 dnl enables the WITH_DOXYGEN Automake conditional.
35 dnl
36 AC_DEFUN([KYUA_DOXYGEN], [
37     AC_ARG_WITH([doxygen],
38                 AS_HELP_STRING([--with-doxygen],
39                                [build documentation for internal APIs]),
40                 [],
41                 [with_doxygen=auto])
42
43     if test "${with_doxygen}" = yes; then
44         AC_PATH_PROG([DOXYGEN], [doxygen], [])
45         if test -z "${DOXYGEN}"; then
46             AC_MSG_ERROR([Doxygen explicitly requested but not found])
47         fi
48     elif test "${with_doxygen}" = auto; then
49         AC_PATH_PROG([DOXYGEN], [doxygen], [])
50     elif test "${with_doxygen}" = no; then
51         DOXYGEN=
52     else
53         AC_MSG_CHECKING([for doxygen])
54         DOXYGEN="${with_doxygen}"
55         AC_MSG_RESULT([${DOXYGEN}])
56         if test ! -x "${DOXYGEN}"; then
57             AC_MSG_ERROR([Doxygen binary ${DOXYGEN} is not executable])
58         fi
59     fi
60     AM_CONDITIONAL([WITH_DOXYGEN], [test -n "${DOXYGEN}"])
61     AC_SUBST([DOXYGEN])
62 ])