From 00ff99d8769ede67a8aefbb2836c1f832dbcab65 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 18 Sep 2007 20:51:38 +0200 Subject: [PATCH] build system: Fixed the improved detection of the Net-SNMP library. --- configure.in | 6 +++--- src/Makefile.am | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 16ffe1ad..51f26c3f 100644 --- a/configure.in +++ b/configure.in @@ -1250,7 +1250,7 @@ AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Pat [with_libnetsnmp="yes"]) if test "x$with_libnetsnmp" = "xyes" then - with_snmp_cflags=`$with_snmp_config --cflags >/dev/null` + with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null` snmp_config_status=$? if test $snmp_config_status -ne 0 @@ -1267,7 +1267,7 @@ then fi if test "x$with_libnetsnmp" = "xyes" then - with_snmp_libs=`$with_snmp_config --libs >/dev/null` + with_snmp_libs=`$with_snmp_config --libs 2>/dev/null` snmp_config_status=$? if test $snmp_config_status -ne 0 @@ -1280,7 +1280,7 @@ then [$with_snmp_libs]) fi fi -if test "x$with_libsnmp" = "xyes" +if test "x$with_libnetsnmp" = "xyes" then BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags" BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs" diff --git a/src/Makefile.am b/src/Makefile.am index 16094f7e..f988a0f0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -466,11 +466,14 @@ if BUILD_PLUGIN_SNMP pkglib_LTLIBRARIES += snmp.la snmp_la_SOURCES = snmp.c snmp_la_LDFLAGS = -module -avoid-version +snmp_la_CFLAGS = +snmp_la_LIBADD = if BUILD_WITH_LIBNETSNMP -snmp_la_LDFLAGS += -lnetsnmp +snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS) +snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS) endif if BUILD_WITH_LIBPTHREAD -snmp_la_LDFLAGS += -lpthread +snmp_la_LIBADD += -lpthread endif collectd_LDADD += "-dlopen" snmp.la collectd_DEPENDENCIES += snmp.la -- 2.30.2