X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=configure.in;h=88cdb50f17d3549cd48092523dd833a5c22e0c21;hp=32245265b362f66ad8e1ae0ac624eaf408229044;hb=5ec7a37c81d6f64f35b1f35e2f0e3157e83f2718;hpb=593ea76dca367478b92e17f91e663fe7c67b4df9 diff --git a/configure.in b/configure.in index 32245265..88cdb50f 100644 --- a/configure.in +++ b/configure.in @@ -47,6 +47,9 @@ AC_PROG_LEX AC_PROG_YACC PKG_PROG_PKG_CONFIG +AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) +AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes") + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) @@ -88,6 +91,10 @@ if test "x$ac_system" = "xSolaris" then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.]) fi +if test "x$ac_system" = "xAIX" +then + AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.]) +fi # Where to install .pc files. pkgconfigdir="${libdir}/pkgconfig" @@ -115,7 +122,7 @@ AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_HEADER_STDBOOL -AC_CHECK_HEADERS(stdio.h stdint.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) +AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], @@ -477,10 +484,17 @@ AC_HEADER_TIME # Checks for library functions. # AC_PROG_GCC_TRADITIONAL -AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf if_indextoname) +AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname) AC_FUNC_STRERROR_R +SAVE_CFLAGS="$CFLAGS" +# Emulate behavior of src/Makefile.am +if test "x$GCC" = "xyes" +then + CFLAGS="$CFLAGS -Wall -Werror" +fi + AC_CACHE_CHECK([for strtok_r], [c_cv_have_strtok_r_default], AC_LINK_IFELSE( @@ -511,7 +525,6 @@ AC_CACHE_CHECK([for strtok_r], if test "x$c_cv_have_strtok_r_default" = "xno" then - SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_REENTRANT=1" AC_CACHE_CHECK([if strtok_r needs _REENTRANT], @@ -543,6 +556,12 @@ then ) fi +CFLAGS="$SAVE_CFLAGS" +if test "x$c_cv_have_strtok_r_reentrant" = "xyes" +then + CFLAGS="$CFLAGS -D_REENTRANT=1" +fi + AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree) socket_needs_socket="no" @@ -715,6 +734,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -759,6 +781,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -811,6 +836,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -943,12 +971,12 @@ fi AC_MSG_CHECKING([if have htonll defined]) have_htonll="no" - AC_RUN_IFELSE([ + AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include #include -#ifdef HAVE_INTTYPES_H -#include +#if HAVE_INTTYPES_H +# include #endif ], [ return htonll(0); @@ -2528,19 +2556,13 @@ then fi if test "x$with_libpcap" = "xyes" then - AC_CHECK_HEADERS(pcap.h, - [ - AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the header file.]) - ], [with_libpcap="no (pcap.h not found)"]) + AC_CHECK_HEADERS(pcap.h,, + [with_libpcap="no (pcap.h not found)"]) fi if test "x$with_libpcap" = "xyes" then - collect_libpcap=1 -else - collect_libpcap=0 + AC_CHECK_HEADERS(pcap-bpf.h) fi -AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap], - [Wether or not to use the pcap library]) AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") # }}} @@ -3363,7 +3385,7 @@ AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes") with_libupsclient_config="" with_libupsclient_cflags="" with_libupsclient_libs="" -AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])], +AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])], [ if test "x$withval" = "xno" then @@ -3585,6 +3607,7 @@ then CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags" AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"]) + AC_CHECK_HEADERS(yajl/yajl_version.h) CPPFLAGS="$SAVE_CPPFLAGS" fi @@ -4006,7 +4029,7 @@ then plugin_vserver="yes" plugin_wireless="yes" - if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes" + if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes" then plugin_ipvs="yes" fi @@ -4295,6 +4318,8 @@ AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics]) AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics]) AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin]) AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter]) +# FIXME: Check for libevent, too. +AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics]) AC_PLUGIN([ping], [$with_liboping], [Network latency statistics]) AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics]) AC_PLUGIN([powerdns], [yes], [PowerDNS statistics]) @@ -4474,7 +4499,7 @@ then with_librrd="yes (warning: librrd is not thread-safe)" fi -if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes" +if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes" then with_libiptc="yes (shipped version)" fi @@ -4536,6 +4561,8 @@ Configuration: libxml2 . . . . . . . $with_libxml2 libxmms . . . . . . . $with_libxmms libyajl . . . . . . . $with_libyajl + libevent . . . . . . $with_libevent + protobuf-c . . . . . $have_protoc_c oracle . . . . . . . $with_oracle python . . . . . . . $with_python @@ -4608,6 +4635,7 @@ Configuration: openvpn . . . . . . . $enable_openvpn oracle . . . . . . . $enable_oracle perl . . . . . . . . $enable_perl + pinba . . . . . . . . $enable_pinba ping . . . . . . . . $enable_ping postgresql . . . . . $enable_postgresql powerdns . . . . . . $enable_powerdns