X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=configure.ac;h=6ac2554c8643e908133e03a6eb78f8582ffe0360;hp=0d0d04359ce9f1076bf3f639944fdafec53c29a1;hb=2421812ea47269c50920414a6e3c32448800120f;hpb=68108d7b5688f4db5257a90437e50428a88d594a diff --git a/configure.ac b/configure.ac index 0d0d0435..6ac2554c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)]) -AC_CONFIG_SRCDIR(src/collectd.c) +AC_CONFIG_SRCDIR(src/) AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_AUX_DIR([libltdl/config]) @@ -527,7 +527,7 @@ AC_CHECK_HEADERS(linux/un.h, [], [], #endif ]) -AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h) +AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h locale.h) # For the dns plugin AC_CHECK_HEADERS(arpa/nameser.h) @@ -602,7 +602,7 @@ 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 setenv 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 setlocale) AC_FUNC_STRERROR_R @@ -809,7 +809,9 @@ if test "x$have_swapctl" = "xyes"; then # undef _LARGEFILE64_SOURCE #endif #include +#include #include +#include ]]], [[[ int num = swapctl(0, NULL); @@ -829,7 +831,9 @@ int num = swapctl(0, NULL); # undef _LARGEFILE64_SOURCE #endif #include +#include #include +#include ]]], [[[ int num = swapctl(0, NULL, 0); @@ -1311,7 +1315,7 @@ AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct #include ]) -AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc], +AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize], [ AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1, [Define if struct kinfo_proc exists in the OpenBSD variant.]) @@ -1328,6 +1332,7 @@ AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc], AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], [#define _BSD_SOURCE +#define _DEFAULT_SOURCE #if HAVE_STDINT_H # include #endif @@ -1349,6 +1354,7 @@ AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], ]) AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], [#define _BSD_SOURCE +#define _DEFAULT_SOURCE #if HAVE_STDINT_H # include #endif @@ -1689,6 +1695,10 @@ then [with_libcurl="yes"], [with_libcurl="no (symbol 'curl_easy_init' not found)"], [$with_curl_libs]) + AC_CHECK_DECL(CURLOPT_USERNAME, + [have_curlopt_username="yes"], + [have_curlopt_username="no"], + [[#include ]]) fi fi if test "x$with_libcurl" = "xyes" @@ -1697,6 +1707,11 @@ then BUILD_WITH_LIBCURL_LIBS="$with_curl_libs" AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS) AC_SUBST(BUILD_WITH_LIBCURL_LIBS) + + if test "x$have_curlopt_username" = "xyes" + then + AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.]) + fi fi AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes") # }}} @@ -2232,6 +2247,64 @@ AC_SUBST(JAVA_LIBS) AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes") # }}} +# --with-libldap {{{ +AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])], +[ + if test "x$withval" = "xyes" + then + with_libldap="yes" + else if test "x$withval" = "xno" + then + with_libldap="no" + else + with_libldap="yes" + LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include" + LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib" + fi; fi +], +[with_libldap="yes"]) + +SAVE_CPPFLAGS="$CPPFLAGS" +SAVE_LDFLAGS="$LDFLAGS" + +CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS" +LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS" + +if test "x$with_libldap" = "xyes" +then + if test "x$LIBLDAP_CPPFLAGS" != "x" + then + AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS]) + fi + AC_CHECK_HEADERS(ldap.h, + [with_libldap="yes"], + [with_libldap="no ('ldap.h' not found)"]) +fi +if test "x$with_libldap" = "xyes" +then + if test "x$LIBLDAP_LDFLAGS" != "x" + then + AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS]) + fi + AC_CHECK_LIB(ldap, ldap_initialize, + [with_libldap="yes"], + [with_libldap="no (symbol 'ldap_initialize' not found)"]) + +fi + +CPPFLAGS="$SAVE_CPPFLAGS" +LDFLAGS="$SAVE_LDFLAGS" + +if test "x$with_libldap" = "xyes" +then + BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS" + BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS" + AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS) +fi +AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes") +# }}} + # --with-liblvm2app {{{ with_liblvm2app_cppflags="" with_liblvm2app_ldflags="" @@ -4062,6 +4135,68 @@ then LDFLAGS="$SAVE_LDFLAGS" fi +if test "x$with_libstatgrab" = "xyes" +then + SAVE_CFLAGS="$CFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + + CFLAGS="$CFLAGS $with_libstatgrab_cflags" + LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags" + + AC_CACHE_CHECK([if sg_init() requires an argument], + [c_cv_have_libstatgrab_init_arg], + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +#include +]]], +[[[ + if (sg_init()) return 0; +]]] + )], + [c_cv_have_libstatgrab_init_arg="no"], + [c_cv_have_libstatgrab_init_arg="yes"] + ) + ) + + AC_CACHE_CHECK([if sg_get_user_stats() requires an argument], + [c_cv_have_libstatgrab_get_user_stats_arg], + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +#include +]]], +[[[ + if (sg_get_user_stats()) return 0; +]]] + )], + [c_cv_have_libstatgrab_get_user_stats_arg="no"], + [c_cv_have_libstatgrab_get_user_stats_arg="yes"] + ) + ) + + AC_CACHE_CHECK([if sg_disk_io_stats() uses size_t], + [c_cv_have_libstatgrab_get_disk_io_stats_sizet], + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +#include +]]], +[[[ + sg_disk_io_stats *(*ptr) (size_t *); + ptr = sg_get_disk_io_stats; + if (ptr != NULL) return 0; +]]] + )], + [c_cv_have_libstatgrab_get_disk_io_stats_sizet="yes"], + [c_cv_have_libstatgrab_get_disk_io_stats_sizet="no"] + ) + ) + + CFLAGS="$SAVE_CFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi + AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes") if test "x$with_libstatgrab" = "xyes" then @@ -4070,6 +4205,18 @@ then BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags" AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS) AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS) + if test "x$c_cv_have_libstatgrab_init_arg" = "xyes" + then + AC_DEFINE(HAVE_LIBSTATGRAB_INIT_ARG, 1, [Define to 1 if sg_init does require an argument]) + fi + if test "x$c_cv_have_libstatgrab_get_user_stats_arg" = "xyes" + then + AC_DEFINE(HAVE_LIBSTATGRAB_GET_USER_STATS_ARG, 1, [Define to 1 if sg_get_user_stats does require an argument]) + fi + if test "x$c_cv_have_libstatgrab_get_disk_io_stats_sizet" = "xyes" + then + AC_DEFINE(HAVE_LIBSTATGRAB_GET_DISK_IO_STATS_SIZET, 1, [Define to 1 if sg_get_disk_io_stats does require pointer to size_t as an argument]) + fi fi # }}} @@ -4808,6 +4955,62 @@ then fi # }}} +# --with-libatasmart {{{ +with_libatasmart_cppflags="" +with_libatasmart_ldflags="" +AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + with_libatasmart_cppflags="-I$withval/include" + with_libatasmart_ldflags="-L$withval/lib" + with_libatasmart="yes" + else + with_libatasmart="$withval" + fi +], +[ + if test "x$ac_system" = "xLinux" + then + with_libatasmart="yes" + else + with_libatasmart="no (Linux only library)" + fi +]) +if test "x$with_libatasmart" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags" + + AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_libatasmart" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags" + LDFLAGS="$LDFLAGS $with_libatasmart_ldflags" + + AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi +if test "x$with_libatasmart" = "xyes" +then + BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags" + BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags" + BUILD_WITH_LIBATASMART_LIBS="-latasmart" + AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS) + AC_SUBST(BUILD_WITH_LIBATASMART_LIBS) + AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes") +# }}} + PKG_CHECK_MODULES([LIBNOTIFY], [libnotify], [with_libnotify="yes"], [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then @@ -4963,7 +5166,6 @@ plugin_interface="no" plugin_ipmi="no" plugin_ipvs="no" plugin_irq="no" -plugin_libvirt="no" plugin_load="no" plugin_log_logstash="no" plugin_memory="no" @@ -4979,8 +5181,9 @@ plugin_tape="no" plugin_tcpconns="no" plugin_ted="no" plugin_thermal="no" -plugin_users="no" plugin_uptime="no" +plugin_users="no" +plugin_virt="no" plugin_vmem="no" plugin_vserver="no" plugin_wireless="no" @@ -5205,11 +5408,6 @@ then plugin_interface="yes" fi -if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes" -then - plugin_libvirt="yes" -fi - if test "x$have_getloadavg" = "xyes" then plugin_load="yes" @@ -5250,6 +5448,11 @@ then plugin_processes="yes" fi +if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes" +then + plugin_processes="yes" +fi + if test "x$with_kvm_getswapinfo" = "xyes" then plugin_swap="yes" @@ -5274,6 +5477,12 @@ then plugin_users="yes" fi +if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes" +then + plugin_virt="yes" +fi + + m4_divert_once([HELP_ENABLE], [ collectd plugins:]) @@ -5332,7 +5541,6 @@ AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics]) AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine]) -AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) AC_PLUGIN([load], [$plugin_load], [System load]) AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging]) @@ -5365,6 +5573,7 @@ AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics]) AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics]) AC_PLUGIN([olsrd], [yes], [olsrd statistics]) AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics]) +AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics]) AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics]) AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin]) AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter]) @@ -5384,6 +5593,7 @@ AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin]) AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics]) AC_PLUGIN([serial], [$plugin_serial], [serial port traffic]) AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources]) +AC_PLUGIN([smart], [$with_libatasmart], [SMART statistics]) AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin]) AC_PLUGIN([statsd], [yes], [StatsD plugin]) AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics]) @@ -5408,6 +5618,7 @@ AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics]) AC_PLUGIN([users], [$plugin_users], [User statistics]) AC_PLUGIN([uuid], [yes], [UUID as hostname plugin]) AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics]) +AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics]) AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics]) AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) @@ -5570,7 +5781,7 @@ AC_SUBST(LCC_VERSION_STRING) AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h) -AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile]) +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 if test "x$with_librrd" = "xyes" \ @@ -5603,6 +5814,7 @@ Configuration: Libraries: intel mic . . . . . . $with_mic libaquaero5 . . . . . $with_libaquaero5 + libatasmart . . . . . $with_libatasmart libcurl . . . . . . . $with_libcurl libdbi . . . . . . . $with_libdbi libcredis . . . . . . $with_libcredis @@ -5615,6 +5827,7 @@ Configuration: libjvm . . . . . . . $with_java libkstat . . . . . . $with_kstat libkvm . . . . . . . $with_libkvm + libldap . . . . . . . $with_libldap liblvm2app . . . . . $with_liblvm2app libmemcached . . . . $with_libmemcached libmnl . . . . . . . $with_libmnl @@ -5697,7 +5910,6 @@ Configuration: ipvs . . . . . . . . $enable_ipvs irq . . . . . . . . . $enable_irq java . . . . . . . . $enable_java - libvirt . . . . . . . $enable_libvirt load . . . . . . . . $enable_load logfile . . . . . . . $enable_logfile lpar . . . . . . . . $enable_lpar @@ -5730,6 +5942,7 @@ Configuration: nut . . . . . . . . . $enable_nut olsrd . . . . . . . . $enable_olsrd onewire . . . . . . . $enable_onewire + openldap . . . . . . $enable_openldap openvpn . . . . . . . $enable_openvpn oracle . . . . . . . $enable_oracle perl . . . . . . . . $enable_perl @@ -5748,6 +5961,7 @@ Configuration: sensors . . . . . . . $enable_sensors serial . . . . . . . $enable_serial sigrok . . . . . . . $enable_sigrok + smart . . . . . . . . $enable_smart snmp . . . . . . . . $enable_snmp statsd . . . . . . . $enable_statsd swap . . . . . . . . $enable_swap @@ -5772,6 +5986,7 @@ Configuration: users . . . . . . . . $enable_users uuid . . . . . . . . $enable_uuid varnish . . . . . . . $enable_varnish + virt . . . . . . . . $enable_virt vmem . . . . . . . . $enable_vmem vserver . . . . . . . $enable_vserver wireless . . . . . . $enable_wireless