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 Initialize the GNU build system.
32 dnl -----------------------------------------------------------------------
34 AC_INIT([Automated Testing Framework], [0.7], [atf-devel@NetBSD.org], [atf],
35 [http://www.NetBSD.org/~jmmv/atf/])
37 AC_COPYRIGHT([Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.])
38 AC_DEFINE(PACKAGE_COPYRIGHT,
39 ["Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc."],
40 [Define to the copyright string applicable to this package.])
41 AC_CONFIG_AUX_DIR([admin])
42 AC_CONFIG_HEADERS([bconfig.h])
43 AC_CONFIG_MACRO_DIR([m4])
44 AC_CONFIG_SRCDIR([atf-c.h])
45 AC_CONFIG_TESTDIR([tests/bootstrap])
49 AM_INIT_AUTOMAKE([1.9 check-news foreign subdir-objects -Wall])
51 dnl This is just a hack to reverse the meaning of the --enable-shared
52 dnl flag provided by libtool. We want it to default to building static
53 dnl libraries only for now, but these are painful during development.
54 dnl It is nice to have an easy way to enable shared library builds.
55 AC_ARG_ENABLE(unstable-shared,
56 AS_HELP_STRING([--enable-unstable-shared],
57 [Enables the build of shared libraries with unstable ABIs/APIs]),
59 yes|no) enable_shared=${enableval} ;;
60 *) enable_shared=${enableval} ;;
66 dnl -----------------------------------------------------------------------
67 dnl Check for the C and C++ compilers and required features.
68 dnl -----------------------------------------------------------------------
79 ATF_MODULE_APPLICATION
86 ATF_RUNTIME_TOOL([ATF_BUILD_CC],
87 [C compiler to use at runtime], [${CC}])
88 ATF_RUNTIME_TOOL([ATF_BUILD_CFLAGS],
89 [C compiler flags to use at runtime], [${CFLAGS}])
90 ATF_RUNTIME_TOOL([ATF_BUILD_CPP],
91 [C/C++ preprocessor to use at runtime], [${CPP}])
92 ATF_RUNTIME_TOOL([ATF_BUILD_CPPFLAGS],
93 [C/C++ preprocessor flags to use at runtime], [${CPPFLAGS}])
94 ATF_RUNTIME_TOOL([ATF_BUILD_CXX],
95 [C++ compiler to use at runtime], [${CXX}])
96 ATF_RUNTIME_TOOL([ATF_BUILD_CXXFLAGS],
97 [C++ compiler flags to use at runtime], [${CXXFLAGS}])
99 dnl -----------------------------------------------------------------------
100 dnl Documentation building.
101 dnl -----------------------------------------------------------------------
105 dnl -----------------------------------------------------------------------
106 dnl Architecture and machine checks.
107 dnl -----------------------------------------------------------------------
109 machine=${target_cpu}
123 AC_MSG_NOTICE([Machine type: ${machine}, architecture: ${arch}])
124 AC_SUBST(atf_arch, ${arch})
125 AC_SUBST(atf_machine, ${machine})
127 dnl -----------------------------------------------------------------------
128 dnl User-customizable variables.
129 dnl -----------------------------------------------------------------------
131 AC_ARG_VAR([ATF_CONFSUBDIR],
132 [Subdirectory of sysconfdir under which to look for files])
133 if test x"${ATF_CONFSUBDIR-unset}" = x"unset"; then
136 case ${ATF_CONFSUBDIR} in
138 AC_MSG_ERROR([ATF_CONFSUBDIR must hold a relative path])
144 if test x"${ATF_CONFSUBDIR}" = x""; then
145 AC_SUBST(atf_confdir, \${sysconfdir})
147 AC_SUBST(atf_confdir, \${sysconfdir}/${ATF_CONFSUBDIR})
150 AC_ARG_VAR([ATF_WORKDIR],
151 [Default location to use for ATF work directories])
152 if test x"${ATF_WORKDIR}" = x""; then
153 for t in /tmp /var/tmp; do
154 if test -d ${t}; then
159 if test x"${ATF_WORKDIR}" = x""; then
160 AC_MSG_ERROR([Could not guess a value for ATF_WORKDIR])
163 case ${ATF_WORKDIR} in
167 AC_MSG_ERROR([ATF_WORKDIR must hold an absolute path])
172 AC_SUBST(atf_cssdir, \${datadir}/examples/atf)
173 AC_SUBST(atf_dtddir, \${datadir}/xml/atf)
174 AC_SUBST(atf_egdir, \${datadir}/examples/atf)
175 AC_SUBST(atf_pkgconfigdir, \${libdir}/pkgconfig)
176 AC_SUBST(atf_xsldir, \${datadir}/xsl/atf)
178 dnl -----------------------------------------------------------------------
179 dnl Check for the shell and portability problems.
180 dnl -----------------------------------------------------------------------
182 AC_ARG_VAR([ATF_SHELL], [Location of the POSIX shell interpreter to use])
183 if test x"${ATF_SHELL}" = x""; then
184 AC_PATH_PROGS(ATF_SHELL, [bash sh])
190 AC_MSG_ERROR([ATF_SHELL must hold an absolute path])
194 if test x"${ATF_SHELL}" = x""; then
195 AC_MSG_ERROR([No POSIX shell interpreter found; maybe set ATF_SHELL?])
198 dnl -----------------------------------------------------------------------
199 dnl Check for required tools.
200 dnl -----------------------------------------------------------------------
202 AC_PATH_PROG([MTN], [mtn])
204 ATF_RUNTIME_TOOL([ATF_M4],
205 [M4 tool to generate GNU Automake files], [m4])
207 dnl -----------------------------------------------------------------------
208 dnl Finally, generate output.
209 dnl -----------------------------------------------------------------------
211 AC_OUTPUT([Makefile atf-c/defs.h])
213 if test ${enable_shared} = yes; then
214 AC_MSG_WARN([Shared libraries with unstable ABIs/APIs have been enabled.])
215 AC_MSG_WARN([Please do not install them as part of a binary package.])
218 dnl vim: syntax=m4:expandtab:shiftwidth=4:softtabstop=4