summaryrefslogtreecommitdiff
path: root/ext/snmp
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-08-20 14:04:48 +0000
committerfoobar <sniper@php.net>2001-08-20 14:04:48 +0000
commitabeb4bd2e5a7d0697f9275ba894ba56ad40cfa21 (patch)
tree626319c361b3b5a902833d3be16d82407d111e2f /ext/snmp
parent929424032e6718dc756db65729e57e5c09ccf27a (diff)
downloadphp-git-abeb4bd2e5a7d0697f9275ba894ba56ad40cfa21.tar.gz
Cleaning. And made the check for SSL support in SNMP to really work.
Diffstat (limited to 'ext/snmp')
-rw-r--r--ext/snmp/Makefile.in2
-rw-r--r--ext/snmp/config.m448
2 files changed, 27 insertions, 23 deletions
diff --git a/ext/snmp/Makefile.in b/ext/snmp/Makefile.in
index ef21e5e3e9..efd1ce6f33 100644
--- a/ext/snmp/Makefile.in
+++ b/ext/snmp/Makefile.in
@@ -4,6 +4,4 @@ LTLIBRARY_SOURCES = snmp.c
LTLIBRARY_SHARED_NAME = snmp.la
LTLIBRARY_SHARED_LIBADD = $(SNMP_SHARED_LIBADD)
-EXTRA_INCLUDES = $(SNMP_INCLUDE)
-
include $(top_srcdir)/build/dynlib.mk
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4
index 11bacf9dd9..2075e3e11f 100644
--- a/ext/snmp/config.m4
+++ b/ext/snmp/config.m4
@@ -10,6 +10,7 @@ PHP_ARG_WITH(snmp,for SNMP support,
to build as a dl and still specify DIR.])
if test "$PHP_SNMP" != "no"; then
+
if test "$PHP_SNMP" = "yes"; then
for i in /usr/include /usr/local/include; do
test -f $i/snmp.h && SNMP_INCDIR=$i
@@ -22,7 +23,7 @@ PHP_ARG_WITH(snmp,for SNMP support,
done
else
SNMP_INCDIR=$PHP_SNMP/include
- test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$withval/include/ucd-snmp
+ test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp
SNMP_LIBDIR=$PHP_SNMP/lib
fi
@@ -32,41 +33,46 @@ PHP_ARG_WITH(snmp,for SNMP support,
AC_MSG_ERROR(libsnmp not found. Check your SNMP installation.)
fi
- AC_DEFINE(HAVE_SNMP,1,[ ])
- PHP_ADD_INCLUDE($SNMP_INCDIR)
- PHP_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD)
-
old_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$INCLUDES $CPPFLAGS"
+ CPPFLAGS=-I$SNMP_INCDIR
AC_CHECK_HEADERS(default_store.h)
if test "$ac_cv_header_default_store_h" = "yes"; then
- dnl UCD SNMP 4.1.x
- AC_TRY_RUN([
-#include <ucd-snmp-config.h>
-main() { exit(USE_OPENSSL != 1); }
+ AC_MSG_CHECKING(for OpenSSL support in SNMP libraries)
+ AC_EGREP_CPP(yes,[
+ #include <ucd-snmp-config.h>
+ #if USE_OPENSSL
+ yes
+ #endif
],[
SNMP_SSL=yes
],[
SNMP_SSL=no
- ],[
- SNMP_SSL=no
])
+ fi
+ CPPFLAGS=$old_CPPFLAGS
+ AC_MSG_RESULT($SNMP_SSL)
+
+ if test "$SNMP_SSL" = "yes"; then
+ if test "$PHP_OPENSSL" != "no"; then
+ PHP_ADD_LIBRARY(ssl, 1, SNMP_SHARED_LIBADD)
+ PHP_ADD_LIBRARY(crypto,1, SNMP_SHARED_LIBADD)
+ else
+ AC_MSG_ERROR(The UCD-SNMP in this system is build with SSL support.
- if test "$SNMP_SSL" = "yes"; then
- PHP_SETUP_OPENSSL
+ Add --with-openssl<=DIR> to your configure line.)
fi
fi
- CPPFLAGS=$old_CPPFLAGS
- PHP_EXTENSION(snmp,$ext_shared)
- PHP_SUBST(SNMP_SHARED_LIBADD)
-
AC_CHECK_LIB(kstat, kstat_read, [ PHP_ADD_LIBRARY(kstat,,SNMP_SHARED_LIBADD) ])
- SNMP_INCLUDE=-I$SNMP_INCDIR
+
+ AC_DEFINE(HAVE_SNMP,1,[ ])
+ PHP_ADD_INCLUDE($SNMP_INCDIR)
+ PHP_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD)
+
+ PHP_EXTENSION(snmp, $ext_shared)
+ PHP_SUBST(SNMP_SHARED_LIBADD)
fi
-PHP_SUBST(SNMP_LIBDIR)
-PHP_SUBST(SNMP_INCLUDE)
AC_MSG_CHECKING(whether to enable UCD SNMP hack)
AC_ARG_ENABLE(ucd-snmp-hack,