1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl This is the SysDB configure script.
4 dnl
5 dnl Copyright (C) 2012 Sebastian 'tokkee' Harl <sh@tokkee.org>
6 dnl All rights reserved.
7 dnl
8 dnl Redistribution and use in source and binary forms, with or without
9 dnl modification, are permitted provided that the following conditions
10 dnl are met:
11 dnl 1. Redistributions of source code must retain the above copyright
12 dnl notice, this list of conditions and the following disclaimer.
13 dnl 2. Redistributions in binary form must reproduce the above copyright
14 dnl notice, this list of conditions and the following disclaimer in the
15 dnl documentation and/or other materials provided with the distribution.
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 LIMITED
19 dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21 dnl CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24 dnl OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 dnl ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 AC_INIT([System DataBase],[m4_esyscmd(./version-gen.sh)],
30 [sysdb@sysdb.io],
31 [sysdb],
32 [https://sysdb.io/])
33 PACKAGE_MAINTAINER="Sebastian 'tokkee' Harl <tokkee@sysdb.io>"
34 AC_DEFINE_UNQUOTED([PACKAGE_MAINTAINER], ["$PACKAGE_MAINTAINER"],
35 [Define to the name of the maintainer of this package.])
36 AC_CONFIG_SRCDIR([src/sysdb.c])
37 AC_CONFIG_HEADERS([src/config.h])
38 AC_PREFIX_DEFAULT([/opt/sysdb])
40 AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])
42 AC_LANG(C)
44 AC_SYS_LARGEFILE
46 AC_PROG_CC
47 AC_PROG_CXX
48 AC_PROG_CPP
49 AC_PROG_INSTALL
50 AC_PROG_LN_S
51 AC_PROG_MAKE_SET
52 m4_ifdef([AM_PROG_AR],[AM_PROG_AR],[])
54 AM_PROG_CC_C_O
55 AM_PROG_LEX
56 AC_PROG_YACC
58 m4_ifdef([LT_INIT],
59 [
60 LT_CONFIG_LTDL_DIR([libltdl])
61 LT_INIT([dlopen])
62 LTDL_INIT([convenience])
63 ],
64 # else
65 # (older libtools)
66 [
67 AC_CONFIG_SUBDIRS(libltdl)
68 AC_LIBLTDL_CONVENIENCE
69 AC_SUBST(LTDLINCL)
70 AC_SUBST(LIBLTDL)
71 AC_LIBTOOL_DLOPEN
72 ]
73 )
75 test_cc_flags() {
76 AC_LANG_CONFTEST([int main(void){}])
77 $CC -c conftest.c $CFLAGS $STRICT_CFLAGS $@ > /dev/null 2> /dev/null
78 ret=$?
79 rm -f conftest.o
80 return $ret
81 }
83 test_cxx_flags() {
84 AC_LANG_PUSH(C++)
85 AC_LANG_CONFTEST([int main(void){}])
86 $CXX -c conftest.c $CXXFLAGS $STRICT_CXXFLAGS $@ > /dev/null 2> /dev/null
87 ret=$?
88 rm -f conftest.o
89 AC_LANG_POP(C++)
90 return $ret
91 }
93 STRICT_CFLAGS=""
94 STRICT_CXXFLAGS=""
96 m4_divert_once([HELP_ENABLE], [
97 Build options:])
99 dnl Optionally stick to standard C99 and POSIX:2001 as close as possible.
100 AC_ARG_ENABLE([standards],
101 AS_HELP_STRING([--enable-standards],
102 [C99 / POSIX standards compliance mode @<:@default=no@:>@]),
103 [enable_standards="$enableval"],
104 [enable_standards="no"])
106 if test "x$enable_standards" = "xyes"; then
107 AC_DEFINE([_ISOC99_SOURCE], 1,
108 [Define to enforce ISO/IEC 9899:1999 (C99) compliance.])
109 AC_DEFINE([_POSIX_C_SOURCE], 200112L,
110 [Define to enforce IEEE 1003.1-2001 (POSIX:2001) compliance.])
111 AC_DEFINE([_XOPEN_SOURCE], 700,
112 [Define to enforce X/Open 7 (XSI) compliance.])
113 AC_DEFINE([_REENTRANT], 1,
114 [Define to enable reentrant interfaces.])
115 AC_DEFINE([_THREAD_SAFE], 1,
116 [Define to enable reentrant interfaces.])
118 dnl GNU libc defines strcasecmp() only when using _BSD_SOURCE even though
119 dnl the function is conforming to POSIX.1-2001 as well. Let's weaken
120 dnl strict standards compliance a bit to work around this.
121 AC_DEFINE([_BSD_SOURCE], 1, [Define to enable 4.3BSD support.])
123 for flag in -std=c99; do
124 AC_MSG_CHECKING([whether $CC accepts $flag])
126 if test_cc_flags $flag; then
127 STRICT_CFLAGS="$STRICT_CFLAGS $flag"
128 AC_MSG_RESULT([yes])
129 else
130 AC_MSG_RESULT([no])
131 fi
132 done
133 fi
135 dnl We need C++11 for facter.
136 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
137 if test_cxx_flags -std=c++11; then
138 CXXFLAGS="$CXXFLAGS -std=c++11"
139 AC_MSG_RESULT([yes])
140 else
141 # Oh well, the header check will determine if it works anyway.
142 AC_MSG_RESULT([no])
143 fi
145 dnl Hardening (see e.g. http://wiki.debian.org/Hardening for a motivation).
146 AC_DEFINE([_FORTIFY_SOURCE], 2,
147 [Define to enable protection against static sized buffer overflows.])
148 AC_ARG_ENABLE([hardening],
149 AS_HELP_STRING([--disable-hardening],
150 [hardening options @<:@default=yes@:>@]),
151 [enable_hardening="$enableval"],
152 [enable_hardening="yes"])
154 if test "x$enable_hardening" = "xyes"; then
155 hardening_cc=0
156 hardening_cxx=0
157 hardening_tests=0
158 for flag in -Wformat -Wformat-security; do
159 hardening_tests=$(($hardening_tests + 1))
161 AC_MSG_CHECKING([whether $CC accepts $flag])
162 if test_cc_flags $flag; then
163 STRICT_CFLAGS="$STRICT_CFLAGS $flag"
164 hardening_cc=$(($hardening_cc + 1))
165 AC_MSG_RESULT([yes])
166 else
167 AC_MSG_RESULT([no])
168 fi
170 AC_MSG_CHECKING([whether $CXX accepts $flag])
171 if test_cxx_flags $flag; then
172 STRICT_CXXFLAGS="$STRICT_CXXFLAGS $flag"
173 hardening_cxx=$(($hardening_cxx + 1))
174 AC_MSG_RESULT([yes])
175 else
176 AC_MSG_RESULT([no])
177 fi
178 done
179 if test $hardening_cc -ne $hardening_tests; then
180 AC_MSG_WARN(
181 [Some hardening options are not supported by your C compiler!])
182 fi
183 if test $hardening_cxx -ne $hardening_tests; then
184 AC_MSG_WARN(
185 [Some hardening options are not supported by your C++ compiler!])
186 fi
187 fi
189 dnl Strict checking for potential problems.
190 AC_ARG_ENABLE([strict-checks],
191 AS_HELP_STRING([--disable-strict-checks],
192 [strict compiler checks @<:@default=yes@:>@]),
193 [enable_strict_checks="$enableval"],
194 [enable_strict_checks="yes"])
196 for flag in -Wall -Werror; do
197 AC_MSG_CHECKING([whether $CC accepts $flag])
198 if test_cc_flags $flag; then
199 STRICT_CFLAGS="$STRICT_CFLAGS $flag"
200 AC_MSG_RESULT([yes])
201 else
202 AC_MSG_RESULT([no])
203 fi
205 AC_MSG_CHECKING([whether $CXX accepts $flag])
206 if test_cxx_flags $flag; then
207 STRICT_CXXFLAGS="$STRICT_CXXFLAGS $flag"
208 AC_MSG_RESULT([yes])
209 else
210 AC_MSG_RESULT([no])
211 fi
212 done
214 if test "x$enable_strict_checks" = "xyes"; then
215 dnl -Wsign-conversion may cause problems in expanded macros from libc
216 for flag in -Wextra \
217 -Wbad-function-cast \
218 -Wcast-align \
219 -Wcast-qual \
220 -Wconversion \
221 -Wno-sign-conversion \
222 -Wdeclaration-after-statement \
223 -Wmissing-prototypes \
224 -Wpointer-arith \
225 -Wshadow \
226 -Wstrict-prototypes; do
227 AC_MSG_CHECKING([whether $CC accepts $flag])
228 if test_cc_flags $flag; then
229 STRICT_CFLAGS="$STRICT_CFLAGS $flag"
230 AC_MSG_RESULT([yes])
231 else
232 AC_MSG_RESULT([no])
233 fi
235 dnl -Wshadow produces unnecessary warnings/errors in case a
236 dnl C function name "shadows" a struct constructor.
237 if test "x$flag" != "x-Wshadow"; then
238 AC_MSG_CHECKING([whether $CXX accepts $flag])
239 if test_cxx_flags $flag; then
240 STRICT_CXXFLAGS="$STRICT_CXXFLAGS $flag"
241 AC_MSG_RESULT([yes])
242 else
243 AC_MSG_RESULT([no])
244 fi
245 fi
246 done
247 fi
248 AC_SUBST([STRICT_CFLAGS])
249 AC_SUBST([STRICT_CXXFLAGS])
251 AC_ARG_ENABLE([gcov],
252 AS_HELP_STRING([--enable-gcov],
253 [Gcov coverage statistics @<:@default=no@:>@]),
254 [enable_gcov="$enableval"],
255 [enable_gcov="no"])
257 dnl $GCC is based on some heuristics which might apply to clang as well.
258 dnl However, clang does not support gcov.
259 cc_is_gcc="no"
260 case "x$CC" in
261 xgcc)
262 cc_is_gcc="yes"
263 ;;
264 xgcc-*)
265 cc_is_gcc="yes"
266 ;;
267 esac
269 COVERAGE_CFLAGS=""
270 COVERAGE_LDFLAGS=""
271 if test "x$enable_gcov" = "xyes" && test "x$GCC$cc_is_gcc" == "xyesyes"; then
272 COVERAGE_CFLAGS="-O0"
273 cov_flag_have_problem="no"
275 AC_MSG_CHECKING([whether $CC accepts --coverage])
276 if test_cc_flags --coverage; then
277 COVERAGE_CFLAGS="$COVERAGE_CFLAGS --coverage"
278 COVERAGE_LDFLAGS="$COVERAGE_LDFLAGS --coverage"
279 AC_MSG_RESULT([yes])
280 else
281 AC_MSG_RESULT([no])
282 cov_flag_have_problem="yes"
283 fi
285 for flag in -fno-inline; do
286 AC_MSG_CHECKING([whether $CC accepts $flag])
287 if test_cc_flags $flag; then
288 COVERAGE_CFLAGS="$COVERAGE_CFLAGS $flag"
289 AC_MSG_RESULT([yes])
290 else
291 AC_MSG_RESULT([no])
292 cov_flag_have_problem="yes"
293 fi
294 done
296 if test "x$cov_flag_have_problem" != "xno"; then
297 AC_MSG_WARN([Some coverage flags are not supported by your compiler!])
298 fi
299 else if test "x$enable_gcov" = "xyes"; then
300 AC_MSG_WARN([Your compiler ($CC) is not known to support Gcov!])
301 enable_gcov="no (requires GCC)"
302 fi; fi
303 AC_SUBST([COVERAGE_CFLAGS])
304 AC_SUBST([COVERAGE_LDFLAGS])
306 AC_ARG_ENABLE([gprof],
307 AS_HELP_STRING([--enable-gprof],
308 [Gprof profiling @<:@default=no@:>@]),
309 [enable_gprof="$enableval"],
310 [enable_gprof="no"])
312 PROFILING_CFLAGS=""
313 PROFILING_LDFLAGS=""
314 if test "x$enable_gprof" = "xyes"; then
315 PROFILING_CFLAGS="-O0"
316 profiling_flag_have_problem="no"
318 AC_MSG_CHECKING([whether $CC accepts -pg])
319 if test_cc_flags -pg; then
320 PROFILING_CFLAGS="$PROFILING_CFLAGS -pg"
321 PROFILING_LDFLAGS="$PROFILING_LDFLAGS -pg"
322 AC_MSG_RESULT([yes])
323 else
324 AC_MSG_RESULT([no])
325 profiling_flag_have_problem="yes"
326 fi
328 for flag in -fprofile-arcs; do
329 AC_MSG_CHECKING([whether $CC accepts $flag])
330 if test_cc_flags $flag; then
331 PROFILING_CFLAGS="$PROFILING_CFLAGS $flag"
332 AC_MSG_RESULT([yes])
333 fi
334 # else: this is not a serious problem
335 done
337 if test "x$profiling_flag_have_problem" != "xno"; then
338 AC_MSG_WARN([Some profiling flags are not supported by your compiler!])
339 fi
340 fi
341 AC_SUBST([PROFILING_CFLAGS])
342 AC_SUBST([PROFILING_LDFLAGS])
344 m4_divert_once([HELP_ENABLE], [
345 Build dependencies:])
347 AC_CHECK_HEADERS([ucred.h])
348 dnl On OpenBSD, sys/param.h is required for sys/ucred.h.
349 AC_CHECK_HEADERS([sys/ucred.h], [], [],
350 [[ #include <sys/param.h> ]])
352 AC_CHECK_TYPES([struct ucred],
353 [have_struct_ucred="yes"], [have_struct_ucred="no"],
354 [[
355 #include <sys/socket.h>
356 #include <sys/param.h>
357 #if HAVE_UCRED_H
358 # include <ucred.h>
359 #endif
360 ]])
362 if test "x$have_struct_ucred" != "xyes"; then
363 AC_MSG_CHECKING([for struct ucred when using _GNU_SOURCE])
364 orig_CFLAGS="$CFLAGS"
365 CFLAGS="$CFLAGS -D_GNU_SOURCE"
366 dnl Don't reuse AC_CHECK_HEADERS; for one it'll use the cached value
367 dnl but also, it will print the "checking for" message a second time.
368 AC_COMPILE_IFELSE(
369 [AC_LANG_PROGRAM(
370 [[
371 #include <sys/socket.h>
372 #include <sys/param.h>
373 #if HAVE_UCRED_H
374 # include <ucred.h>
375 #endif
376 ]],
377 [if (sizeof(struct ucred)) return 0;]
378 )],
379 [have_struct_ucred="yes"], [have_struct_ucred="no"])
380 CFLAGS="$orig_CFLAGS"
381 if test "x$have_struct_ucred" = "xyes"; then
382 AC_DEFINE([_GNU_SOURCE], 1, [Define to enable GNU features.])
383 fi
384 AC_MSG_RESULT([$have_struct_ucred])
385 fi
387 dnl Testing.
388 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],
389 [unit_tests="yes"], [unit_tests="no"])
391 AC_CHECK_HEADERS(libgen.h)
393 dnl Check for dependencies.
394 AC_ARG_WITH([libdbi],
395 [AS_HELP_STRING([--with-libdbi], [libdbi support (default: auto)])],
396 [with_libdbi="$withval"],
397 [with_libdbi="yes"])
398 if test "x$with_libdbi" = "xyes" || test "x$with_libdbi" = "xauto"; then
399 AC_CHECK_HEADERS([dbi/dbi.h],
400 [with_libdbi="yes"],
401 [with_libdbi="no (dbi/dbi.h not found)"])
402 else if test "x$with_libdbi" = "xno"; then
403 with_libdbi="$with_libdbi (disabled on command-line)"
404 else
405 AC_MSG_ERROR([Invalid value for option --with-libdbi=$with_libdbi (expected "yes", "no", or "auto")])
406 fi; fi
407 if test "x$with_libdbi" = "xyes"; then
408 AC_CHECK_LIB([dbi], [dbi_initialize],
409 [with_libdbi="yes"],
410 [with_libdbi="no (libdbi or symbol 'dbi_initialize' not found)"])
411 fi
412 AM_CONDITIONAL([BUILD_WITH_LIBDBI], test "x$with_libdbi" = "xyes")
414 dnl Required for mocking FILE related functions.
415 orig_CFLAGS="$CFLAGS"
416 CFLAGS="$CFLAGS -D_GNU_SOURCE"
417 AC_CHECK_FUNCS([fopencookie],
418 [have_fopencookie="yes"],
419 [have_fopencookie="no (fopencookie not available)"])
420 CFLAGS="$orig_CFLAGS"
421 AM_CONDITIONAL([BUILD_WITH_FOPENCOOKIE], test "x$have_fopencookie" = "xyes")
422 if test "x$have_fopencookie" = "xyes"; then
423 AC_DEFINE([HAVE_FOPENCOOKIE], 1)
424 fi
426 dnl readline support
427 AC_ARG_WITH([readline],
428 [AS_HELP_STRING([--with-readline],
429 [readline support (libedit/libreadline) (default: auto, prefer libedit)])],
430 [readline_support="$withval"],
431 [readline_support="auto"])
433 if test "x$readline_support" = "xyes"; then
434 readline_support="auto"
435 else if test "x$readline_support" != "xauto" \
436 && test "x$readline_support" != "xno" \
437 && test "x$readline_support" != "xlibedit" \
438 && test "x$readline_support" != "xlibreadline"; then
439 AC_MSG_ERROR([Invalid value for option --with-readline=$readline_support (expected "yes", "no", "auto", "libedit", or "libreadline")])
440 fi; fi
442 have_libedit="no"
443 if test "x$readline_support" = "xauto" \
444 || test "x$readline_support" = "xlibedit"; then
445 PKG_CHECK_MODULES([LIBEDIT], [libedit],
446 [have_libedit="yes"], [have_libedit="no"])
447 if test "x$have_libedit" = "xyes"; then
448 AC_CHECK_HEADERS([editline/readline.h], [],
449 [AC_CHECK_HEADERS([readline.h], [],
450 [have_libedit="no (readline header not found"])])
451 fi
452 if test "x$have_libedit" = "xyes"; then
453 AC_CHECK_HEADERS([editline/history.h], [],
454 [AC_CHECK_HEADERS([history.h], [],
455 [have_libedit="no (history header not found"])])
456 fi
457 else
458 have_libedit="disabled on command-line"
459 fi
461 have_libreadline="no"
462 if test "x$have_libedit" != "xyes"; then
463 if test "x$readline_support" = "xauto" \
464 || test "x$readline_support" = "xlibreadline"; then
465 AC_CHECK_LIB([readline], [readline],
466 [have_libreadline="yes"],
467 [have_libreadline="no (libreadline or symbol 'readline' not found)"])
468 fi
469 if test "x$have_libreadline" = "xyes"; then
470 AC_CHECK_HEADERS([readline/readline.h], [],
471 [AC_CHECK_HEADERS([readline.h], [],
472 [have_libreadline="no (readline header not found"])])
473 fi
474 if test "x$have_libreadline" = "xyes"; then
475 AC_CHECK_HEADERS([readline/history.h], [],
476 [AC_CHECK_HEADERS([history.h], [],
477 [have_libreadline="no (history header not found"])])
478 fi
479 else
480 have_libreadline="unchecked (prefer libedit)"
481 fi
483 if test "x$have_libedit" = "xyes"; then
484 READLINE_LIBS="$LIBEDIT_LIBS"
485 READLINE_CFLAGS="$LIBEDIT_CFLAGS"
486 readline_support="libedit"
487 else if test "x$have_libreadline" = "xyes"; then
488 READLINE_LIBS="-lreadline -lhistory"
489 READLINE_CFLAGS=""
490 readline_support="libreadline"
491 else
492 READLINE_LIBS=""
493 READLINE_CFLAGS=""
494 if test "x$readline_support" = "xno"; then
495 AC_MSG_WARN([*** readline support disabled; disabling SysDB client])
496 else if test "x$readline_support" = "xauto"; then
497 AC_MSG_WARN([*** readline not found; disabling SysDB client])
498 else
499 AC_MSG_ERROR([readline not found])
500 fi; fi
501 readline_support="no"
502 fi; fi
503 AC_SUBST([READLINE_LIBS])
504 AC_SUBST([READLINE_CFLAGS])
505 AM_CONDITIONAL([BUILD_CLIENT], test "x$readline_support" != "no")
507 AC_LANG_PUSH(C++)
508 AC_ARG_WITH([libfacter],
509 [AS_HELP_STRING([--with-libfacter], [libfacter support (default: auto)])],
510 [with_libfacter="$withval"],
511 [with_libfacter="yes"])
512 if test "x$with_libfacter" = "xyes" || test "x$with_libfacter" = "xauto"; then
513 AC_CHECK_HEADERS([facter/facts/collection.hpp],
514 [have_libfacter="yes"],
515 [have_libfacter="no (facter/facts/collection.hpp not found)"])
516 else if test "x$with_libfacter" = "xno"; then
517 have_libfacter="$with_libfacter (disabled on command-line)"
518 else
519 AC_MSG_ERROR([Invalid value for option --with-libfacter=$with_libfacter (expected "yes", "no", or "auto")])
520 fi; fi
521 if test "x$have_libfacter" = "xyes"; then
522 AC_MSG_CHECKING([for facter::facts::collection in -lfacter])
523 AC_LINK_IFELSE(
524 [AC_LANG_PROGRAM(
525 [[ #include <facter/facts/collection.hpp> ]],
526 [[
527 facter::facts::collection facts;
528 facts.add_default_facts();
529 ]]
530 )],
531 [TEST_LIBS=$TEST_LIBS -lfacter],
532 [have_libfacter="yes"],
533 [have_libfacter="no (libfacter not found)"])
534 AC_MSG_RESULT([$have_libfacter])
535 fi
536 AC_LANG_POP(C++)
538 AC_ARG_WITH([librrd],
539 [AS_HELP_STRING([--with-librrd], [librrd support (default: auto)])],
540 [with_librrd="$withval"],
541 [with_librrd="yes"])
542 if test "x$with_librrd" = "xyes" || test "x$with_librrd" = "xauto"; then
543 PKG_CHECK_MODULES([RRD], [librrd],
544 [have_librrd="yes"], [have_librrd="no"])
545 else if test "x$with_librrd" = "xno"; then
546 have_librrd="$with_librrd (disabled on command-line)"
547 else
548 AC_MSG_ERROR([Invalid value for option --with-librrd=$with_librrd (expected "yes", "no", or "auto")])
549 fi; fi
551 if test "x$have_librrd" = "xyes"; then
552 AC_CHECK_HEADERS([rrd_client.h])
553 fi
555 dnl Feature checks.
556 build_documentation="yes"
558 have_xmlto="yes"
559 AC_PATH_PROG([XMLTO], [xmlto])
560 if test "x$XMLTO" = "x"; then
561 have_xmlto="no"
562 build_documentation="no (missing xmlto)"
563 fi
564 AC_SUBST([XMLTO])
566 have_asciidoc="yes"
567 AC_PATH_PROG([ASCIIDOC], [asciidoc])
568 if test "x$ASCIIDOC" = "x"; then
569 have_asciidoc="no"
570 build_documentation="no (missing asciidoc)"
571 fi
572 AC_SUBST([ASCIIDOC])
574 AC_ARG_VAR([ADOCFLAGS], [AsciiDoc flags])
576 integration_tests="yes"
577 AC_PATH_PROG([VALGRIND], [valgrind])
578 if test "x$VALGRIND" = "x"; then
579 integration_tests="no (missing valgrind)"
580 fi
581 AM_CONDITIONAL([INTEGRATION_TESTING], test "x$integration_tests" = "xyes")
583 dnl Plugin checks.
584 facter_default=$have_libfacter
585 if test "x$facter_default" != "xyes"; then
586 facter_default="no (requires libfacter)"
587 fi
588 puppet_storeconfigs_default=$with_libdbi
589 if test "x$puppet_storeconfigs_default" != "xyes"; then
590 puppet_storeconfigs_default="no (requires libdbi)"
591 fi
592 rrdtool_default=$have_librrd
593 if test "x$rrdtool_default" != "xyes"; then
594 rrdtool_default="no (required librrd)"
595 fi
597 m4_divert_once([HELP_ENABLE], [
598 Backends:])
600 AC_SDB_PLUGIN_INIT
601 AC_SDB_PLUGIN([collectd-unixsock], [yes],
602 [backend accessing the system statistics collection daemon])
603 AC_SDB_PLUGIN([facter], [$facter_default],
604 [backend retrieving local facter facts])
605 AC_SDB_PLUGIN([mk-livestatus], [yes],
606 [backend accessing Nagios/Icinga/Shinken using MK Livestatus])
607 AC_SDB_PLUGIN([puppet-storeconfigs], [$puppet_storeconfigs_default],
608 [backend accessing the Puppet stored configuration database])
610 m4_divert_once([HELP_ENABLE], [
611 Time-series fetchers:])
612 AC_SDB_PLUGIN([timeseries-rrdtool], [$rrdtool_default],
613 [fetch time-series data from RRD files])
615 m4_divert_once([HELP_ENABLE], [
616 Plugins:])
618 AC_SDB_PLUGIN([cname-dns], [yes],
619 [canonicalize hostnames by querying DNS])
620 AC_SDB_PLUGIN([syslog], [yes],
621 [plugin logging to syslog])
623 AM_CONDITIONAL([BUILD_DOCUMENTATION], test "x$build_documentation" = "xyes")
624 AM_CONDITIONAL([UNIT_TESTING], test "x$unit_tests" = "xyes")
626 AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile
627 src/liboconfig/Makefile t/Makefile])
628 AC_OUTPUT
630 BUILD_DATE="`date --utc '+%F %T'` (UTC)"
632 AC_MSG_RESULT()
633 AC_MSG_RESULT([$PACKAGE_NAME has been configured successfully.])
634 AC_MSG_RESULT()
635 AC_MSG_RESULT([Run 'make' to compile the software and use 'make install' to])
636 AC_MSG_RESULT([install the package into $prefix.])
637 AC_MSG_RESULT()
638 AC_MSG_RESULT([Configuration summary:])
639 AC_MSG_RESULT()
640 AC_MSG_RESULT([ package version: $PACKAGE_VERSION])
641 AC_MSG_RESULT([ build date: $BUILD_DATE])
642 AC_MSG_RESULT()
643 AC_MSG_RESULT([ Tools:])
644 AC_MSG_RESULT([ AsciiDoc: . . . . . . . . . $have_asciidoc])
645 AC_MSG_RESULT([ xmlto: . . . . . . . . . . $have_xmlto])
646 AC_MSG_RESULT()
647 AC_MSG_RESULT([ Features:])
648 AC_MSG_RESULT([ documentation: . . . . . . $build_documentation])
649 AC_MSG_RESULT([ unit testing: . . . . . . . $unit_tests])
650 AC_MSG_RESULT([ stdio mocking: . . . . . $have_fopencookie])
651 AC_MSG_RESULT([ coverage testing: . . . . . $enable_gcov])
652 AC_MSG_RESULT([ integration testing: . . . $integration_tests])
653 AC_MSG_RESULT([ profiling: . . . . . . . . $enable_gprof])
654 AC_MSG_RESULT()
655 AC_MSG_RESULT([ Libraries:])
656 AC_MSG_RESULT([ libdbi: . . . . . . . . . . $with_libdbi])
657 AC_MSG_RESULT([ libedit: . . . . . . . . . $have_libedit])
658 AC_MSG_RESULT([ libreadline: . . . . . . . $have_libreadline])
659 AC_MSG_RESULT([ librrd: . . . . . . . . . . $have_librrd])
660 AC_MSG_RESULT()
661 AC_MSG_RESULT([ Backends:])
662 AC_MSG_RESULT([ collectd::unixsock: . . . . $enable_collectd_unixsock])
663 AC_MSG_RESULT([ facter . . . . . . . . . . $enable_facter])
664 AC_MSG_RESULT([ mk-livestatus: . . . . . . $enable_mk_livestatus])
665 AC_MSG_RESULT([ puppet::storeconfigs: . . . $enable_puppet_storeconfigs])
666 AC_MSG_RESULT()
667 AC_MSG_RESULT([ Time-series fetchers:])
668 AC_MSG_RESULT([ rrdtool: . . . . . . . . . $enable_timeseries_rrdtool])
669 AC_MSG_RESULT()
670 AC_MSG_RESULT([ Plugins:])
671 AC_MSG_RESULT([ cname::dns: . . . . . . . . $enable_cname_dns])
672 AC_MSG_RESULT([ syslog: . . . . . . . . . . $enable_syslog])
673 AC_MSG_RESULT()
674 AC_MSG_RESULT([This package is maintained by $PACKAGE_MAINTAINER.])
675 AC_MSG_RESULT([Please report bugs to $PACKAGE_BUGREPORT.])
676 AC_MSG_RESULT()
678 dnl vim: set tw=78 sw=4 ts=4 noexpandtab :