1 dnl Copyright 2010 The Kyua Authors.
2 dnl All rights reserved.
4 dnl Redistribution and use in source and binary forms, with or without
5 dnl modification, are permitted provided that the following conditions are
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.
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.
29 AC_INIT([Kyua], [0.14], [kyua-discuss@googlegroups.com], [kyua],
30 [https://github.com/jmmv/kyua/])
34 AC_COPYRIGHT([Copyright 2010 The Kyua Authors.])
35 AC_CONFIG_AUX_DIR([admin])
36 AC_CONFIG_FILES([Doxyfile Makefile utils/defs.hpp])
37 AC_CONFIG_HEADERS([config.h])
38 AC_CONFIG_MACRO_DIR([m4])
39 AC_CONFIG_SRCDIR([main.cpp])
40 AC_CONFIG_TESTDIR([bootstrap])
43 AM_INIT_AUTOMAKE([1.9 foreign subdir-objects -Wall])
48 AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
49 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
50 KYUA_DEVELOPER_MODE([C++])
51 KYUA_ATTRIBUTE_NORETURN
58 AC_CHECK_FUNCS([putenv setenv unsetenv])
59 AC_CHECK_HEADERS([termios.h])
65 m4_ifndef([PKG_CHECK_MODULES],
66 [m4_fatal([Cannot find pkg.m4; see the INSTALL document for help])])
68 m4_ifndef([ATF_CHECK_CXX],
69 [m4_fatal([Cannot find atf-c++.m4; see the INSTALL document for help])])
70 ATF_CHECK_CXX([>= 0.17])
71 m4_ifndef([ATF_CHECK_SH],
72 [m4_fatal([Cannot find atf-sh.m4; see the INSTALL document for help])])
73 ATF_CHECK_SH([>= 0.15])
74 m4_ifndef([ATF_ARG_WITH],
75 [m4_fatal([Cannot find atf-common.m4; see the INSTALL document for help])])
78 PKG_CHECK_MODULES([LUTOK], [lutok >= 0.4],
80 AC_MSG_ERROR([lutok (0.4 or newer) is required]))
81 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.22],
83 AC_MSG_ERROR([sqlite3 (3.6.22 or newer) is required]))
85 AC_PATH_PROG([GDB], [gdb])
86 test -n "${GDB}" || GDB=gdb
87 AC_PATH_PROG([GIT], [git])
90 KYUA_UNAME_ARCHITECTURE
94 AC_ARG_VAR([KYUA_CONFSUBDIR],
95 [Subdirectory of sysconfdir under which to look for files])
96 if test x"${KYUA_CONFSUBDIR-unset}" = x"unset"; then
99 case ${KYUA_CONFSUBDIR} in
101 AC_MSG_ERROR([KYUA_CONFSUBDIR must hold a relative path])
107 if test x"${KYUA_CONFSUBDIR}" = x""; then
108 AC_SUBST(kyua_confdir, \${sysconfdir})
110 AC_SUBST(kyua_confdir, \${sysconfdir}/${KYUA_CONFSUBDIR})
114 dnl Allow the caller of 'make check', 'make installcheck' and 'make distcheck'
115 dnl on the Kyua source tree to override the configuration file passed to our
116 dnl own test runs. This is for the development of Kyua only and the value of
117 dnl this setting has no effect on the built product in any way. If we go
118 dnl through great extents in validating the value of this setting, it is to
119 dnl minimize the chance of false test run negatives later on.
120 AC_ARG_VAR([KYUA_CONFIG_FILE_FOR_CHECK],
121 [kyua.conf file to use at 'make (|dist|install)check' time])
122 case "${KYUA_CONFIG_FILE_FOR_CHECK-none}" in
124 KYUA_CONFIG_FILE_FOR_CHECK=none
127 if test -f "${KYUA_CONFIG_FILE_FOR_CHECK}"; then
130 AC_MSG_ERROR([KYUA_CONFIG_FILE_FOR_CHECK file does not exist])
134 AC_MSG_ERROR([KYUA_CONFIG_FILE_FOR_CHECK must hold an absolute path])
139 AC_ARG_VAR([KYUA_TMPDIR],
140 [Path to the directory in which to place work directories])
141 case "${KYUA_TMPDIR:-unset}" in
148 AC_MSG_ERROR([KYUA_TMPDIR must be an absolute path])
153 AC_SUBST(examplesdir, \${pkgdatadir}/examples)
154 AC_SUBST(luadir, \${pkgdatadir}/lua)
155 AC_SUBST(miscdir, \${pkgdatadir}/misc)
156 AC_SUBST(pkgtestsdir, \${testsdir}/kyua)
157 AC_SUBST(storedir, \${pkgdatadir}/store)
158 AC_SUBST(testsdir, \${exec_prefix}/tests)
161 dnl BSD make(1) doesn't deal with targets specified as './foo' well: they
162 dnl need to be specified as 'foo'. The following hack is to workaround this
164 if test "${srcdir}" = .; then
167 target_srcdir="${srcdir}/"
169 AM_CONDITIONAL(TARGET_SRCDIR_EMPTY, [test -z "${target_srcdir}"])
170 AC_SUBST([target_srcdir])