1 AC_DEFUN([PDNS_WITH_NET_SNMP], [
2 AC_MSG_CHECKING([if we need to link in Net SNMP])
3 AC_ARG_WITH([net-snmp],
4 AS_HELP_STRING([--with-net-snmp],[enable net snmp support @<:@default=auto@:>@]),
5 [with_net_snmp=$withval],
8 AC_MSG_RESULT([$with_net_snmp])
10 AS_IF([test "x$with_net_snmp" != "xno"], [
11 AS_IF([test "x$with_net_snmp" = "xyes" -o "x$with_net_snmp" = "xauto"], [
12 AC_CHECK_PROG([NET_SNMP_CFLAGS], [net-snmp-config], [`net-snmp-config --cflags`])
13 AC_CHECK_PROG([NET_SNMP_LIBS], [net-snmp-config], [`net-snmp-config --netsnmp-agent-libs`])
14 AC_CHECK_DECLS([snmp_select_info2], [
15 AC_DEFINE([HAVE_SNMP_SELECT_INFO2], [1], [define to 1 if snmp_select_info2 is available.])
19 #include <net-snmp/net-snmp-config.h>
20 #include <net-snmp/definitions.h>
21 #include <net-snmp/types.h>
22 #include <net-snmp/utilities.h>
23 #include <net-snmp/config_api.h>
24 #include <net-snmp/session_api.h>
28 AS_IF([test "x$with_net_snmp" = "xyes"], [
29 AS_IF([test x"$NET_SNMP_LIBS" = "x"], [
30 AC_MSG_ERROR([Net SNMP requested but libraries were not found])
33 AM_CONDITIONAL([HAVE_NET_SNMP], [test x"$NET_SNMP_LIBS" != "x"])
34 AS_IF([test x"$NET_SNMP_LIBS" != "x"], [AC_DEFINE([HAVE_NET_SNMP], [1], [Define if using Net SNMP.])])