File: pdns_with_net_snmp.m4

package info (click to toggle)
pdns-recursor 4.1.11-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,936 kB
  • sloc: cpp: 54,211; javascript: 26,587; sh: 11,872; makefile: 453; xml: 37
file content (32 lines) | stat: -rw-r--r-- 1,304 bytes parent folder | download | duplicates (2)
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
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=auto@:>@]),
    [with_net_snmp=$withval],
    [with_net_snmp=auto],
  )
  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_CFLAGS], [net-snmp-config], [`net-snmp-config --cflags`])
      AC_CHECK_PROG([NET_SNMP_LIBS], [net-snmp-config], [`net-snmp-config --agent-libs`])
      AC_CHECK_DECLS([snmp_select_info2], [ : ], [ : ],
        [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.])])
])