提交 7bed126f authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #917 in FS/freeswitch from…

Merge pull request #917 in FS/freeswitch from ~SJTHOMASON/freeswitch:bugfix/FS-9386-mod_snmp-needs-lnetsnmphelpers to master

* commit 'a2fd327f':
  FS-9386: [mod_snmp] Use net-snmp-config for SNMP libs if available
......@@ -1705,6 +1705,22 @@ else
AC_MSG_WARN([python support disabled, building mod_python will fail!])
fi
#
# SNMP checks for mod_snmp
#
AC_PATH_PROG([NET_SNMP_CONFIG], [net-snmp-config], [no])
if test "$NET_SNMP_CONFIG" != "no"; then
AC_MSG_CHECKING([for Net-SNMP libraries via net-snmp-config])
SNMP_LIBS="`$NET_SNMP_CONFIG --base-agent-libs`"
else
# net-snmp-config not in path, fallback to sensible defaults
SNMP_LIBS="-lnetsnmpmibs -lnetsnmpagent -lnetsnmp"
fi
# fix linking error on Solaris patched Net-SNMP
AS_CASE([$host], [*-solaris2*], [AC_CHECK_LIB([dladm], [dladm_open], [SNMP_LIBS="$SNMP_LIBS -ldladm"])])
AC_SUBST(SNMP_LIBS)
CHECK_ERLANG
# we never use this, and hard setting it will make cross compile work better
......
......@@ -4,5 +4,5 @@ MODNAME=mod_snmp
mod_LTLIBRARIES = mod_snmp.la
mod_snmp_la_SOURCES = mod_snmp.c subagent.c
mod_snmp_la_CFLAGS = $(AM_CFLAGS)
mod_snmp_la_LIBADD = $(switch_builddir)/libfreeswitch.la -lnetsnmpmibs -lnetsnmpagent -lnetsnmp
mod_snmp_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SNMP_LIBS)
mod_snmp_la_LDFLAGS = -avoid-version -module -no-undefined -shared
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论