cvs: php4 /ext/snmp/ Makefile.in config.m4

[email protected] ("Sascha Schumann")
Newsgroups php.version4
Message-ID <cvssas959125599@cvsserver>
sas		Wed May 24 01:46:39 2000 EDT

  Modified files:
    /php4/ext/snmp	Makefile.in config.m4 
  Log:
  Convert config.m4 to make use of the new build system features
  
  
Index: php4/ext/snmp/Makefile.in
diff -u php4/ext/snmp/Makefile.in:1.10 php4/ext/snmp/Makefile.in:1.11
--- php4/ext/snmp/Makefile.in:1.10	Tue May  2 00:38:32 2000
+++ php4/ext/snmp/Makefile.in	Wed May 24 01:46:38 2000
@@ -1,7 +1,8 @@
 
 LTLIBRARY_NAME    = libsnmp.la
 LTLIBRARY_SOURCES = snmp.c
-LTLIBRARY_SHARED_LIBADD = $(SNMP_LIBDIR) -lsnmp $(KSTAT_LIBS)
+LTLIBRARY_SHARED_NAME = snmp.la
+LTLIBRARY_SHARED_LIBADD = $(SNMP_SHARED_LIBADD)
 
 EXTRA_INCLUDES = $(SNMP_INCLUDE)
 	
Index: php4/ext/snmp/config.m4
diff -u php4/ext/snmp/config.m4:1.13 php4/ext/snmp/config.m4:1.14
--- php4/ext/snmp/config.m4:1.13	Sun Mar 19 13:38:53 2000
+++ php4/ext/snmp/config.m4	Wed May 24 01:46:38 2000
@@ -1,11 +1,7 @@
-dnl $Id: config.m4,v 1.13 2000/03/19 12:38:53 sas Exp $
 
-AC_ARG_WITH(openssl,
-[  --with-openssl[=DIR]    Include OpenSSL support in SNMP.],[
-  PHP_OPENSSL=$withval
-],[
-  PHP_OPENSSL=no
-])
+
+PHP_ARG_WITH(openssl,for OpenSSL support in SNMP,
+[  --with-openssl[=DIR]    Include OpenSSL support in SNMP.])
 
 AC_DEFUN(PHP_SETUP_OPENSSL,[
   for i in /usr/local/ssl /usr/local /usr /usr/local/openssl $PHP_OPENSSL; do
@@ -18,43 +14,25 @@
     fi
   done
 
-  AC_MSG_CHECKING(for OpenSSL)
-
   if test -z "$OPENSSL_DIR"; then
     AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
   fi
-
-  AC_MSG_RESULT($OPENSSL_DIR, Include files in $OPENSSL_INC)
 
-  AC_ADD_LIBPATH($OPENSSL_DIR/lib)
-  AC_ADD_LIBRARY(ssl, yes)
-  AC_ADD_LIBRARY(crypto, yes)
+  AC_ADD_LIBPATH($OPENSSL_DIR/lib, SNMP_SHARED_LIBADD)
+  AC_ADD_LIBRARY(ssl, yes, SNMP_SHARED_LIBADD)
+  AC_ADD_LIBRARY(crypto, yes, SNMP_SHARED_LIBADD)
   AC_ADD_INCLUDE($OPENSSL_INC)
 ])
 
-AC_MSG_CHECKING(for SNMP support)
-AC_ARG_WITH(snmp,
+PHP_ARG_WITH(snmp,for SNMP support,
 [  --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.
                           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
+                          to build as a dl and still specify DIR.])
+
+  if test "$PHP_SNMP" != "no"; then
+    if test "$PHP_SNMP" = "yes"; then
       SNMP_INCDIR=/usr/local/include
       SNMP_LIBDIR=/usr/local/lib
       test -f /usr/local/include/ucd-snmp/snmp.h && SNMP_INCDIR=/usr/local/include/ucd-snmp
@@ -68,21 +46,12 @@
 	  test -f /usr/local/snmp/lib/libsnmp.a && SNMP_LIBDIR=/usr/local/snmp/lib
 	  test -f /usr/local/snmp/lib/libsnmp.so && SNMP_LIBDIR=/usr/local/snmp/lib
     else
-      SNMP_INCDIR=$withval/include
-      test -d $withval/include/ucd-snmp && SNMP_INCDIR=$withval/include/ucd-snmp
-      SNMP_LIBDIR=$withval/lib
+      SNMP_INCDIR=$PHP_SNMP/include
+      test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$withval/include/ucd-snmp
+      SNMP_LIBDIR=$PHP_SNMP/lib
     fi
     AC_DEFINE(HAVE_SNMP,1,[ ])
-    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.la"
-    fi
+    AC_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR, SNMP_SHARED_LIBADD)
 	old_CPPFLAGS="$CPPFLAGS"
 	CPPFLAGS="$INCLUDES $CPPFLAGS"
 	AC_CHECK_HEADERS(default_store.h)
@@ -103,20 +72,13 @@
 		fi
 	fi
 	CPPFLAGS="$old_CPPFLAGS"
-	PHP_EXTENSION(snmp,$shared)
+	PHP_EXTENSION(snmp,$ext_shared)
+	PHP_SUBST(SNMP_SHARED_LIBADD)
 	AC_CHECK_LIB(kstat, kstat_read, [
-	  if test "$shared" = yes; then
-	    KSTAT_LIBS="-lkstat"
-	  else 
-	    AC_ADD_LIBRARY(kstat)
-	  fi
+	  AC_ADD_LIBRARY(kstat,SNMP_SHARED_LIBADD)
         ])
-  else
-    AC_MSG_RESULT(no)
+    SNMP_INCLUDE="-I$SNMP_INCDIR"
   fi
-],[
-  AC_MSG_RESULT(no)
-])
 PHP_SUBST(SNMP_LIBDIR)
 PHP_SUBST(SNMP_INCLUDE)
 PHP_SUBST(KSTAT_LIBS)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.