php-src/ext/snmp/config.m4

81 lines
2.2 KiB
Plaintext
Raw Normal View History

dnl $Id$
AC_MSG_CHECKING(for SNMP support)
AC_ARG_WITH(snmp,
[ --with-snmp[=DIR] Include SNMP support. DIR is the SNMP base
1999-04-23 03:28:47 +00:00
install directory, defaults to searching through
1999-09-03 16:04:28 +00:00
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.],
[
1999-09-03 16:04:28 +00:00
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
SNMP_LIBDIR=/usr/local/lib
1999-04-23 03:28:47 +00:00
test -d /usr/local/include/ucd-snmp && SNMP_INCDIR=/usr/local/include/ucd-snmp
test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
1999-07-21 14:43:12 +00:00
test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
1999-04-23 03:28:47 +00:00
test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
1999-09-03 16:04:28 +00:00
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)
1999-09-03 16:04:28 +00:00
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)
1999-11-01 11:48:31 +00:00
SNMP_STATIC="libphpext_snmp.la"
1999-09-03 16:04:28 +00:00
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
])
1999-06-27 21:45:06 +00:00
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
1999-09-03 16:04:28 +00:00
AC_SUBST(SNMP_LIBDIR)
AC_SUBST(SNMP_INCLUDE)
AC_SUBST(SNMP_SHARED)
AC_SUBST(SNMP_STATIC)
AC_SUBST(KSTAT_LIBS)
1999-06-27 21:45:06 +00:00
AC_MSG_CHECKING(whether to enable UCD SNMP hack)
AC_ARG_ENABLE(ucd-snmp-hack,
[ --enable-ucd-snmp-hack Enable UCD SNMP hack],[
if test "$enableval" = "yes" ; then
AC_DEFINE(UCD_SNMP_HACK, 1)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])