summaryrefslogtreecommitdiff
path: root/ext/snmp/config.m4
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-05-23 23:46:38 +0000
committerSascha Schumann <sas@php.net>2000-05-23 23:46:38 +0000
commit0f54988877da541da89fea4c3478e7753c804363 (patch)
tree8272372ddbd4e8c36ec47e6fdd3c0230499eeb61 /ext/snmp/config.m4
parentd348a83a72cb53994a38d4d6f9992d6391d8fb4c (diff)
downloadphp-git-0f54988877da541da89fea4c3478e7753c804363.tar.gz
Convert config.m4 to make use of the new build system features
Diffstat (limited to 'ext/snmp/config.m4')
-rw-r--r--ext/snmp/config.m476
1 files changed, 19 insertions, 57 deletions
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4
index c1d35fc4e7..92f464c4de 100644
--- a/ext/snmp/config.m4
+++ b/ext/snmp/config.m4
@@ -1,11 +1,7 @@
-dnl $Id$
-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 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[
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 @@ AC_ARG_WITH(snmp,
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 @@ main() { exit(USE_OPENSSL != 1); }
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)