collectd additional packages:])
# AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
+librrd_cflags=""
+librrd_ldflags=""
+librrd_threadsafe="yes"
AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
[ if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- CPPFLAGS="$CPPFLAGS -I$withval/include"
+ librrd_cflags="-I$withval/include"
+ librrd_ldflags="-L$withval/lib"
with_rrdtool="yes"
fi
], [with_rrdtool="yes"])
if test "x$with_rrdtool" = "xyes"
then
- AC_CHECK_LIB(rrd, rrd_update,
- [
- AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
- ],
- [with_rrdtool="no (librrd not found)"], [-lm])
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+
+ CPPFLAGS="$CPPFLAGS $librrd_cflags"
+ LDFLAGS="$LDFLAGS $librrd_ldflags"
+
+ AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
fi
if test "x$with_rrdtool" = "xyes"
then
- AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+
+ CPPFLAGS="$CPPFLAGS $librrd_cflags"
+ LDFLAGS="$LDFLAGS $librrd_ldflags"
+
+ AC_CHECK_LIB(rrd_th, rrd_update_r,
+ [with_rrdtool="yes"
+ librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
+ ],
+ [librrd_threadsafe="no"
+ AC_CHECK_LIB(rrd, rrd_update,
+ [with_rrdtool="yes"
+ librrd_ldflags="$librrd_ldflags -lrrd -lm"
+ ],
+ [with_rrdtool="no (symbol 'rrd_update' not found)"],
+ [-lm])
+ ]
+ [-lm])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
fi
if test "x$with_rrdtool" = "xyes"
then
- collect_rrdtool=1
-else
- collect_rrdtool=0
+ BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
+ BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
+ AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
+fi
+if test "x$librrd_threadsafe" = "xyes"
+then
+ AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
fi
-AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
- [Wether or not to use rrdtool library])
-AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
[ if test "x$withval" != "xno" -a "x$withval" != "xyes"
if test "x$withval" = "xno"
then
with_libnetsnmp="no"
- else if "x$withval" = "xyes"
+ else if test "x$withval" = "xyes"
then
with_libnetsnmp="yes"
else
perl . . . . . . . $enable_perl
ping . . . . . . . $enable_ping
processes . . . . . $enable_processes
+ rrdtool . . . . . . $enable_rrdtool
sensors . . . . . . $enable_sensors
serial . . . . . . $enable_serial
snmp . . . . . . . $enable_snmp