X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=configure.ac;h=e648f6484a70426114f0e3782be1ec8db365250c;hb=3e14c965e9c8036cb85fcc1898c9acc82f6f0b15;hp=461f24c14a9409a2111a146e4e8727f731d98c86;hpb=cedb6f147e94d0e952449f731313412ef4d67904;p=collectd.git diff --git a/configure.ac b/configure.ac index 461f24c1..e648f648 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,11 @@ AC_CONFIG_SRCDIR(src/) AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_AUX_DIR([libltdl/config]) +dnl older automake's default of ARFLAGS=cru is noisy on newer binutils; +dnl we don't really need the 'u' even in older toolchains. Then there is +dnl older libtool, which spelled it AR_FLAGS +m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"]) + m4_ifdef([LT_PACKAGE_VERSION], # libtool >= 2.2 [ @@ -24,6 +29,8 @@ m4_ifdef([LT_PACKAGE_VERSION], ] ) +AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"]) + AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_LANG(C) @@ -90,12 +97,12 @@ case $host_os in esac AC_MSG_RESULT([$ac_system]) -AM_CONDITIONAL([BUILD_LINUX],[test "x$x$ac_system" = "xLinux"]) -AM_CONDITIONAL([BUILD_SOLARIS],[test "x$x$ac_system" = "xSolaris"]) -AM_CONDITIONAL([BUILD_DARWIN],[test "x$x$ac_system" = "xDarwin"]) -AM_CONDITIONAL([BUILD_OPENBSD],[test "x$x$ac_system" = "xOpenBSD"]) -AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"]) -AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"]) +AM_CONDITIONAL([BUILD_LINUX],[test "x$ac_system" = "xLinux"]) +AM_CONDITIONAL([BUILD_SOLARIS],[test "x$ac_system" = "xSolaris"]) +AM_CONDITIONAL([BUILD_DARWIN],[test "x$ac_system" = "xDarwin"]) +AM_CONDITIONAL([BUILD_OPENBSD],[test "x$ac_system" = "xOpenBSD"]) +AM_CONDITIONAL([BUILD_AIX],[test "x$ac_system" = "xAIX"]) +AM_CONDITIONAL([BUILD_FREEBSD],[test "x$ac_system" = "xFreeBSD"]) if test "x$ac_system" = "xLinux" then @@ -113,7 +120,20 @@ if test "x$ac_system" = "xSolaris" then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.]) AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.]) + + AC_MSG_CHECKING([whether compiler builds 64bit binaries]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #ifndef _LP64 + # error "Compiler not in 64bit mode." + #endif + ])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.]) + ]) 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.]) @@ -285,7 +305,32 @@ AC_CHECK_HEADERS(netinet/udp.h, [], [], #endif ]) -AC_CHECK_TYPES([struct ip6_ext], [], [], +have_ip6_ext="no" +AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP6_H +# include +#endif +]) + +if test "x$have_ip6_ext" = "xno"; then + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -DSOLARIS2=8" + + AC_CHECK_TYPES([struct ip6_ext], + [have_ip6_ext="yes, with -DSOLARIS2=8"], + [have_ip6_ext="no"], [#if HAVE_STDINT_H # include #endif @@ -303,6 +348,11 @@ AC_CHECK_TYPES([struct ip6_ext], [], [], #endif ]) + if test "x$have_ip6_ext" = "xno"; then + CFLAGS="$SAVE_CFLAGS" + fi +fi + # For cpu modules AC_CHECK_HEADERS(sys/dkstat.h) if test "x$ac_system" = "xDarwin" @@ -394,18 +444,6 @@ AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"], #endif ]) -if test "x$have_sys_swap_h$ac_system" = "xnoSolaris" -then - hint_64="" - if test "x$GCC" = "xyes" - then - hint_64="CFLAGS='-m64'" - else - hint_64="CFLAGS='-xarch=v9'" - fi - AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).]) -fi - # For load module # For the processes plugin # For users module @@ -601,6 +639,9 @@ AC_CHECK_HEADERS(net/pfvar.h, #if HAVE_NET_IF_H # include #endif +#if HAVE_NETINET_IN_H +# include +#endif ]) # For the multimeter plugin @@ -613,14 +654,14 @@ AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"]) if test "x$have_asm_msrindex_h" = "xyes" then - AC_CACHE_CHECK([whether asm/msr-index.h has MSR_CORE_C3_RESIDENCY], + AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY], [c_cv_have_usable_asm_msrindex_h], AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[[ #include ]]], [[[ -int y = MSR_CORE_C3_RESIDENCY; +int y = MSR_PKG_C10_RESIDENCY; return(y); ]]] )], @@ -1884,30 +1925,33 @@ AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Pat GANGLIA_LDFLAGS="-L$withval/lib" with_libganglia="yes" else - with_libganglia_config="ganglia-config" with_libganglia="$withval" fi; fi; fi ], [ - with_libganglia_config="ganglia-config" with_libganglia="yes" ]) -if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x" +if test "x$with_libganglia" = "xyes" then - if test "x$GANGLIA_CPPFLAGS" = "x" + if test "x$with_libganglia_config" != "x" then - GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null` - fi + if test "x$GANGLIA_CPPFLAGS" = "x" + then + GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null` + fi - if test "x$GANGLIA_LDFLAGS" = "x" - then - GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null` - fi + if test "x$GANGLIA_LDFLAGS" = "x" + then + GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null` + fi - if test "x$GANGLIA_LIBS" = "x" - then - GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null` + if test "x$GANGLIA_LIBS" = "x" + then + GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null` + fi + else + GANGLIA_LIBS="-lganglia" fi fi @@ -2531,7 +2575,7 @@ then SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags" - AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"]) + AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"]) CPPFLAGS="$SAVE_CPPFLAGS" fi @@ -2622,6 +2666,53 @@ fi AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes") # }}} +# --with-libmosquitto {{{ +with_libmosquitto_cppflags="" +with_libmosquitto_libs="-lmosquitto" +AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + with_libmosquitto_cppflags="-I$withval/include" + with_libmosquitto_libs="-L$withval/lib -lmosquitto" + with_libmosquitto="yes" + else + with_libmosquitto="$withval" + fi +], +[ + with_libmosquitto="yes" +]) +if test "x$with_libmosquitto" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$with_libmosquitto_cppflags" + + AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_libmosquitto" = "xyes" +then + SAVE_LDFLAGS="$LDFLAGS" + SAVE_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$with_libmosquitto_libs" + CPPFLAGS="$with_libmosquitto_cppflags" + + AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"]) + + LDFLAGS="$SAVE_LDFLAGS" + CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_libmosquitto" = "xyes" +then + BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags" + BUILD_WITH_LIBMOSQUITTO_LIBS="$with_libmosquitto_libs" + AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS) +fi +# }}} + # --with-libmysql {{{ with_mysql_config="mysql_config" with_mysql_cflags="" @@ -2650,7 +2741,7 @@ AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to ]) if test "x$with_libmysql" = "xyes" then - with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null` + with_mysql_cflags=`$with_mysql_config --include 2>/dev/null` mysql_config_status=$? if test $mysql_config_status -ne 0 @@ -2686,15 +2777,17 @@ then then with_libmysql="no ($with_mysql_config failed)" else - AC_CHECK_LIB(mysqlclient, mysql_init, - [with_libmysql="yes"], - [with_libmysql="no (symbol 'mysql_init' not found)"], - [$with_mysql_libs]) - - AC_CHECK_LIB(mysqlclient, mysql_get_server_version, + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_mysql_cflags" + SAVE_LIBS="$LIBS" + LIBS="$with_mysql_libs" + AC_SEARCH_LIBS([mysql_get_server_version], + [], [with_libmysql="yes"], [with_libmysql="no (symbol 'mysql_get_server_version' not found)"], - [$with_mysql_libs]) + []) + CPPFLAGS="$SAVE_CPPFLAGS" + LIBS="$SAVE_LIBS" fi fi if test "x$with_libmysql" = "xyes" @@ -3214,11 +3307,6 @@ then fi if test "x$with_libpcap" = "xyes" then - AC_CHECK_HEADERS(pcap-bpf.h,, - [with_libpcap="no (pcap-bpf.h not found)"]) -fi -if test "x$with_libpcap" = "xyes" -then AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP], [c_cv_libpcap_have_pcap_error_iface_not_up], AC_COMPILE_IFELSE([AC_LANG_PROGRAM( @@ -4760,11 +4848,11 @@ then CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags" - AC_CHECK_HEADERS(varnish/vapi/vsc.h, + AC_CHECK_HEADERS(vapi/vsc.h, [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])], - [AC_CHECK_HEADERS(varnish/vsc.h, + [AC_CHECK_HEADERS(vsc.h, [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])], - [AC_CHECK_HEADERS(varnish/varnishapi.h, + [AC_CHECK_HEADERS(varnishapi.h, [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])], [with_libvarnish="no (found none of the varnish header files)"])])]) @@ -5163,6 +5251,7 @@ collectd features:]) AC_COLLECTD([debug], [enable], [feature], [debugging]) AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) +AC_COLLECTD([werror], [disable], [feature], [building with -Werror]) dependency_warning="no" dependency_error="no" @@ -5184,6 +5273,7 @@ plugin_disk="no" plugin_drbd="no" plugin_entropy="no" plugin_ethstat="no" +plugin_fhcount="no" plugin_fscache="no" plugin_interface="no" plugin_ipmi="no" @@ -5212,6 +5302,7 @@ plugin_vmem="no" plugin_vserver="no" plugin_wireless="no" plugin_zfs_arc="no" +plugin_zone="no" plugin_zookeeper="no" # Linux @@ -5226,6 +5317,7 @@ then plugin_disk="yes" plugin_drbd="yes" plugin_entropy="yes" + plugin_fhcount="yes" plugin_fscache="yes" plugin_interface="yes" plugin_ipc="yes" @@ -5273,15 +5365,16 @@ fi if test "x$ac_system" = "xAIX" then - plugin_tcpconns="yes" - plugin_ipc="yes" + plugin_tcpconns="yes" + plugin_ipc="yes" fi # FreeBSD if test "x$ac_system" = "xFreeBSD" then - plugin_zfs_arc="yes" + plugin_disk="yes" + plugin_zfs_arc="yes" fi @@ -5309,6 +5402,7 @@ then plugin_processes="yes" plugin_uptime="yes" plugin_zfs_arc="yes" + plugin_zone="yes" fi if test "x$with_devinfo$with_kstat" = "xyesyes" @@ -5569,7 +5663,7 @@ AC_PLUGIN([email], [yes], [EMail statistics]) AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver]) AC_PLUGIN([exec], [yes], [Execution of external programs]) -AC_PLUGIN([fhcount], [yes], [File handles statistics]) +AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics]) AC_PLUGIN([filecount], [yes], [Count files in directories]) AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics]) AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin]) @@ -5599,6 +5693,7 @@ AC_PLUGIN([memcached], [yes], [memcached statistics]) AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats]) AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin]) +AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin]) AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin]) @@ -5608,6 +5703,7 @@ AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics]) AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics]) AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications]) AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier]) +AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin]) AC_PLUGIN([ntpd], [yes], [NTPd statistics]) AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics]) AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics]) @@ -5674,6 +5770,7 @@ AC_PLUGIN([write_sensu], [yes], [Sensu output plugin]) AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin]) AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics]) AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics]) +AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics]) AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics]) dnl Default configuration file @@ -5825,6 +5922,13 @@ AC_SUBST(LCC_VERSION_STRING) AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h) +AM_CFLAGS="-Wall" +if test "x$enable_werror" != "xno" +then + AM_CFLAGS="$AM_CFLAGS -Werror" +fi +AC_SUBST([AM_CFLAGS]) + AC_CONFIG_FILES([Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile]) AC_OUTPUT @@ -5855,6 +5959,17 @@ fi cat <