<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16649">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_snmp: As build tool, prefer pkg-config over net-snmp-config.<br><br>ASTERISK-29709<br><br>Change-Id: Ie169df878bdfc3a06b3097c5c38d185b480f54d4<br>---<br>M configure<br>M configure.ac<br>2 files changed, 97 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/49/16649/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure b/configure</span><br><span>index 808865a..833e2ac 100755</span><br><span>--- a/configure</span><br><span>+++ b/configure</span><br><span>@@ -664,6 +664,8 @@</span><br><span> PJPROJECT_CFLAGS</span><br><span> PG_CONFIG</span><br><span> CONFIG_NETSNMP</span><br><span style="color: hsl(120, 100%, 40%);">+NETSNMP_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+NETSNMP_CFLAGS</span><br><span> CONFIG_NEON29</span><br><span> CONFIG_NEON</span><br><span> CONFIG_MYSQLCLIENT</span><br><span>@@ -1451,6 +1453,8 @@</span><br><span> JANSSON_LIBS</span><br><span> ILBC_CFLAGS</span><br><span> ILBC_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+NETSNMP_CFLAGS</span><br><span style="color: hsl(120, 100%, 40%);">+NETSNMP_LIBS</span><br><span> PJPROJECT_CFLAGS</span><br><span> PJPROJECT_LIBS</span><br><span> PYTHONDEV_CFLAGS</span><br><span>@@ -2225,6 +2229,10 @@</span><br><span> linker flags for JANSSON, overriding pkg-config</span><br><span> ILBC_CFLAGS C compiler flags for ILBC, overriding pkg-config</span><br><span> ILBC_LIBS linker flags for ILBC, overriding pkg-config</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_CFLAGS</span><br><span style="color: hsl(120, 100%, 40%);">+ C compiler flags for NETSNMP, overriding pkg-config</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+ linker flags for NETSNMP, overriding pkg-config</span><br><span> PJPROJECT_CFLAGS</span><br><span> C compiler flags for PJPROJECT, overriding pkg-config</span><br><span> PJPROJECT_LIBS</span><br><span>@@ -23036,6 +23044,94 @@</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+pkg_failed=no</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for netsnmp-agent" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for netsnmp-agent... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$NETSNMP_CFLAGS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_NETSNMP_CFLAGS="$NETSNMP_CFLAGS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "netsnmp-agent") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_NETSNMP_CFLAGS=`$PKG_CONFIG --cflags "netsnmp-agent" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+if test -n "$NETSNMP_LIBS"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_NETSNMP_LIBS="$NETSNMP_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+ elif test -n "$PKG_CONFIG"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -n "$PKG_CONFIG" && \</span><br><span style="color: hsl(120, 100%, 40%);">+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ($PKG_CONFIG --exists --print-errors "netsnmp-agent") 2>&5</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_status=$?</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+ test $ac_status = 0; }; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_cv_NETSNMP_LIBS=`$PKG_CONFIG --libs "netsnmp-agent" 2>/dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+ test "x$?" != "x0" && pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=yes</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pkg_failed=untried</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test $pkg_failed = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ _pkg_short_errors_supported=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ if test $_pkg_short_errors_supported = yes; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "netsnmp-agent" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "netsnmp-agent" 2>&1`</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ # Put the nasty error message in config.log where it belongs</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "$NETSNMP_PKG_ERRORS" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_NETSNMP=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+elif test $pkg_failed = untried; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_NETSNMP=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_CFLAGS=$pkg_cv_NETSNMP_CFLAGS</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_LIBS=$pkg_cv_NETSNMP_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "yes" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_NETSNMP=1</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_INCLUDE=$(echo ${NETSNMP_CFLAGS} | $SED -e "s|-std=c99||g")</span><br><span style="color: hsl(120, 100%, 40%);">+ NETSNMP_LIB="$NETSNMP_LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "#define HAVE_NETSNMP 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then</span><br><span> PBX_NETSNMP=0</span><br><span> if test -n "$ac_tool_prefix"; then</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 26bd177..a8955fe 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -2333,6 +2333,7 @@</span><br><span> #error Need libneon >= 0.29.0</span><br><span> #endif])</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+AST_PKG_CONFIG_CHECK(NETSNMP, netsnmp-agent)</span><br><span> AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs],</span><br><span> [#include <net-snmp/net-snmp-config.h></span><br><span> #include <net-snmp/net-snmp-includes.h></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16649">change 16649</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16649"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: Ie169df878bdfc3a06b3097c5c38d185b480f54d4 </div>
<div style="display:none"> Gerrit-Change-Number: 16649 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>