Code

build system: Fixed the improved detection of the Net-SNMP library.
authorFlorian Forster <octo@crystal.wlan.home.verplant.org>
Tue, 18 Sep 2007 18:51:38 +0000 (20:51 +0200)
committerFlorian Forster <octo@crystal.wlan.home.verplant.org>
Tue, 18 Sep 2007 18:51:38 +0000 (20:51 +0200)
configure.in
src/Makefile.am

index 16ffe1ad71d433eb7aa939a4d3a155adccace7db..51f26c3f40ccd4753ff0182850676d2004dc57dc 100644 (file)
@@ -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"
index 16094f7e3f904a52cc407f3696c093165a18e088..f988a0f0f30649ba154db4878c1bc3ce06905a0e 100644 (file)
@@ -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