2001-07-27 14:26:39 +00:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
2000-05-23 23:46:38 +00:00
|
|
|
|
|
|
|
PHP_ARG_WITH(snmp,for SNMP support,
|
2013-08-06 18:06:09 +00:00
|
|
|
[ --with-snmp[=DIR] Include SNMP support])
|
2000-05-23 23:46:38 +00:00
|
|
|
|
2003-06-24 14:05:26 +00:00
|
|
|
PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP,
|
2005-05-29 23:17:16 +00:00
|
|
|
[ --with-openssl-dir[=DIR] SNMP: openssl install prefix], no, no)
|
2003-06-24 14:05:26 +00:00
|
|
|
|
2002-10-15 00:43:34 +00:00
|
|
|
if test "$PHP_SNMP" != "no"; then
|
|
|
|
|
|
|
|
if test "$PHP_SNMP" = "yes"; then
|
|
|
|
AC_PATH_PROG(SNMP_CONFIG,net-snmp-config,,[/usr/local/bin:$PATH])
|
|
|
|
else
|
|
|
|
SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -x "$SNMP_CONFIG"; then
|
|
|
|
SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs`
|
|
|
|
SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`"
|
|
|
|
SNMP_PREFIX=`$SNMP_CONFIG --prefix`
|
2011-04-06 06:58:25 +00:00
|
|
|
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
|
2002-10-15 00:43:34 +00:00
|
|
|
else
|
2011-04-06 06:58:25 +00:00
|
|
|
AC_MSG_ERROR([Net-SNMP version 5.3 or greater reqired (detected $snmp_full_version).])
|
2002-10-15 00:43:34 +00:00
|
|
|
fi
|
|
|
|
else
|
2011-04-05 12:20:35 +00:00
|
|
|
AC_MSG_ERROR([Could not find net-snmp-config binary. Please check your net-snmp installation.])
|
1999-06-27 21:45:06 +00:00
|
|
|
fi
|
2001-07-27 14:26:39 +00:00
|
|
|
|
2011-04-06 06:58:25 +00:00
|
|
|
dnl Test build.
|
|
|
|
PHP_CHECK_LIBRARY($SNMP_LIBNAME, init_snmp,
|
2003-09-23 08:15:49 +00:00
|
|
|
[
|
2011-04-06 06:58:25 +00:00
|
|
|
AC_DEFINE(HAVE_SNMP,1,[ ])
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more information.])
|
|
|
|
], [
|
2003-09-23 08:15:49 +00:00
|
|
|
$SNMP_SHARED_LIBADD
|
|
|
|
])
|
2002-10-17 06:39:55 +00:00
|
|
|
|
2011-02-17 12:02:16 +00:00
|
|
|
dnl Check whether shutdown_snmp_logging() exists.
|
|
|
|
PHP_CHECK_LIBRARY($SNMP_LIBNAME, shutdown_snmp_logging,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_SHUTDOWN_SNMP_LOGGING, 1, [ ])
|
|
|
|
], [], [
|
|
|
|
$SNMP_SHARED_LIBADD
|
|
|
|
])
|
|
|
|
|
2002-10-15 00:43:34 +00:00
|
|
|
PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared)
|
|
|
|
PHP_SUBST(SNMP_SHARED_LIBADD)
|
|
|
|
fi
|