2001-11-30 19:00:13 +00:00
|
|
|
dnl
|
2001-01-14 08:54:01 +00:00
|
|
|
dnl $Id$
|
2001-11-30 19:00:13 +00:00
|
|
|
dnl
|
2001-01-14 08:54:01 +00:00
|
|
|
|
2001-01-23 21:46:04 +00:00
|
|
|
PHP_ARG_WITH(vpopmail, for vpopmail support,
|
|
|
|
[ --with-vpopmail[=DIR] Include vpopmail support.])
|
2001-01-14 08:54:01 +00:00
|
|
|
|
|
|
|
if test "$PHP_VPOPMAIL" != "no"; then
|
2001-01-23 21:46:04 +00:00
|
|
|
AC_MSG_CHECKING(for vpopmail install directory)
|
2002-03-17 08:33:25 +00:00
|
|
|
for i in /usr/include/vpopmail /usr/include /usr ~vpopmail /home/vpopmail /home/popmail /var/qmail/vpopmail /var/qmail/popmail $PHP_VPOPMAIL; do
|
2001-01-23 21:46:04 +00:00
|
|
|
if test -r $i/vpopmail.h; then
|
|
|
|
VPOPMAIL_INC_DIR=$i
|
|
|
|
VPOPMAIL_DIR=$i
|
|
|
|
elif test -r $i/include/vpopmail.h; then
|
|
|
|
VPOPMAIL_INC_DIR=$i/include
|
|
|
|
VPOPMAIL_DIR=$i
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -r $i/libvpopmail.a; then
|
|
|
|
VPOPMAIL_LIB_DIR=$i
|
|
|
|
elif test -r $i/lib/libvpopmail.a; then
|
|
|
|
VPOPMAIL_LIB_DIR=$i/lib
|
|
|
|
fi
|
|
|
|
|
2002-03-19 22:47:37 +00:00
|
|
|
if test -x $i/vadddomain; then
|
2001-01-23 21:46:04 +00:00
|
|
|
VPOPMAIL_BIN_DIR=$i
|
2002-03-19 22:47:37 +00:00
|
|
|
elif test -x $i/bin/vadddomain; then
|
2001-01-23 21:46:04 +00:00
|
|
|
VPOPMAIL_BIN_DIR=$i/bin
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-03-19 22:47:37 +00:00
|
|
|
for i in "$VPOPMAIL_INC_DIR/vpopmail.h" "$VPOPMAIL_INC_DIR/vpopmail_config.h" "$VPOPMAIL_LIB_DIR/libvpopmail.a"; do
|
2001-01-23 21:46:04 +00:00
|
|
|
if test ! -r "$i"; then
|
2002-03-17 08:33:25 +00:00
|
|
|
AC_MSG_ERROR(Could not find '$i'. Please make sure you have vpopmail installed. Use
|
|
|
|
./configure --with-vpopmail=<vpopmail-home-dir> if necessary)
|
2001-01-23 21:46:04 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-03-19 22:47:37 +00:00
|
|
|
for i in "$VPOPMAIL_BIN_DIR/vadddomain" "$VPOPMAIL_BIN_DIR/vaddaliasdomain" "$VPOPMAIL_BIN_DIR/vdeldomain" ; do
|
|
|
|
if test ! -x "$i"; then
|
|
|
|
AC_MSG_ERROR(Could not find '$i' or binary not executeable under current user.
|
|
|
|
Please make sure you have vpopmail properly installed.
|
|
|
|
Use ./configure --with-vpopmail=<vpopmail-home-dir> if necessary)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2001-05-28 19:58:36 +00:00
|
|
|
AC_MSG_RESULT($VPOPMAIL_DIR)
|
|
|
|
|
2001-05-24 03:19:44 +00:00
|
|
|
dnl newer versions of vpopmail have include/vauth.h defining valias functions
|
|
|
|
if test -r $VPOPMAIL_INC_DIR/vauth.h; then
|
|
|
|
AC_DEFINE(HAVE_VPOPMAIL_VAUTH,1,[Whether vpopmail has vauth.h])
|
|
|
|
fi
|
2001-05-28 19:58:36 +00:00
|
|
|
dnl check for valias functions in the -lvpopmail
|
2001-09-05 13:18:09 +00:00
|
|
|
PHP_CHECK_LIBRARY(vpopmail, valias_select, [
|
|
|
|
AC_DEFINE(HAVE_VPOPMAIL_VALIAS,1,[Whether vpopmail has valias support])
|
2002-03-20 18:22:32 +00:00
|
|
|
],[],[
|
2001-09-05 13:18:09 +00:00
|
|
|
-L$VPOPMAIL_LIB_DIR
|
|
|
|
])
|
2001-01-23 21:46:04 +00:00
|
|
|
|
2001-03-27 20:35:04 +00:00
|
|
|
PHP_ADD_INCLUDE($VPOPMAIL_INC_DIR)
|
2001-01-23 21:46:04 +00:00
|
|
|
|
|
|
|
PHP_SUBST(VPOPMAIL_SHARED_LIBADD)
|
2001-03-27 20:35:04 +00:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(vpopmail, $VPOPMAIL_LIB_DIR, VPOPMAIL_SHARED_LIBADD)
|
2001-01-23 21:46:04 +00:00
|
|
|
|
|
|
|
AC_DEFINE(HAVE_VPOPMAIL,1,[Whether you have vpopmail])
|
|
|
|
AC_DEFINE_UNQUOTED(VPOPMAIL_BIN_DIR,"$VPOPMAIL_BIN_DIR",[vpopmail bin path])
|
|
|
|
|
2002-03-19 22:47:37 +00:00
|
|
|
dnl Detect if we have vpopmail >= 5.2 to accomodate C-API changes
|
|
|
|
dnl
|
|
|
|
dnl The current table is:
|
|
|
|
dnl
|
|
|
|
dnl PHP API VPOPMAIL VERSION
|
|
|
|
dnl 1 < 5.2
|
|
|
|
dnl 2 >= 5.2
|
|
|
|
vpopmail_internal_api=1
|
|
|
|
version=`grep VERSION $VPOPMAIL_INC_DIR/vpopmail_config.h`
|
|
|
|
if test -n "$version"; then
|
2002-03-20 19:22:54 +00:00
|
|
|
version_major=`echo "$version" | tr "\"#." " " | awk '{print $3}'`
|
|
|
|
version_minor=`echo "$version" | tr "\"#." " " | awk '{print $4}'`
|
2002-03-19 22:47:37 +00:00
|
|
|
if test $version_major -ge 5; then
|
|
|
|
if test $version_major -eq 5; then
|
|
|
|
if test $version_minor -ge 2; then
|
|
|
|
vpopmail_internal_api=2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test $version_major -gt 5; then
|
|
|
|
vpopmail_internal_api=2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED(HAVE_VPOPMAIL_API,$vpopmail_internal_api,[Interal definition for vpopmail API changes])
|
|
|
|
|
2002-03-12 16:44:00 +00:00
|
|
|
PHP_NEW_EXTENSION(vpopmail, php_vpopmail.c, $ext_shared)
|
2001-01-14 08:54:01 +00:00
|
|
|
fi
|