]> granicus.if.org Git - icinga2/blob - configure.ac
Various bugfixes.
[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
35 AC_FUNC_VFORK
36
37 LT_INIT([dlopen disable-static win32-dll])
38 LT_CONFIG_LTDL_DIR([third-party/ltdl])
39 LTDL_INIT
40
41 DX_HTML_FEATURE(ON)
42 DX_CHM_FEATURE(OFF)
43 DX_CHI_FEATURE(OFF)
44 DX_MAN_FEATURE(OFF)
45 DX_RTF_FEATURE(OFF)
46 DX_XML_FEATURE(OFF)
47 DX_PDF_FEATURE(OFF)
48 DX_PS_FEATURE(OFF)
49 DX_INIT_DOXYGEN([icinga], [docs/Doxyfile], [docs/dev])
50 AD_INIT_ASCIIDOC([icinga], [docs])
51
52 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
53
54 AC_PROG_INSTALL
55 AC_PROG_LEX
56 AC_PROG_YACC
57 AC_PROG_LIBTOOL
58 AX_CXX_GCC_ABI_DEMANGLE
59 AX_BOOST_BASE([1.41], [], [AC_MSG_ERROR([You need the Boost headers and libraries in order to build this application])])
60 AX_BOOST_SIGNALS
61 AX_BOOST_THREAD
62 AX_BOOST_SYSTEM
63 AX_BOOST_UNIT_TEST_FRAMEWORK
64 AX_BOOST_PROGRAM_OPTIONS
65 AX_CHECK_OPENSSL([], [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application])])
66 AC_CHECK_LIB(ssl, SSL_new)
67 AC_CHECK_LIB(crypto, X509_NAME_oneline)
68 AC_CHECK_LIB(eay32, X509_NAME_oneline)
69 AC_CHECK_LIB(m, floor)
70 AC_CHECK_LIB(socket, getsockname)
71 AC_CHECK_LIB(ws2_32, getsockname)
72 AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA)
73 AC_CHECK_FUNCS([backtrace_symbols execvpe pipe2])
74
75 AC_MSG_CHECKING(whether to enable debugging)
76 AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes]   turn on debugging (default=no)],, enable_debug=no)
77 if test "x$enable_debug" = "xyes"; then
78         CFLAGS="$CFLAGS -g -O0 -D_DEBUG -Wall -Wextra"
79         CXXFLAGS="$CXXFLAGS -g -O0 -D_DEBUG -Wall -Wextra"
80 else
81         CFLAGS="$CFLAGS -DNDEBUG"
82         CXXFLAGS="$CXXFLAGS -DNDEBUG"
83 fi
84 AC_MSG_RESULT($enable_debug)
85
86 AX_C___ATTRIBUTE__
87 if test "$ax_cv___attribute__" = "yes" && test "x$enable_debug" = "xno"; then
88         CFLAGS="$CFLAGS -fvisibility=hidden"
89         CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
90 fi
91
92 AX_PYTHON_DEFAULT
93 AX_PYTHON_ENABLE
94 AX_PYTHON_VERSION_ENSURE([2.5])
95 AX_PYTHON_CSPEC
96 AX_PYTHON_LSPEC
97
98 AS_AC_EXPAND([ICINGA_PREFIX], $prefix)
99 AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.])
100
101 AS_AC_EXPAND([ICINGA_LOCALSTATEDIR], $localstatedir)
102 AC_DEFINE_UNQUOTED([ICINGA_LOCALSTATEDIR], "$ICINGA_LOCALSTATEDIR", [The local state dir.])
103
104 AS_AC_EXPAND([ICINGA_PKGLIBDIR], $libdir/$PACKAGE)
105 AC_DEFINE_UNQUOTED([ICINGA_PKGLIBDIR], "$ICINGA_PKGLIBDIR", [The package lib dir.])
106
107 AS_AC_EXPAND([ICINGA_PKGDATADIR], $datadir/$PACKAGE)
108 AC_DEFINE_UNQUOTED([ICINGA_PKGDATADIR], "$ICINGA_PKGDATADIR", [The package data dir.])
109
110 AC_CONFIG_FILES([
111 Makefile
112 components/Makefile
113 components/checker/Makefile
114 components/compat/Makefile
115 components/delegation/Makefile
116 components/demo/Makefile
117 components/notification/Makefile
118 components/replication/Makefile
119 docs/Doxyfile
120 docs/Makefile
121 etc/Makefile
122 etc/icinga2/Makefile
123 etc/init.d/Makefile
124 icinga-app/Makefile
125 itl/Makefile
126 lib/Makefile
127 lib/base/Makefile
128 lib/config/Makefile
129 lib/icinga/Makefile
130 lib/python/Makefile
131 lib/remoting/Makefile
132 test/Makefile
133 third-party/Makefile
134 third-party/cJSON/Makefile
135 third-party/execvpe/Makefile
136 third-party/mmatch/Makefile
137 third-party/popen-noshell/Makefile
138 ])
139 AC_OUTPUT([
140 etc/init.d/icinga2
141 ])
142
143 if ! test -z "$LTDLDEPS"; then
144         ltdl_msg="bundled"
145 else
146         ltdl_msg="system-provided"
147 fi
148
149 echo "
150 Libraries:
151      ltdl: $ltdl_msg
152
153 *** Please note that at this point Icinga 2 is highly experimental software
154 *** and is missing a significant portion of the planned features. This
155 *** is merely a technology preview and if you're planning to set up
156 *** a production environment for Icinga you should use Icinga 1.x instead.
157 "