4 AC_DEFUN([lldp_CHECK_SNMP], [
5 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
6 if test x"$NETSNMP_CONFIG" = x"no"; then
7 AC_MSG_ERROR([*** unable to find net-snmp-config])
9 NETSNMP_LIBS=`${NETSNMP_CONFIG} --agent-libs`
10 NETSNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags` -DNETSNMP_NO_INLINE"
14 CFLAGS="$CFLAGS ${NETSNMP_CFLAGS}"
15 LIBS="$LIBS ${NETSNMP_LIBS}"
16 AC_MSG_CHECKING([whether C compiler supports flag "${NETSNMP_CFLAGS} ${NETSNMP_LIBS}" from Net-SNMP])
17 AC_LINK_IFELSE([AC_LANG_PROGRAM([
24 ])],[AC_MSG_RESULT(yes)],[
26 AC_MSG_ERROR([*** incorrect CFLAGS from net-snmp-config])])
28 AC_CHECK_LIB([netsnmp], [snmp_register_callback], [:],
29 [AC_MSG_ERROR([*** unable to use net-snmp])], ${NETSNMP_LIBS})
30 # Do we have subagent support?
31 AC_CHECK_FUNCS([netsnmp_enable_subagent], [:],
32 [AC_MSG_ERROR([*** no subagent support in net-snmp])])
34 AC_SUBST([NETSNMP_LIBS])
35 AC_SUBST([NETSNMP_CFLAGS])
36 AC_DEFINE_UNQUOTED([USE_SNMP], 1, [Define to indicate to enable SNMP support])
38 # Should we use f_create_from_tstring_new or f_create_from_tstring?
39 AC_CHECK_MEMBERS([netsnmp_tdomain.f_create_from_tstring_new],,,
41 @%:@include <net-snmp/net-snmp-config.h>
42 @%:@include <net-snmp/net-snmp-includes.h>
43 @%:@include <net-snmp/library/snmp_transport.h>
45 # Do we have a usable <net-snmp/agent/util_funcs.h> header?
46 AC_CHECK_HEADERS([net-snmp/agent/util_funcs.h],,,[
47 @%:@include <net-snmp/net-snmp-config.h>
48 @%:@include <net-snmp/net-snmp-includes.h>
49 @%:@include <net-snmp/library/snmp_transport.h>
50 @%:@include <net-snmp/agent/net-snmp-agent-includes.h>
51 @%:@include <net-snmp/agent/snmp_vars.h>