diff options
Diffstat (limited to 'ext/snmp/config.m4')
-rw-r--r-- | ext/snmp/config.m4 | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4 index ea97451100..af53bbf141 100644 --- a/ext/snmp/config.m4 +++ b/ext/snmp/config.m4 @@ -20,23 +20,34 @@ if test "$PHP_SNMP" != "no"; then SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs` SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`" SNMP_PREFIX=`$SNMP_CONFIG --prefix` - - if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then - PHP_ADD_INCLUDE(${SNMP_PREFIX}/include) - PHP_EVAL_LIBLINE($SNMP_LIBS, SNMP_SHARED_LIBADD) - SNMP_LIBNAME=netsnmp + snmp_full_version=`$SNMP_CONFIG --version` + ac_IFS=$IFS + IFS="." + set $snmp_full_version + IFS=$ac_IFS + SNMP_VERSION=`expr [$]1 \* 1000 + [$]2` + if test "$SNMP_VERSION" -ge "5003"; then + if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then + PHP_ADD_INCLUDE(${SNMP_PREFIX}/include) + PHP_EVAL_LIBLINE($SNMP_LIBS, SNMP_SHARED_LIBADD) + SNMP_LIBNAME=netsnmp + else + AC_MSG_ERROR([Could not find the required paths. Please check your net-snmp installation.]) + fi else - AC_MSG_ERROR([Could not find the required paths. Please check your net-snmp installation.]) + AC_MSG_ERROR([Net-SNMP version 5.3 or greater reqired (detected $snmp_full_version).]) fi else AC_MSG_ERROR([Could not find net-snmp-config binary. Please check your net-snmp installation.]) fi - dnl Check whether snmp_parse_oid() exists. - PHP_CHECK_LIBRARY($SNMP_LIBNAME, snmp_parse_oid, + dnl Test build. + PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp, [ - AC_DEFINE(HAVE_SNMP_PARSE_OID, 1, [ ]) - ], [], [ + AC_DEFINE(HAVE_SNMP,1,[ ]) + ], [ + AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more information.]) + ], [ $SNMP_SHARED_LIBADD ]) @@ -48,16 +59,6 @@ if test "$PHP_SNMP" != "no"; then $SNMP_SHARED_LIBADD ]) - dnl Test build. - PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp, - [ - AC_DEFINE(HAVE_SNMP,1,[ ]) - ], [ - AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more information.]) - ], [ - $SNMP_SHARED_LIBADD - ]) - dnl Check for buggy snmp_snprint_value() (net-snmp BUGid 2027834) AC_CACHE_CHECK([for buggy snmp_snprint_value], ac_cv_buggy_snprint_value,[ save_CFLAGS="$CFLAGS" |