Changed `configure.in' and `src/Makefile.am' so the plugins are NOT linked against... collectd-3.7.0
authorocto <octo>
Mon, 30 Jan 2006 21:59:13 +0000 (21:59 +0000)
committerocto <octo>
Mon, 30 Jan 2006 21:59:13 +0000 (21:59 +0000)
configure.in
src/Makefile.am

index 3684946..4e9c156 100644 (file)
@@ -187,10 +187,21 @@ case $host_os in
 esac
 AC_MSG_RESULT([$ac_system])
 
-dnl Checks for libraries.
-# FIXME don't link all plugins against these libraries!
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(resolv, res_search)
+with_libsocket="yes"
+AC_CHECK_LIB(socket, socket,
+[
+       AC_DEFINE(HAVE_LIBSOCKET, 1, [Define to 1 if you have the 'socket' library (-lsocket).])
+],
+[with_libsocket="no"])
+AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$with_libsocket" = "xyes")
+
+with_libresolv="yes"
+AC_CHECK_LIB(resolv, res_search,
+[
+       AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
+],
+[with_libresolv="no"])
+AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
 
 m4_divert_once([HELP_WITH], [
 collectd additional packages:])
@@ -206,7 +217,11 @@ AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to r
 ], [with_rrdtool="yes"])
 if test "x$with_rrdtool" = "xyes"
 then
-       AC_CHECK_LIB(rrd, rrd_update,, [with_rrdtool="no (librrd not found)"], [-lm])
+       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])
 fi
 if test "x$with_rrdtool" = "xyes"
 then
index 1669338..73d29b0 100644 (file)
@@ -16,7 +16,6 @@ collectd_SOURCES = collectd.c collectd.h \
                   network.c network.h \
                   plugin.c plugin.h \
                   configfile.c configfile.h
-#collectd_CFLAGS = -DPLUGINDIR='"$(pkglibdir)"'
 collectd_CPPFLAGS = $(LTDLINCL)
 collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
 collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
@@ -27,7 +26,19 @@ collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
 if BUILD_FEATURE_DEBUG
 collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
 endif
+
+# Link to these libraries..
 collectd_LDFLAGS = -export-dynamic
+if BUILD_WITH_RRDTOOL
+collectd_LDFLAGS += -lm -lrrd
+endif
+if BUILD_WITH_LIBSOCKET
+collectd_LDFLAGS += -lsocket
+endif
+if BUILD_WITH_LIBRESOLV
+collectd_LDFLAGS += -lresolv
+endif
+
 collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
 collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la