From: <d_p...@us...> - 2010-01-05 11:23:51
|
Revision: 2165 http://ganglia.svn.sourceforge.net/ganglia/?rev=2165&view=rev Author: d_pocock Date: 2010-01-05 11:23:44 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Make the name_match feature (and requirement for pcre) optional Modified Paths: -------------- trunk/monitor-core/configure.in trunk/monitor-core/gmond/gmond.c trunk/monitor-core/lib/libgmond.c Modified: trunk/monitor-core/configure.in =================================================================== --- trunk/monitor-core/configure.in 2010-01-05 06:15:12 UTC (rev 2164) +++ trunk/monitor-core/configure.in 2010-01-05 11:23:44 UTC (rev 2165) @@ -188,8 +188,9 @@ [if test x"$withval" != xno; then libconfuse="yes"; libconfusepath="$withval"; fi]) AC_ARG_WITH( libpcre, -[ --with-libpcre=DIR Specify location for libpcre], -[if test x"$withval" != xno; then libpcre="yes"; libpcrepath="$withval"; fi]) +[ --with-libpcre=DIR Specify location for libpcre], +[if test x"$withval" != xno; then libpcre="yes"; libpcrepath="$withval"; fi], +[libpcre=yes; libpcrepath=yes ]) AC_ARG_WITH( moduledir, [ --with-moduledir=DIR Base directory for dynamically loadable modules], @@ -434,12 +435,16 @@ echo "Added -I$libpcrepath/include to CFLAGS" echo "Added -L$libpcrepath/${LIB_SUFFIX} to LDFLAGS" fi -AC_CHECK_LIB(pcre, pcre_compile) -if test x"$ac_cv_lib_pcre_pcre_compile" = xyes; then - echo "Found a suitable pcre library" +if test x"$libpcre" == xyes ; then + AC_CHECK_LIB(pcre, pcre_compile) + if test x"$ac_cv_lib_pcre_pcre_compile" = xyes; then + echo "Found a suitable pcre library" + else + echo "libpcre not found, specify --with-libpcre=no to build without PCRE support" + exit; + fi else - echo "libpcre not found" - exit; + echo "building without PCRE support" fi echo Modified: trunk/monitor-core/gmond/gmond.c =================================================================== --- trunk/monitor-core/gmond/gmond.c 2010-01-05 06:15:12 UTC (rev 2164) +++ trunk/monitor-core/gmond/gmond.c 2010-01-05 11:23:44 UTC (rev 2165) @@ -29,7 +29,9 @@ #include <apr_dso.h> #include <apr_version.h> +#ifdef HAVE_LIBPCRE #include <pcre.h> +#endif #include "cmdline.h" /* generated by cmdline.sh which runs gengetopt */ #include "become_a_nobody.h" @@ -2181,6 +2183,7 @@ { cfg_t *metric = cfg_getnsec( group_conf, "metric", j ); char *name = cfg_getstr ( metric, "name"); +#ifdef HAVE_LIBPCRE char *name_match = cfg_getstr ( metric, "name_match"); if(name_match != NULL) @@ -2309,6 +2312,7 @@ } else +#endif { Ganglia_metric_callback *metric_cb = (Ganglia_metric_callback *) apr_hash_get( metric_callbacks, name, APR_HASH_KEY_STRING ); Modified: trunk/monitor-core/lib/libgmond.c =================================================================== --- trunk/monitor-core/lib/libgmond.c 2010-01-05 06:15:12 UTC (rev 2164) +++ trunk/monitor-core/lib/libgmond.c 2010-01-05 11:23:44 UTC (rev 2165) @@ -115,7 +115,9 @@ static cfg_opt_t metric_opts[] = { CFG_STR("name", NULL, CFGF_NONE ), +#ifdef HAVE_LIBPCRE CFG_STR("name_match", NULL, CFGF_NONE ), +#endif CFG_FLOAT("value_threshold", -1, CFGF_NONE), CFG_STR("title", NULL, CFGF_NONE ), CFG_END() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |