X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=configure.in;h=d02c12f6370d128cde079b6b4ff23ac3c2ac1152;hb=4320ac5ec142c87bcf634cd85b89eadea65011ff;hp=01c6b952ef2b7bfe715e5378f7ed5c9e251aaac4;hpb=12c1e32ec71ffd5d90af5df4b430fba04d91aed5;p=collectd.git diff --git a/configure.in b/configure.in index 01c6b952..d02c12f6 100644 --- a/configure.in +++ b/configure.in @@ -30,6 +30,24 @@ AC_PROG_LEX AC_PROG_YACC AC_CONFIG_SUBDIRS(libltdl) +AC_MSG_CHECKING([for kernel type ($host_os)]) +case $host_os in + *linux*) + AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel]) + ac_system="Linux" + ;; + *solaris*) + AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel]) + ac_system="Solaris" + ;; + *darwin*) + ac_system="Darwin" + ;; + *) + ac_system="unknown" +esac +AC_MSG_RESULT([$ac_system]) + # # Checks for header files. # @@ -174,7 +192,12 @@ AC_CHECK_HEADERS(netinet/udp.h, [], [], ]) # For cpu modules -AC_CHECK_HEADERS(sys/dkstat.h mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h) +AC_CHECK_HEADERS(sys/dkstat.h) +if test "x$ac_system" = "xDarwin" +then + AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h) + AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h) +fi AC_CHECK_HEADERS(sys/sysctl.h, [], [], [ #if HAVE_SYS_TYPES_H @@ -188,9 +211,6 @@ AC_CHECK_HEADERS(sys/sysctl.h, [], [], # For hddtemp module AC_CHECK_HEADERS(linux/major.h libgen.h) -# For the apple_sensors module -AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h) - # For the battery plugin AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], [ @@ -281,7 +301,7 @@ AC_CHECK_HEADERS(linux/un.h, [], [], #endif ]) -AC_CHECK_HEADERS(curl/curl.h pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.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) +AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.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) # For the dns plugin AC_CHECK_HEADERS(arpa/nameser.h) @@ -345,6 +365,8 @@ AC_HEADER_TIME AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog) +AC_FUNC_STRERROR_R + AC_CHECK_FUNCS(getpwnam_r) AC_CHECK_FUNCS(getgrnam_r) @@ -635,21 +657,6 @@ AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, ks #endif ]) -AC_MSG_CHECKING([for kernel type ($host_os)]) -case $host_os in - *linux*) - AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel]) - ac_system="Linux" - ;; - *solaris*) - AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel]) - ac_system="Solaris" - ;; - *) - ac_system="unknown" -esac -AC_MSG_RESULT([$ac_system]) - with_libresolv="yes" AC_CHECK_LIB(resolv, res_search, [ @@ -724,7 +731,7 @@ AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], [Wether or not to use pthread (POSIX threads) library]) AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") -if test "$ac_system" = "Solaris" +if test "x$ac_system" = "xSolaris" then with_kstat="yes" with_devinfo="yes" @@ -899,7 +906,7 @@ AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Pat then with_lm_sensors="yes" else - with_lm_sensors="no" + with_lm_sensors="no (Linux only library)" fi ]) if test "x$with_lm_sensors" = "xyes" @@ -1389,6 +1396,66 @@ AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you ha AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes") ### END of check for libxmms ### +with_libnetlink_cflags="" +with_libnetlink_libs="-lnetlink" +AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])], +[ + echo "libnetlink: withval = $withval" + if test "x$withval" = "xyes" + then + with_libnetlink="yes" + else if test "x$withval" = "xno" + then + with_libnetlink="no" + else + if test -d "$withval/include" + then + with_libnetlink_cflags="-I$withval/include" + with_libnetlink_libs="-L$withval/lib -lnetlink" + with_libnetlink="yes" + else + AC_MSG_ERROR("no such directory: $withval/include") + fi + fi; fi +], +[ + if test "x$ac_system" = "xLinux" + then + with_libnetlink="yes" + else + with_libnetlink="no (Linux only library)" + fi +]) +if test "x$with_libnetlink" = "xyes" +then + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $with_libnetlink_cflags" + + AC_CHECK_HEADERS(iproute/libnetlink.h, [], [with_libnetlink="no (iproute/libnetlink.h not found)"], +[#include +#include +#include +#include +#include ]) + + CFLAGS="$SAVE_CFLAGS" +fi +if test "x$with_libnetlink" = "xyes" +then + AC_CHECK_LIB(netlink, rtnl_open, + [with_libnetlink="yes"], + [with_libnetlink="no (symbol 'rtnl_open' not found)"], + [$with_libnetlink_libs]) +fi +if test "x$with_libnetlink" = "xyes" +then + BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags" + BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs" + AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS) + AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS) +fi +AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes") + # Check for enabled/disabled features # @@ -1646,6 +1713,7 @@ AC_PLUGIN([mbmon], [yes], [Query mbmond]) AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) +AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics]) AC_PLUGIN([network], [yes], [Network communication plugin]) AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics]) AC_PLUGIN([ntpd], [yes], [NTPd statistics]) @@ -1690,6 +1758,7 @@ Configuration: libkstat . . . . . $with_kstat libkvm . . . . . . $with_libkvm libmysql . . . . . $with_libmysql + libnetlink . . . . $with_libnetlink libnetsnmp . . . . $with_libnetsnmp liboconfig . . . . $with_liboconfig liboping . . . . . $with_liboping @@ -1730,6 +1799,7 @@ Configuration: memory . . . . . . $enable_memory multimeter . . . . $enable_multimeter mysql . . . . . . . $enable_mysql + netlink . . . . . . $enable_netlink network . . . . . . $enable_network nfs . . . . . . . . $enable_nfs ntpd . . . . . . . $enable_ntpd