X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=configure.ac;h=770bd51b30f2b77bac03425a477927f656fd0e99;hb=385cb003c97cbe9f3fe7720c78108570ef3950f9;hp=257818d91e9125ef7059c25e31cc4376bea8188b;hpb=57dfc4722bb1c4d7f735c71aa113b9f6bbdce964;p=collectd.git diff --git a/configure.ac b/configure.ac index 257818d9..770bd51b 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AC_SYS_LARGEFILE # AC_PROG_CC AC_PROG_CPP +AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -54,8 +55,24 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_LEX AC_PROG_YACC + +# Warn when pkg.m4 is missing +m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) + PKG_PROG_PKG_CONFIG +AC_CACHE_CHECK([if bison is the parser generator], + [collectd_cv_prog_bison], + [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '], + [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no] + )] +) + +if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c" +then + AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison]) +fi + AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) if test "x$have_protoc_c" = "xno" then @@ -95,6 +112,10 @@ case $host_os in AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel]) ac_system="OpenBSD" ;; + *netbsd*) + AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel]) + ac_system="NetBSD" + ;; *aix*) AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) ac_system="AIX" @@ -182,6 +203,19 @@ AC_HEADER_STDBOOL 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 fnmatch.h libgen.h) +# For entropy plugin on newer NetBSD +AC_CHECK_HEADERS(sys/rndio.h, [], [], +[#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) + # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H @@ -409,6 +443,22 @@ else AC_MSG_RESULT([no]) fi +AC_MSG_CHECKING([for sysctl kern.cp_time]) +if test -x /sbin/sysctl +then + /sbin/sysctl kern.cp_time >/dev/null 2>&1 + if test $? -eq 0 + then + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1, + [Define if sysctl supports kern.cp_time]) + else + AC_MSG_RESULT([no]) + fi +else + AC_MSG_RESULT([no]) +fi + # For hddtemp module AC_CHECK_HEADERS(linux/major.h) @@ -427,7 +477,7 @@ else have_linux_raid_md_u_h="no" fi -# For the swap module +# For the wireless module have_linux_wireless_h="no" if test "x$ac_system" = "xLinux" then @@ -594,7 +644,35 @@ 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 sys/vmmeter.h kvm.h wordexp.h locale.h) +AC_CHECK_HEADERS([ \ + ctype.h \ + fs_info.h \ + fshelp.h \ + grp.h \ + kvm.h \ + limits.h \ + locale.h \ + mntent.h \ + mnttab.h \ + paths.h \ + pwd.h \ + sys/fs_types.h \ + sys/fstyp.h \ + sys/mntent.h \ + sys/mnttab.h \ + sys/statfs.h \ + sys/statvfs.h \ + sys/un.h \ + sys/vfs.h \ + sys/vfstab.h \ + sys/vmmeter.h \ + wordexp.h \ +]) + +AC_CHECK_HEADERS([xfs/xqm.h], [], [], +[ +#define _GNU_SOURCE +]) # For the dns plugin AC_CHECK_HEADERS(arpa/nameser.h) @@ -688,13 +766,9 @@ AC_CHECK_HEADERS(sys/capability.h) # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST -AC_C_INLINE -AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T AC_TYPE_UID_T -AC_TYPE_UINT32_T AC_HEADER_TIME # @@ -804,8 +878,6 @@ fi if test "x$have_clock_gettime" = "xyes" then AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.]) -else - AC_MSG_WARN(cannot find clock_gettime) fi nanosleep_needs_rt="no" @@ -1433,6 +1505,24 @@ AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize], #include ]) + +AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss], + [ + AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1, + [Define if struct kinfo_proc2 exists in the NetBSD variant.]) + have_struct_kinfo_proc2_netbsd="yes" + ], + [ + have_struct_kinfo_proc2_netbsd="no" + ], + [ +#include +#include +#include + ]) + + + AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], [#define _BSD_SOURCE #define _DEFAULT_SOURCE @@ -2372,7 +2462,7 @@ then AC_CHECK_LIB(jvm, JNI_CreateJavaVM, [with_java="yes"], [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"], - [$JAVA_LIBS]) + [$JAVA_LIBS $PTHREAD_LIBS]) fi if test "x$with_java" = "xyes" then @@ -2455,17 +2545,25 @@ with_liblvm2app_cppflags="" with_liblvm2app_ldflags="" AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])], [ - if test "x$withval" != "xno" && test "x$withval" != "xyes" - then - with_liblvm2app_cppflags="-I$withval/include" - with_liblvm2app_ldflags="-L$withval/lib" - with_liblvm2app="yes" - else - with_liblvm2app="$withval" + if test "x$withval" = "xno" + then + with_liblvm2app="no" + else + with_liblvm2app="yes" + if test "x$withval" != "xyes" + then + with_liblvm2app_cppflags="-I$withval/include" + with_liblvm2app_ldflags="-L$withval/lib" + fi fi ], [ - with_liblvm2app="yes" + if test "x$ac_system" = "xLinux" + then + with_liblvm2app="yes" + else + with_liblvm2app="no (Linux only library)" + fi ]) if test "x$with_liblvm2app" = "xyes" then @@ -4301,6 +4399,7 @@ fi if test "x$with_libstatgrab" = "xyes" then SAVE_CFLAGS="$CFLAGS" + SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CFLAGS="$CFLAGS $with_libstatgrab_cflags" @@ -5312,9 +5411,9 @@ plugin_zookeeper="no" if test "x$ac_system" = "xLinux" then plugin_battery="yes" + plugin_cgroups="yes" plugin_conntrack="yes" plugin_contextswitch="yes" - plugin_cgroups="yes" plugin_cpu="yes" plugin_cpufreq="yes" plugin_disk="yes" @@ -5357,6 +5456,14 @@ then plugin_tcpconns="yes" fi +if test "x$ac_system" = "xNetBSD" +then + plugin_disk="yes" + plugin_entropy="yes" + plugin_irq="yes" + plugin_processes="yes" +fi + # Mac OS X devices if test "x$with_libiokit" = "xyes" then @@ -5368,8 +5475,8 @@ fi if test "x$ac_system" = "xAIX" then - plugin_tcpconns="yes" plugin_ipc="yes" + plugin_tcpconns="yes" fi # FreeBSD @@ -5383,13 +5490,13 @@ fi if test "x$with_perfstat" = "xyes" then - plugin_cpu="yes" plugin_contextswitch="yes" + plugin_cpu="yes" plugin_disk="yes" - plugin_memory="yes" - plugin_swap="yes" plugin_interface="yes" plugin_load="yes" + plugin_memory="yes" + plugin_swap="yes" plugin_uptime="yes" fi @@ -5603,6 +5710,11 @@ then plugin_swap="yes" fi +if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes" +then + plugin_swap="yes" +fi + if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes" then plugin_tcpconns="yes" @@ -5654,20 +5766,20 @@ AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C]) AC_PLUGIN([battery], [$plugin_battery], [Battery statistics]) AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics]) AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics]) +AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting]) AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics]) AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics]) -AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics]) AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics]) +AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics]) AC_PLUGIN([csv], [yes], [CSV output plugin]) AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics]) AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics]) AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics]) -AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting]) AC_PLUGIN([dbi], [$with_libdbi], [General database statistics]) AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) -AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics]) AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis]) +AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics]) AC_PLUGIN([email], [yes], [EMail statistics]) AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver]) @@ -5685,8 +5797,8 @@ 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([load], [$plugin_load], [System load]) -AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging]) +AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics]) AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics]) AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])