]> granicus.if.org Git - icinga2/blob - configure.ac
Fix 'make check-coverage' for VPATH builds.
[icinga2] / configure.ac
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
4  *                                                                            *
5  * This program is free software; you can redistribute it and/or              *
6  * modify it under the terms of the GNU General Public License                *
7  * as published by the Free Software Foundation; either version 2             *
8  * of the License, or (at your option) any later version.                     *
9  *                                                                            *
10  * This program is distributed in the hope that it will be useful,            *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13  * GNU General Public License for more details.                               *
14  *                                                                            *
15  * You should have received a copy of the GNU General Public License          *
16  * along with this program; if not, write to the Free Software Foundation     *
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18  ******************************************************************************/
19
20 AC_INIT
21 AX_SPEC_FILE([icinga2.spec])
22 AX_SPEC_DEFAULTS
23 AX_SET_VERSION_INFO
24 AC_CONFIG_AUX_DIR([m4])
25 AC_CONFIG_HEADERS([config.h])
26 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
27 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
28 AM_SILENT_RULES([yes])
29
30 AC_PROG_CXX
31 AC_LANG_CPLUSPLUS
32 AC_PROG_CC
33 AC_LANG_C
34 AC_PROG_MKDIR_P
35
36 AC_FUNC_VFORK
37
38 LT_INIT([dlopen disable-static win32-dll])
39 LT_CONFIG_LTDL_DIR([third-party/ltdl])
40 LTDL_INIT
41
42 DX_HTML_FEATURE(ON)
43 DX_CHM_FEATURE(OFF)
44 DX_CHI_FEATURE(OFF)
45 DX_MAN_FEATURE(OFF)
46 DX_RTF_FEATURE(OFF)
47 DX_XML_FEATURE(OFF)
48 DX_PDF_FEATURE(OFF)
49 DX_PS_FEATURE(OFF)
50 DX_INIT_DOXYGEN([icinga], [docs/Doxyfile], [docs/dev])
51 AD_INIT_ASCIIDOC([icinga], [docs])
52
53 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
54
55 AC_PROG_INSTALL
56 AC_PROG_LEX
57 AC_PROG_YACC
58 AC_PROG_LIBTOOL
59 AX_CXX_GCC_ABI_DEMANGLE
60 AX_BOOST_BASE([1.41], [], [AC_MSG_ERROR([You need the Boost headers and libraries in order to build this application])])
61 AX_BOOST_SIGNALS
62 AX_BOOST_THREAD
63 AX_BOOST_SYSTEM
64 AX_BOOST_UNIT_TEST_FRAMEWORK
65 AX_BOOST_PROGRAM_OPTIONS
66 AX_CHECK_OPENSSL([], [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application])])
67 AC_CHECK_LIB(ssl, SSL_new)
68 AC_CHECK_LIB(crypto, X509_NAME_oneline)
69 AC_CHECK_LIB(eay32, X509_NAME_oneline)
70 AC_CHECK_LIB(m, floor)
71 AC_CHECK_LIB(socket, getsockname)
72 AC_CHECK_LIB(ws2_32, getsockname)
73 AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA)
74 AC_CHECK_FUNCS([backtrace_symbols execvpe pipe2])
75
76 CFLAGS="$CFLAGS -Wall -Wextra"
77 CXXFLAGS="$CXXFLAGS -Wall -Wextra"
78
79 AC_MSG_CHECKING(whether to enable debugging)
80 AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes]   turn on debugging (default=no)],, enable_debug=no)
81 if test "x$enable_debug" = "xyes"; then
82         CFLAGS="$CFLAGS -g -O0 -D_DEBUG"
83         CXXFLAGS="$CXXFLAGS -g -O0 -D_DEBUG"
84 else
85         CFLAGS="$CFLAGS -DNDEBUG"
86         CXXFLAGS="$CXXFLAGS -DNDEBUG"
87 fi
88 AC_MSG_RESULT($enable_debug)
89
90 AC_MSG_CHECKING(whether to enable coverage)
91 AC_ARG_ENABLE(coverage, [ --enable-coverage=[no/yes]   turn on profiling (default=no)],, enable_coverage=no)
92 if test "x$enable_coverage" = "xyes"; then
93         CFLAGS="$CFLAGS -g -O0 -DNDEBUG -fprofile-arcs -ftest-coverage -lgcov"
94         CXXFLAGS="$CXXFLAGS -g -O0 -DNDEBUG -fprofile-arcs -ftest-coverage -lgcov"
95 fi
96 AC_MSG_RESULT($enable_coverage)
97
98 AX_PYTHON_DEFAULT
99 AX_PYTHON_ENABLE
100 AX_PYTHON_VERSION_ENSURE([2.5])
101 AX_PYTHON_CSPEC
102 AX_PYTHON_LSPEC
103
104 AS_AC_EXPAND([ICINGA_PREFIX], $prefix)
105 AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.])
106
107 AS_AC_EXPAND([ICINGA_LOCALSTATEDIR], $localstatedir)
108 AC_DEFINE_UNQUOTED([ICINGA_LOCALSTATEDIR], "$ICINGA_LOCALSTATEDIR", [The local state dir.])
109
110 AS_AC_EXPAND([ICINGA_PKGLIBDIR], $libdir/$PACKAGE)
111 AC_DEFINE_UNQUOTED([ICINGA_PKGLIBDIR], "$ICINGA_PKGLIBDIR", [The package lib dir.])
112
113 AS_AC_EXPAND([ICINGA_PKGDATADIR], $datadir/$PACKAGE)
114 AC_DEFINE_UNQUOTED([ICINGA_PKGDATADIR], "$ICINGA_PKGDATADIR", [The package data dir.])
115
116 AC_CONFIG_FILES([
117 Makefile
118 components/Makefile
119 components/checker/Makefile
120 components/compat/Makefile
121 components/delegation/Makefile
122 components/demo/Makefile
123 components/livestatus/Makefile
124 components/notification/Makefile
125 components/replication/Makefile
126 docs/Doxyfile
127 docs/Makefile
128 etc/Makefile
129 etc/icinga2/Makefile
130 etc/init.d/Makefile
131 icinga-app/Makefile
132 itl/Makefile
133 lib/Makefile
134 lib/base/Makefile
135 lib/config/Makefile
136 lib/icinga/Makefile
137 lib/python/Makefile
138 lib/remoting/Makefile
139 test/Makefile
140 third-party/Makefile
141 third-party/cJSON/Makefile
142 third-party/execvpe/Makefile
143 third-party/mmatch/Makefile
144 tools/Makefile
145 ])
146 AC_OUTPUT([
147 etc/init.d/icinga2
148 ])
149
150 if ! test -z "$LTDLDEPS"; then
151         ltdl_msg="bundled"
152 else
153         ltdl_msg="system-provided"
154 fi
155
156 echo "
157 Libraries:
158      ltdl: $ltdl_msg
159
160 *** Please note that at this point Icinga 2 is highly experimental software
161 *** and is missing a significant portion of the planned features. This
162 *** is merely a technology preview and if you're planning to set up
163 *** a production environment for Icinga you should use Icinga 1.x instead.
164 "