2 dnl Automated Testing Framework (atf)
4 dnl Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
5 dnl All rights reserved.
7 dnl Redistribution and use in source and binary forms, with or without
8 dnl modification, are permitted provided that the following conditions
10 dnl 1. Redistributions of source code must retain the above copyright
11 dnl notice, this list of conditions and the following disclaimer.
12 dnl 2. Redistributions in binary form must reproduce the above copyright
13 dnl notice, this list of conditions and the following disclaimer in the
14 dnl documentation and/or other materials provided with the distribution.
16 dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 dnl -----------------------------------------------------------------------
31 dnl Set up the developer mode
32 dnl -----------------------------------------------------------------------
37 dnl Checks for optional requirements to build the documentation files.
39 AC_DEFUN([ATF_DOC_BUILD], [
42 if test ${enable_doc_build} = yes; then
44 _ATF_DOC_CHECK_TOOL([links], [LINKS])
45 _ATF_DOC_CHECK_TOOL([tidy], [TIDY])
46 _ATF_DOC_CHECK_TOOL([xmlcatalog], [XMLCATALOG])
47 _ATF_DOC_CHECK_TOOL([xmllint], [XMLLINT])
48 _ATF_DOC_CHECK_TOOL([xsltproc], [XSLTPROC])
51 _ATF_DOC_DTD([-//OASIS//DTD Simplified DocBook XML V1.1//EN])
54 AC_MSG_NOTICE([Building documentation: ${enable_doc_build}])
55 if test ${enable_doc_build} = no; then
56 AC_MSG_WARN(['make dist' won't work if documentation is edited])
59 AC_SUBST([DOC_BUILD], [${enable_doc_build}])
60 AM_CONDITIONAL([DOC_BUILD], [test ${enable_doc_build} = yes])
66 dnl Adds a --enable-doc-build flag to build the documentation. Defaults
67 dnl to 'no' because distfiles ship with pre-built documents.
69 AC_DEFUN([_ATF_DOC_FLAG], [
70 AC_ARG_ENABLE(doc-build,
71 AS_HELP_STRING(--enable-doc-build,
72 [enable building of documentation]),,
75 case "${enable_doc_build}" in
79 AC_MSG_ERROR([Invalid argument for --enable-doc-build])
85 dnl _ATF_DOC_CHECK_TOOL(lowercase-name, uppercase-name)
87 dnl Checks for the 'lowercase-name' tool and sets the 'uppercase-name'
88 dnl variable to it if found. Aborts execution if not found.
90 AC_DEFUN([_ATF_DOC_CHECK_TOOL], [
91 AC_ARG_VAR([$2], [Absolute path to the $1 tool; build-time only])
92 AC_PATH_PROG([$2], [$1])
93 if test "${$2:-empty}" = empty; then
94 AC_MSG_ERROR([$1 could not be found])
99 dnl _ATF_DOC_DTD(entity)
101 dnl Checks for the presence of a DTD based on its entity name.
103 AC_DEFUN([_ATF_DOC_DTD], [
104 AC_ARG_VAR([XML_CATALOG_FILE],
105 [XML catalog to use (default: /etc/xml/catalog)])
106 : ${XML_CATALOG_FILE:=/etc/xml/catalog}
108 AC_MSG_CHECKING([for DTD $1])
109 XML_CATALOG_FILES= ${XMLCATALOG} ${XML_CATALOG_FILE} '$1' \
111 if test ${?} -ne 0; then
113 echo "XML catalog: ${XML_CATALOG_FILE}"
114 echo "xmlcatalog output:"
116 AC_MSG_ERROR([Could not find the '$1' DTD])