From: octo Date: Mon, 30 Jan 2006 21:59:13 +0000 (+0000) Subject: Changed `configure.in' and `src/Makefile.am' so the plugins are NOT linked against... X-Git-Tag: collectd-3.7.0^0 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a58af0518edc0a30aed0ae289c616f824ca62686;p=collectd.git Changed `configure.in' and `src/Makefile.am' so the plugins are NOT linked against `librrd', `libresolv' and/or `libsoket' --- diff --git a/configure.in b/configure.in index 36849468..4e9c1563 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 1669338b..73d29b05 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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