Code

Merge branch 'collectd-4.7' collectd-4.7.0
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 9 May 2009 10:59:50 +0000 (12:59 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 9 May 2009 10:59:50 +0000 (12:59 +0200)
1  2 
configure.in
src/Makefile.am

diff --combined configure.in
index 07a4e2986b4b79d0f9f49409fbee219acadbb41a,287a9e569bc011adf5d6462feee220aaceb5cd95..1d9ef9394f4a4cb20d1729fe82d01f4715645004
@@@ -94,8 -94,9 +94,9 @@@ AM_CONDITIONAL(BUILD_FEATURE_STANDARDS
  AC_HEADER_STDC
  AC_HEADER_SYS_WAIT
  AC_HEADER_DIRENT
+ AC_HEADER_STDBOOL
  
- AC_CHECK_HEADERS(stdio.h stdint.h stdbool.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)
+ AC_CHECK_HEADERS(stdio.h stdint.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)
  
  # For ping library
  AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
@@@ -264,7 -265,7 +265,7 @@@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSource
  
  # For the swap module
  have_sys_swap_h="yes"
- AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
+ AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
  [
  #if HAVE_SYS_TYPES_H
  #  include <sys/types.h>
  
  if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
  then
-       AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
+       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
@@@ -813,7 -821,6 +821,6 @@@ if test "x$have_getmntent" = "xc"; the
                [c_cv_have_one_getmntent],
                AC_COMPILE_IFELSE(
                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
- #include <mntent.h>
  #include "$srcdir/src/utils_mount.h"]],
                                [[
                                 FILE *fh;
                [c_cv_have_two_getmntent],
                AC_COMPILE_IFELSE(
                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
- #include <sys/mnttab.h>
  #include "$srcdir/src/utils_mount.h"]],
                                [[
                                 FILE *fh;
        AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
                [with_libgcrypt="yes"],
                [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
+       if test "$with_libgcrypt" != "no"; then
+               AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
+       fi
  fi
  
  CPPFLAGS="$SAVE_CPPFLAGS"
                 [with_libmysql="yes"],
                 [with_libmysql="no (symbol 'mysql_init' not found)"],
                 [$with_mysql_libs])
+               AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
+                [with_libmysql="yes"],
+                [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
+                [$with_mysql_libs])
        fi
  fi
  if test "x$with_libmysql" = "xyes"
@@@ -2904,57 -2919,6 +2919,57 @@@ AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with
  AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
  # }}}
  
 +# --with-libyajl {{{
 +with_libyajl_cppflags=""
 +with_libyajl_ldflags=""
 +AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
 +[
 +      if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +      then
 +              with_libyajl_cppflags="-I$withval/include"
 +              with_libyajl_ldflags="-L$withval/lib"
 +              with_libyajl="yes"
 +      else
 +              with_libyajl="$withval"
 +      fi
 +],
 +[
 +      with_libyajl="yes"
 +])
 +if test "x$with_libyajl" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
 +
 +      AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_libyajl" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
 +      LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
 +
 +      AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +fi
 +if test "x$with_libyajl" = "xyes"
 +then
 +      BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
 +      BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
 +      BUILD_WITH_LIBYAJL_LIBS="-lyajl"
 +      AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
 +      AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
 +# }}}
 +
  # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
  with_libxml2="no (pkg-config isn't available)"
  with_libxml2_cflags=""
@@@ -3271,7 -3235,6 +3286,7 @@@ plugin_ascent="no
  plugin_battery="no"
  plugin_bind="no"
  plugin_conntrack="no"
 +plugin_couchdb="no"
  plugin_cpu="no"
  plugin_cpufreq="no"
  plugin_df="no"
        plugin_ipmi="yes"
  fi
  
 +if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
 +then
 +      plugin_couchdb="yes"
 +fi
 +
  if test "x$have_processor_info" = "xyes"
  then
        plugin_cpu="yes"
        plugin_tcpconns="yes"
  fi
  
- if test "x$have_statfs" = "xyes"
+ # Df plugin: Check if we know how to determine mount points first.
+ #if test "x$have_listmntent" = "xyes"; then
+ #     plugin_df="yes"
+ #fi
+ if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
+ then
+       plugin_df="yes"
+ fi
+ if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
  then
        plugin_df="yes"
  fi
- if test "x$have_statvfs" = "xyes"
+ #if test "x$have_getmntent" = "xseq"
+ #then
+ #     plugin_df="yes"
+ #fi
+ if test "x$c_cv_have_one_getmntent" = "xyes"
  then
        plugin_df="yes"
  fi
  
+ # Df plugin: Check if we have either `statfs' or `statvfs' second.
+ if test "x$plugin_df" = "xyes"
+ then
+       plugin_df="no"
+       if test "x$have_statfs" = "xyes"
+       then
+               plugin_df="yes"
+       fi
+       if test "x$have_statvfs" = "xyes"
+       then
+               plugin_df="yes"
+       fi
+ fi
  if test "x$have_getifaddrs" = "xyes"
  then
        plugin_interface="yes"
@@@ -3497,7 -3481,6 +3538,7 @@@ AC_PLUGIN([ascent],      [$plugin_ascen
  AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
  AC_PLUGIN([bind],        [$plugin_bind],       [ISC Bind nameserver statistics])
  AC_PLUGIN([conntrack],   [$plugin_conntrack],  [nf_conntrack statistics])
 +AC_PLUGIN([couchdb],     [$plugin_couchdb],    [CouchDB statistics])
  AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
  AC_PLUGIN([cpu],         [$plugin_cpu],        [CPU usage statistics])
  AC_PLUGIN([csv],         [yes],                [CSV output plugin])
@@@ -3782,7 -3765,6 +3823,7 @@@ Configuration
      battery . . . . . . . $enable_battery
      bind  . . . . . . . . $enable_bind
      conntrack . . . . . . $enable_conntrack
 +    couchdb . . . . . . . $enable_couchdb
      cpu . . . . . . . . . $enable_cpu
      cpufreq . . . . . . . $enable_cpufreq
      csv . . . . . . . . . $enable_csv
diff --combined src/Makefile.am
index 04dec41dc5f9055d479e2fc442405d7b728e46d6,55ab2ca79e8095c6a9e2741b5c6038da012ebcc3..8b5fa5463f6ad69f5cd6e63520ec493900a091a7
@@@ -38,7 -38,6 +38,6 @@@ collectd_SOURCES = collectd.c collectd.
                   utils_parse_option.c utils_parse_option.h \
                   utils_tail_match.c utils_tail_match.h \
                   utils_match.c utils_match.h \
-                  utils_mount.c utils_mount.h \
                   utils_subst.c utils_subst.h \
                   utils_tail.c utils_tail.h \
                   utils_threshold.c utils_threshold.h \
@@@ -174,21 -173,6 +173,21 @@@ collectd_LDADD += "-dlopen" conntrack.l
  collectd_DEPENDENCIES += conntrack.la
  endif
  
 +if BUILD_PLUGIN_COUCHDB
 +pkglib_LTLIBRARIES += couchdb.la
 +couchdb_la_SOURCES = couchdb.c
 +couchdb_la_CFLAGS = $(AM_CFLAGS)
 +couchdb_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +couchdb_la_CPPFLAGS = $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +couchdb_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
 +if BUILD_WITH_LIBCURL
 +couchdb_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 +couchdb_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 +endif
 +collectd_LDADD += "-dlopen" couchdb.la
 +collectd_DEPENDENCIES += couchdb.la
 +endif
 +
  if BUILD_PLUGIN_CPU
  pkglib_LTLIBRARIES += cpu.la
  cpu_la_SOURCES = cpu.c
@@@ -252,7 -236,7 +251,7 @@@ endi
  
  if BUILD_PLUGIN_DF
  pkglib_LTLIBRARIES += df.la
- df_la_SOURCES = df.c
+ df_la_SOURCES = df.c utils_mount.c utils_mount.h
  df_la_LDFLAGS = -module -avoid-version
  collectd_LDADD += "-dlopen" df.la
  collectd_DEPENDENCIES += df.la