]> git.ipfire.org Git - thirdparty/pdns.git/blame - m4/pdns_with_net_snmp.m4
Merge pull request #7653 from pieterlexis/docker-ignore
[thirdparty/pdns.git] / m4 / pdns_with_net_snmp.m4
CommitLineData
9f4eb5cc
RG
1AC_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],
6 [with_net_snmp=auto],
7 )
8 AC_MSG_RESULT([$with_net_snmp])
9
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 --agent-libs`])
0e663c3b
RG
14 AC_CHECK_DECLS([snmp_select_info2], [ : ], [ : ],
15 [AC_INCLUDES_DEFAULT
16 #include <net-snmp/net-snmp-config.h>
17 #include <net-snmp/definitions.h>
18 #include <net-snmp/types.h>
19 #include <net-snmp/utilities.h>
20 #include <net-snmp/config_api.h>
21 #include <net-snmp/session_api.h>
22 ])
9f4eb5cc
RG
23 ])
24 ])
25 AS_IF([test "x$with_net_snmp" = "xyes"], [
26 AS_IF([test x"$NET_SNMP_LIBS" = "x"], [
27 AC_MSG_ERROR([Net SNMP requested but libraries were not found])
28 ])
29 ])
30 AM_CONDITIONAL([HAVE_NET_SNMP], [test x"$NET_SNMP_LIBS" != "x"])
31 AS_IF([test x"$NET_SNMP_LIBS" != "x"], [AC_DEFINE([HAVE_NET_SNMP], [1], [Define if using Net SNMP.])])
32])