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