X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=91d13e801a9ed0449c2153d434fdd80769ccabae;hb=0a814175d5d4cebd2f2433603a7eba7cac496c0c;hp=27a6ec482bf1bc131b1d6500bf6e4ca36da24294;hpb=3268a333e4f316d8b744e366df2d58781eabd2e7;p=collectd.git diff --git a/configure.in b/configure.in index 27a6ec48..91d13e80 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.11.2) +AC_INIT(collectd, 4.0.0-rc3) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) @@ -50,6 +50,7 @@ AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(kstat.h) # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], @@ -323,9 +324,29 @@ AC_CHECK_HEADERS(regex.h) # For the dns plugin AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h) -AC_CHECK_HEADERS(net/if_arp.h) +AC_CHECK_HEADERS(net/if_arp.h, [], [], +[#if HAVE_SYS_SOCKET_H +# include +#endif +]) AC_CHECK_HEADERS(net/if_ppp.h) -AC_CHECK_HEADERS(netinet/if_ether.h) +AC_CHECK_HEADERS(netinet/if_ether.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +]) # For the multimeter plugin AC_CHECK_HEADERS(termios.h) @@ -453,6 +474,9 @@ if test "x$nan_type" = "xnone"; then [[ #include #include +#ifdef NAN +# undef NAN +#endif #define NAN (0.0 / 0.0) #ifndef isnan # define isnan(f) ((f) != (f)) @@ -625,6 +649,15 @@ AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], #endif ]) +AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime], + [], + [], + [ +#if HAVE_KSTAT_H +# include +#endif + ]) + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) @@ -734,12 +767,9 @@ then fi if test "x$with_kstat" = "xyes" then - collect_kstat=1 -else - collect_kstat=0 + AC_DEFINE(HAVE_LIBKSTAT, 1, + [Define to 1 if you have the 'kstat' library (-lkstat)]) fi -AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat], - [Wether or not to use kstat library (Solaris)]) AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") @@ -1043,6 +1073,57 @@ 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") +AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libperl="yes" + fi +], +[ + with_libperl="yes" +]) +if test "x$with_libperl" = "xyes" +then + SAVE_CFLAGS=$CFLAGS + SAVE_LDFLAGS=$LDFLAGS + CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`" + LDFLAGS="$LDFLAGS `perl -MExtUtils::Embed -e ldopts`" + + AC_CACHE_CHECK([for libperl], + [have_libperl], + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [[ +#include +#include +#include + ]], + [[ + PerlInterpreter *perl = NULL; + Perl_load_module (perl, PERL_LOADMOD_NOIMPORT, + Perl_newSVpvf (perl, "Collectd::Plugin::%s", "foo"), + Nullsv); + ]]), + [have_libperl="yes"], + [have_libperl="no"] + ) + ) + + if test "x$have_libperl" = "xyes" + then + AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.]) + else + with_libperl="no" + fi + + CFLAGS=$SAVE_CFLAGS + LDFLAGS=$SAVE_LDFLAGS +fi +AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes") + AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], [ if test "x$withval" != "xno" && test "x$withval" != "xyes" @@ -1082,41 +1163,33 @@ else fi AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") -# Define `step' and `hearbeat' values.. -declare -i collectd_step=10 -declare -i collectd_heartbeat=25 -AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])], +AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])], [ - if test "x$withval" != "xno" -a "x$withval" != "xyes" + if test "x$withval" != "xno" && test "x$withval" != "xyes" then - declare -i tmp_collectd_step="$withval" - if test $tmp_collectd_step -gt 0 - then - collectd_step=$tmp_collectd_step - let "collectd_heartbeat=$collectd_step*2" - fi + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libupsclient="yes" fi -], []) -AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])], +], [ - if test "x$withval" != "xno" -a "x$withval" != "xyes" - then - declare -i tmp_collectd_heartbeat="$withval" - if test $tmp_collectd_heartbeat -gt 0 - then - collectd_heartbeat=$tmp_collectd_heartbeat - fi - fi -], []) - -if test $collectd_step -ne 10 + with_libupsclient="yes" +]) +if test "x$with_libupsclient" = "xyes" then - AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.]) + AC_CHECK_LIB(upsclient, upscli_connect, + [ + AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).]) + ], [with_libupsclient="no (libupsclient not found)"]) fi -if test $collectd_heartbeat -ne 25 +if test "x$with_libupsclient" = "xyes" then - AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.]) + AC_CHECK_HEADERS(upsclient.h, + [ + AC_DEFINE(HAVE_UPSCLIENT_H, 1, [Define to 1 if you have the header file.]) + ], [with_libupsclient="no (upsclient.h not found)"]) fi +AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes") # Check for enabled/disabled features # @@ -1214,6 +1287,8 @@ AC_COLLECTD([mysql], [disable], [module], [mysql statistics]) AC_COLLECTD([network], [disable], [module], [network functionality]) AC_COLLECTD([nfs], [disable], [module], [nfs statistics]) AC_COLLECTD([ntpd], [disable], [module], [ntpd statistics]) +AC_COLLECTD([nut], [disable], [module], [network UPS tools statistics]) +AC_COLLECTD([perl], [disable], [module], [embedded perl interpreter]) AC_COLLECTD([ping], [disable], [module], [ping statistics]) AC_COLLECTD([processes], [disable], [module], [processes statistics]) AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics]) @@ -1229,27 +1304,32 @@ AC_COLLECTD([wireless], [disable], [module], [wireless link statistics]) AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile) +if test "x$with_libperl" != "xyes" +then + enable_perl="no (needs libperl)" +fi + cat <