summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e622ac)
raw | patch | inline | side by side (parent: 3e622ac)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 27 May 2017 11:37:06 +0000 (13:37 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 27 May 2017 11:37:06 +0000 (13:37 +0200) |
Turn it into a separate check, which also makes it possible to disable
it.
snmp_agent and snmp are separate plugins, and on at least Fedora are
packaged separately.
A beneficial side effect is that this reduces overlinking of snmp.so
with libnetsnmpagent.so
it.
snmp_agent and snmp are separate plugins, and on at least Fedora are
packaged separately.
A beneficial side effect is that this reduces overlinking of snmp.so
with libnetsnmpagent.so
Makefile.am | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 37125bc76c31b7efa4cc6dac739dd06fcfb402a4..fa85720f8bd33754917c3bf26419bd31e2a01fb0 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
if BUILD_PLUGIN_SNMP_AGENT
pkglib_LTLIBRARIES += snmp_agent.la
snmp_agent_la_SOURCES = src/snmp_agent.c
-snmp_agent_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
-snmp_agent_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBNETSNMP_LDFLAGS)
-snmp_agent_la_LIBADD = $(BUILD_WITH_LIBNETSNMP_LIBS)
+snmp_agent_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS)
+snmp_agent_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS)
+snmp_agent_la_LIBADD = $(BUILD_WITH_LIBNETSNMPAGENT_LIBS)
endif
if BUILD_PLUGIN_STATSD
diff --git a/configure.ac b/configure.ac
index 1751a93ce949657925b56ddfbc6151f4504efae7..cbad867e21ce839c7490d6002aec216adf63b538 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# }}}
# --with-libnetsnmp {{{
-with_libnetsnmpagent="no"
AC_ARG_WITH([libnetsnmp],
[AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to libnetsnmp.])],
[
with_libnetsnmp_cppflags="-I$withval/include"
with_libnetsnmp_ldflags="-I$withval/lib"
with_libnetsnmp="yes"
- with_libnetsnmpagent="yes"
fi; fi
],
[with_libnetsnmp="yes"]
[with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
)
- AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
- [],
- [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"]
+ AC_CHECK_HEADERS([net-snmp/net-snmp-includes.h],
+ [with_libnetsnmp="yes"],
+ [with_libnetsnmp="no (net-snmp/net-snmp-includes.h not found)"],
+ [[
+ #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
+ # include <net-snmp/net-snmp-config.h>
+ #endif
+ ]]
)
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
AC_CHECK_LIB([netsnmp], [init_snmp],
- [with_libnetsnmp="yes"],
- [with_libnetsnmp="no (libnetsnmp not found)"],
- [$with_snmp_libs]
- )
-
- AC_CHECK_LIB([netsnmpagent], [init_agent],
- [with_libnetsnmpagent="yes"],
- [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
- [$with_snmp_libs]
+ [],
+ [with_libnetsnmp="no (libnetsnmp not found)"]
)
LDFLAGS="$SAVE_LDFLAGS"
BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
fi
-if test "x$with_libnetsnmpagent" = "xyes"; then
- BUILD_WITH_LIBNETSNMP_LIBS+=" -lnetsnmpagent"
-fi
-
AC_SUBST([BUILD_WITH_LIBNETSNMP_CPPFLAGS])
AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS])
AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS])
# }}}
+# --with-libnetsmpagent {{{
+AC_ARG_WITH([libnetsnmpagent],
+ [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])],
+ [
+ if test "x$withval" = "xno"; then
+ with_libnetsnmpagent="no"
+ else if test "x$withval" = "xyes"; then
+ with_libnetsnmpagent="yes"
+ else
+ with_libnetsnmpagent_cppflags="-I$withval/include"
+ with_libnetsnmpagent_ldflags="-I$withval/lib"
+ with_libnetsnmpagent="yes"
+ fi; fi
+ ],
+ [with_libnetsnmpagent="yes"]
+)
+
+if test "x$with_libnetsnmpagent" = "xyes"; then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_libnetsnmpagent_cppflags"
+
+ AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
+ [],
+ [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"],
+ [[
+ #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
+ # include <net-snmp/net-snmp-config.h>
+ #endif
+ #if HAVE_NET_SNMP_NET_SNMP_INCLUDES_H
+ # include <net-snmp/net-snmp-includes.h>
+ #endif
+ ]]
+ )
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+
+if test "x$with_libnetsnmpagent" = "xyes"; then
+ SAVE_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $with_libnetsnmpagent_ldflags"
+
+ AC_CHECK_LIB([netsnmpagent], [init_agent],
+ [],
+ [with_libnetsnmpagent="no (libnetsnmpagent not found)"]
+ )
+
+ LDFLAGS="$SAVE_LDFLAGS"
+fi
+
+if test "x$with_libnetsnmpagent" = "xyes"; then
+ BUILD_WITH_LIBNETSNMPAGENT_LIBS="-lnetsnmpagent"
+fi
+
+AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS])
+AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS])
+AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LIBS])
+# }}}
+
# --with-liboping {{{
AC_ARG_WITH([liboping],
[AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
plugin_protocols="no"
plugin_python="no"
plugin_serial="no"
-plugin_snmp_agent="no"
plugin_smart="no"
plugin_swap="no"
plugin_tape="no"
plugin_swap="yes"
fi
-if test "x$with_libnetsnmp" = "xyes" && test "x$with_libnetsnmpagent" = "xyes"; then
- plugin_snmp_agent="yes"
-fi
-
if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"; then
plugin_swap="yes"
fi
AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
-AC_PLUGIN([snmp_agent], [$plugin_snmp_agent], [SNMP agent plugin])
+AC_PLUGIN([snmp_agent], [$with_libnetsnmpagent], [SNMP agent plugin])
AC_PLUGIN([statsd], [yes], [StatsD plugin])
AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
+AC_MSG_RESULT([ libnetsnmpagent . . . $with_libnetsnmpagent])
AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
AC_MSG_RESULT([ liboping . . . . . . $with_liboping])