summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7231b1d)
raw | patch | inline | side by side (parent: 7231b1d)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 13 Jun 2007 21:13:07 +0000 (23:13 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 13 Jun 2007 21:13:07 +0000 (23:13 +0200) |
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history |
diff --git a/configure.in b/configure.in
index d012420122d9b633de66fff1dd1e8926b92a4b89..0b8299dd7f72d69094057364cd8d399cbc0016f1 100644 (file)
--- a/configure.in
+++ b/configure.in
fi
AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
+AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ with_libnetsnmp="yes"
+ fi
+],
+[with_libnetsnmp="yes"])
+if test "x$with_libnetsnmp" = "xyes"
+then
+ AC_CHECK_LIB(netsnmp, init_snmp,
+ [
+ AC_DEFINE(HAVE_LIBSNMP, 1, [Define to 1 if you have the Net-SNMP library (-lnetsnmp).])
+ ], [with_libnetsnmp="no (libnetsnmp not found)"])
+fi
+if test "x$with_libnetsnmp" = "xyes"
+then
+ AC_CHECK_HEADERS(net-snmp/net-snmp-config.h,
+ [
+ AC_DEFINE(HAVE_NET_SNMP_NET_SNMP_CONFIG_H, 1, [Define to 1 if you have the <net-snmp/net-snmp-config.h> header file.])
+ ], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
+
AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
[
if test "x$withval" != "xno" && test "x$withval" != "xyes"
libiptc . . . . . . $with_libiptc
libkstat . . . . . $with_kstat
libmysql . . . . . $with_libmysql
+ libnetsnmp . . . . $with_libnetsnmp
liboconfig . . . . $with_liboconfig
liboping . . . . . $with_liboping
libpcap . . . . . . $with_libpcap
diff --git a/src/Makefile.am b/src/Makefile.am
index f7168a99e874eba59c4f965beabb3fedcf4a8d0a..6642aa0f1979f6ade72436d06e8dce2df8f165b8 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if BUILD_MODULE_SNMP
pkglib_LTLIBRARIES += snmp.la
snmp_la_SOURCES = snmp.c
-snmp_la_LDFLAGS = -module -avoid-version -lsnmp
+snmp_la_LDFLAGS = -module -avoid-version
+if BUILD_WITH_LIBNETSNMP
+snmp_la_LDFLAGS += -lnetsnmp
+endif
collectd_LDADD += "-dlopen" snmp.la
collectd_DEPENDENCIES += snmp.la
endif