]> git.ipfire.org Git - thirdparty/pdns.git/blame - m4/pdns_with_net_snmp.m4
rec: ensure correct service user on debian
[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`])
d73bc006 13 AC_CHECK_PROG([NET_SNMP_LIBS], [net-snmp-config], [`net-snmp-config --netsnmp-agent-libs`])
1418de01
RG
14 AC_CHECK_DECLS([snmp_select_info2], [
15 AC_DEFINE([HAVE_SNMP_SELECT_INFO2], [1], [define to 1 if snmp_select_info2 is available.])
16 ],
17 [ : ],
0e663c3b
RG
18 [AC_INCLUDES_DEFAULT
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>
25 ])
9f4eb5cc
RG
26 ])
27 ])
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])
31 ])
32 ])
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.])])
35])