]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/kyua/configure.ac
amd64: use register macros for gdb_cpu_getreg()
[FreeBSD/FreeBSD.git] / contrib / kyua / configure.ac
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 AC_INIT([Kyua], [0.14], [kyua-discuss@googlegroups.com], [kyua],
30         [https://github.com/jmmv/kyua/])
31 AC_PREREQ([2.65])
32
33
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])
41
42
43 AM_INIT_AUTOMAKE([1.9 foreign subdir-objects -Wall])
44
45
46 AC_LANG([C++])
47 AC_PROG_CXX
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
52 KYUA_ATTRIBUTE_PURE
53 KYUA_ATTRIBUTE_UNUSED
54 KYUA_FS_MODULE
55 KYUA_GETOPT
56 KYUA_LAST_SIGNO
57 KYUA_MEMORY
58 AC_CHECK_FUNCS([putenv setenv unsetenv])
59 AC_CHECK_HEADERS([termios.h])
60
61
62 AC_PROG_RANLIB
63
64
65 m4_ifndef([PKG_CHECK_MODULES],
66     [m4_fatal([Cannot find pkg.m4; see the INSTALL document for help])])
67
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])])
76 ATF_ARG_WITH
77
78 PKG_CHECK_MODULES([LUTOK], [lutok >= 0.4],
79                   [],
80                   AC_MSG_ERROR([lutok (0.4 or newer) is required]))
81 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.22],
82                   [],
83                   AC_MSG_ERROR([sqlite3 (3.6.22 or newer) is required]))
84 KYUA_DOXYGEN
85 AC_PATH_PROG([GDB], [gdb])
86 test -n "${GDB}" || GDB=gdb
87 AC_PATH_PROG([GIT], [git])
88
89
90 KYUA_UNAME_ARCHITECTURE
91 KYUA_UNAME_PLATFORM
92
93
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
97     KYUA_CONFSUBDIR=kyua
98 else
99     case ${KYUA_CONFSUBDIR} in
100     /*)
101         AC_MSG_ERROR([KYUA_CONFSUBDIR must hold a relative path])
102         ;;
103     *)
104         ;;
105     esac
106 fi
107 if test x"${KYUA_CONFSUBDIR}" = x""; then
108     AC_SUBST(kyua_confdir, \${sysconfdir})
109 else
110     AC_SUBST(kyua_confdir, \${sysconfdir}/${KYUA_CONFSUBDIR})
111 fi
112
113
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
123 none)
124     KYUA_CONFIG_FILE_FOR_CHECK=none
125     ;;
126 /*)
127     if test -f "${KYUA_CONFIG_FILE_FOR_CHECK}"; then
128         : # All good!
129     else
130         AC_MSG_ERROR([KYUA_CONFIG_FILE_FOR_CHECK file does not exist])
131     fi
132     ;;
133 *)
134     AC_MSG_ERROR([KYUA_CONFIG_FILE_FOR_CHECK must hold an absolute path])
135     ;;
136 esac
137
138
139 AC_ARG_VAR([KYUA_TMPDIR],
140            [Path to the directory in which to place work directories])
141 case "${KYUA_TMPDIR:-unset}" in
142     unset)
143         KYUA_TMPDIR=/tmp
144         ;;
145     /*)
146         ;;
147     *)
148         AC_MSG_ERROR([KYUA_TMPDIR must be an absolute path])
149         ;;
150 esac
151
152
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)
159
160
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
163 dnl issue.
164 if test "${srcdir}" = .; then
165     target_srcdir=
166 else
167     target_srcdir="${srcdir}/"
168 fi
169 AM_CONDITIONAL(TARGET_SRCDIR_EMPTY, [test -z "${target_srcdir}"])
170 AC_SUBST([target_srcdir])
171
172
173 AC_OUTPUT