- #
- # This may require "-lkstat" on Solaris, sigh.
- #
- AC_CHECK_LIB(snmp, sprint_objid,
- SNMP_LIBS=-lsnmp,
- [
- #
- # Throw away the cached "we didn't find it" answer.
- #
- unset ac_cv_lib_snmp_sprint_objid
- AC_CHECK_LIB(snmp, sprint_objid,
- [
- #
- # Throw away the cached "we found it" answer, so that if
- # we rerun "configure", we don't just blow off this check
- # and blithely assume that we don't need "-lkstat".
- #
- # XXX - autoconf really needs a way to test for a given
- # routine in a given library *and* to test whether additional
- # "-L"/"-R"/whatever flags are needed *before* the "-l"
- # flag for the library and to test whether additional libraries
- # are needed after the library *and* to cache all that
- # information.
- #
- unset ac_cv_lib_snmp_sprint_objid
- SNMP_LIBS="-lsnmp -lkstat"
- ],,$SOCKET_LIBS $NSL_LIBS $SSL_LIBS -lkstat
- )
- ], $SOCKET_LIBS $NSL_LIBS $SSL_LIBS
- )
+dnl try net-snmp first
+AC_MSG_CHECKING(whether to use NET-SNMP library if available)
+if test "x$netsnmpconfig" != "xno" ; then
+ AC_MSG_RESULT(yes)
+ dnl get the net-snmp-config binary
+ if test "x$netsnmpconfig" = "xyes" -o "x$netsnmpconfig" = "x" ; then
+ dnl search for it
+ AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config)
+ else
+ NETSNMPCONFIG=$netsnmpconfig
+ if test ! -x $NETSNMPCONFIG ; then
+ AC_MSG_ERROR(Invalid net-snmp-config: $NETSNMPCONFIG)
+ fi
+ fi
+else
+ AC_MSG_RESULT(no)
+fi