cvs: /php4/ext/snmp Makefile.am config.m4 snmp.c
| From: | Gergely Madar�sz | Date: | Fri, 03 Sep 1999 16:04:28 +0000 |
| Subject: | cvs: /php4/ext/snmp Makefile.am config.m4 snmp.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4050@lists.php.net to get a copy of this message | ||
gorgo Fri Sep 3 12:04:28 1999 EDT
Modified files:
/php4/ext/snmp Makefile.am config.m4 snmp.c
Log:
Enabled shared build of snmp module
Index: php4/ext/snmp/Makefile.am
diff -u php4/ext/snmp/Makefile.am:1.1 php4/ext/snmp/Makefile.am:1.2
--- php4/ext/snmp/Makefile.am:1.1 Wed Apr 21 22:48:24 1999
+++ php4/ext/snmp/Makefile.am Fri Sep 3 12:04:28 1999
@@ -1,6 +1,15 @@
-# $Id: Makefile.am,v 1.1 1999/04/22 02:48:24 ssb Exp $
+# $Id: Makefile.am,v 1.2 1999/09/03 16:04:28 gorgo Exp $
-INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
-noinst_LIBRARIES=libphpext_snmp.a
-libphpext_snmp_a_SOURCES=snmp.c
+phplibdir=$(libdir)/php
+SRC=snmp.c
+INCLUDES=@INCLUDES@ @SNMP_INCLUDE@ -I@top_srcdir@ -I@top_srcdir@/libzend
+noinst_LIBRARIES=@SNMP_STATIC@
+EXTRA_LIBRARIES=libphpext_snmp.a
+libphpext_snmp_a_SOURCES=$(SRC)
+phplib_LTLIBRARIES=@SNMP_SHARED@
+EXTRA_LTLIBRARIES=snmp.la
+snmp_la_SOURCES=$(SRC)
+snmp_la_LIBADD=@SNMP_LIBDIR@ -lsnmp @KSTAT_LIBS@
+snmp_la_LDFLAGS=-avoid-version -module -rpath $(phplibdir)
+EXTRA_LIBS=
Index: php4/ext/snmp/config.m4
diff -u php4/ext/snmp/config.m4:1.5 php4/ext/snmp/config.m4:1.6
--- php4/ext/snmp/config.m4:1.5 Wed Jul 21 10:43:12 1999
+++ php4/ext/snmp/config.m4 Fri Sep 3 12:04:28 1999
@@ -1,11 +1,26 @@
-dnl $Id: config.m4,v 1.5 1999/07/21 14:43:12 ssb Exp $
+dnl $Id: config.m4,v 1.6 1999/09/03 16:04:28 gorgo Exp $
AC_MSG_CHECKING(for SNMP support)
AC_ARG_WITH(snmp,
[ --with-snmp[=DIR] Include SNMP support. DIR is the SNMP base
install directory, defaults to searching through
- a number of common locations for the snmp install.],
+ a number of common locations for the snmp install.
+ Set DIR to "shared" to build as a dl, or "shared,DIR"
+ to build as a dl and still specify DIR.],
[
+ case $withval in
+ shared)
+ shared=yes
+ withval=yes
+ ;;
+ shared,*)
+ shared=yes
+ withval=
echo $withval | sed -e 's/^shared,//'
+ ;;
+ *)
+ shared=no
+ ;;
+ esac
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
SNMP_INCDIR=/usr/local/include
@@ -14,23 +29,42 @@
test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
+ test -f /usr/lib/libsnmp.so && SNMP_LIBDIR=/usr/lib
else
SNMP_INCDIR=$withval/include
test -d $withval/include/ucd-snmp && SNMP_INCDIR=$withval/include/ucd-snmp
SNMP_LIBDIR=$withval/lib
fi
AC_DEFINE(HAVE_SNMP)
- AC_MSG_RESULT(yes)
- PHP_EXTENSION(snmp)
- AC_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR)
- AC_ADD_INCLUDE($SNMP_INCDIR)
- AC_CHECK_LIB(kstat, kstat_read, [AC_ADD_LIBRARY(kstat)])
+ if test "$shared" = "yes"; then
+ AC_MSG_RESULT(yes (shared))
+ SNMP_INCLUDE="-I$SNMP_INCDIR"
+ SNMP_SHARED="snmp.la"
+ else
+ AC_MSG_RESULT(yes (static))
+ AC_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR)
+ AC_ADD_INCLUDE($SNMP_INCDIR)
+ SNMP_STATIC="libphpext_snmp.a"
+ fi
+ PHP_EXTENSION(snmp,$shared)
+ AC_CHECK_LIB(kstat, kstat_read, [
+ if test "$shared" = yes; then
+ KSTAT_LIBS="-lkstat"
+ else
+ AC_ADD_LIBRARY(kstat)
+ fi
+ ])
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
+AC_SUBST(SNMP_LIBDIR)
+AC_SUBST(SNMP_INCLUDE)
+AC_SUBST(SNMP_SHARED)
+AC_SUBST(SNMP_STATIC)
+AC_SUBST(KSTAT_LIBS)
AC_MSG_CHECKING(whether to enable UCD SNMP hack)
AC_ARG_ENABLE(ucd-snmp-hack,
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.8 php4/ext/snmp/snmp.c:1.9
--- php4/ext/snmp/snmp.c:1.8 Wed Aug 4 17:12:57 1999
+++ php4/ext/snmp/snmp.c Fri Sep 3 12:04:28 1999
@@ -17,12 +17,15 @@
| Steven Lawrance <slawrance@technologist.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.8 1999/08/04 21:12:57 slawrance Exp $ */
+/* $Id: snmp.c,v 1.9 1999/09/03 16:04:28 gorgo Exp $ */
+#ifdef PIC
+# define COMPILE_DL 1
+#endif
+
#include "php.h"
#if defined(COMPILE_DL)
-#include "phpdl.h"
-#include "functions/dl.h"
+#include "dl/phpdl.h"
#endif
#include "php3_snmp.h"
#include <sys/types.h>