2001-05-10 14:58:25 +08:00
|
|
|
dnl
|
1999-04-22 08:45:14 +08:00
|
|
|
dnl $Id$
|
2001-05-10 14:58:25 +08:00
|
|
|
dnl
|
1999-04-22 08:45:14 +08:00
|
|
|
|
2001-02-26 23:17:12 +08:00
|
|
|
AC_DEFUN(IMAP_INC_CHK,[if test -r "$i$1/c-client.h"; then
|
2001-05-10 14:58:25 +08:00
|
|
|
AC_DEFINE(HAVE_IMAP2000, 1, [ ])
|
|
|
|
IMAP_DIR=$i
|
|
|
|
IMAP_INC_DIR=$i$1
|
2003-10-01 10:53:23 +08:00
|
|
|
break
|
2001-05-10 14:58:25 +08:00
|
|
|
elif test -r "$i$1/rfc822.h"; then
|
|
|
|
IMAP_DIR=$i;
|
|
|
|
IMAP_INC_DIR=$i$1
|
2003-10-01 10:53:23 +08:00
|
|
|
break
|
2001-02-26 23:17:12 +08:00
|
|
|
])
|
2000-04-29 01:13:50 +08:00
|
|
|
|
2000-03-03 20:12:01 +08:00
|
|
|
AC_DEFUN(IMAP_LIB_CHK,[
|
2001-05-10 14:58:25 +08:00
|
|
|
str="$IMAP_DIR/$1/lib$lib.*"
|
|
|
|
for i in `echo $str`; do
|
2003-10-01 10:53:23 +08:00
|
|
|
test -r $i && IMAP_LIBDIR=$IMAP_DIR/$1 && break 2
|
2001-05-10 14:58:25 +08:00
|
|
|
done
|
|
|
|
])
|
2000-10-03 06:16:53 +08:00
|
|
|
|
2003-01-18 15:00:47 +08:00
|
|
|
dnl PHP_IMAP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs])
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_DEFUN(PHP_IMAP_TEST_BUILD, [
|
|
|
|
old_LIBS=$LIBS
|
2003-01-18 15:00:47 +08:00
|
|
|
LIBS="$4 $LIBS"
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_TRY_RUN([
|
|
|
|
void mm_log(void){}
|
|
|
|
void mm_dlog(void){}
|
|
|
|
void mm_flags(void){}
|
|
|
|
void mm_fatal(void){}
|
|
|
|
void mm_critical(void){}
|
|
|
|
void mm_nocritical(void){}
|
|
|
|
void mm_notify(void){}
|
|
|
|
void mm_login(void){}
|
|
|
|
void mm_diskerror(void){}
|
|
|
|
void mm_status(void){}
|
|
|
|
void mm_lsub(void){}
|
|
|
|
void mm_list(void){}
|
|
|
|
void mm_exists(void){}
|
|
|
|
void mm_searched(void){}
|
|
|
|
void mm_expunged(void){}
|
2003-01-18 15:00:47 +08:00
|
|
|
char $1();
|
2002-07-12 20:13:45 +08:00
|
|
|
int main() {
|
2003-01-18 15:00:47 +08:00
|
|
|
$1();
|
2002-07-12 20:13:45 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
], [
|
|
|
|
LIBS=$old_LIBS
|
2003-01-18 15:00:47 +08:00
|
|
|
$2
|
2002-07-12 20:13:45 +08:00
|
|
|
],[
|
|
|
|
LIBS=$old_LIBS
|
2003-01-18 15:00:47 +08:00
|
|
|
$3
|
2002-07-12 20:13:45 +08:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2001-05-10 14:58:25 +08:00
|
|
|
AC_DEFUN(PHP_IMAP_KRB_CHK, [
|
2001-08-03 13:17:18 +08:00
|
|
|
AC_ARG_WITH(kerberos,
|
|
|
|
[ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install dir.],[
|
|
|
|
PHP_KERBEROS=$withval
|
|
|
|
],[
|
|
|
|
PHP_KERBEROS=no
|
|
|
|
])
|
2001-05-10 14:58:25 +08:00
|
|
|
|
|
|
|
if test "$PHP_KERBEROS" != "no"; then
|
2002-11-02 00:45:59 +08:00
|
|
|
|
|
|
|
if test "$PHP_KERBEROS" = "yes"; then
|
|
|
|
SEARCH_PATHS="/usr/kerberos /usr/local /usr"
|
|
|
|
else
|
|
|
|
SEARCH_PATHS=$PHP_KERBEROS
|
|
|
|
fi
|
|
|
|
|
|
|
|
for i in $SEARCH_PATHS; do
|
|
|
|
if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
|
|
|
|
PHP_KERBEROS_DIR=$i
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$PHP_KERBEROS_DIR"; then
|
|
|
|
AC_MSG_ERROR([Kerberos libraries not found.
|
2002-07-13 06:11:54 +08:00
|
|
|
|
2002-11-02 00:45:59 +08:00
|
|
|
Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
|
2002-07-13 06:11:54 +08:00
|
|
|
])
|
|
|
|
fi
|
2001-05-10 14:58:25 +08:00
|
|
|
AC_DEFINE(HAVE_IMAP_KRB,1,[ ])
|
2002-11-02 00:45:59 +08:00
|
|
|
PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, IMAP_SHARED_LIBADD)
|
2001-05-10 14:58:25 +08:00
|
|
|
PHP_ADD_LIBRARY(gssapi_krb5, 1, IMAP_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY(krb5, 1, IMAP_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY(k5crypto, 1, IMAP_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY(com_err, 1, IMAP_SHARED_LIBADD)
|
2003-05-11 01:14:47 +08:00
|
|
|
PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include)
|
2001-08-03 13:17:18 +08:00
|
|
|
else
|
|
|
|
AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
|
2002-08-21 07:08:24 +08:00
|
|
|
AC_MSG_ERROR([This c-client library is built with Kerberos support.
|
2001-08-03 13:17:18 +08:00
|
|
|
|
2003-01-28 14:56:32 +08:00
|
|
|
Add --with-kerberos to your configure line. Check config.log for details.
|
2002-07-12 20:13:45 +08:00
|
|
|
])
|
2001-08-03 13:17:18 +08:00
|
|
|
])
|
2001-05-10 14:58:25 +08:00
|
|
|
fi
|
2001-08-03 13:17:18 +08:00
|
|
|
|
2001-05-10 14:58:25 +08:00
|
|
|
])
|
2000-10-03 06:16:53 +08:00
|
|
|
|
2001-05-10 14:58:25 +08:00
|
|
|
AC_DEFUN(PHP_IMAP_SSL_CHK, [
|
2001-08-03 13:17:18 +08:00
|
|
|
AC_ARG_WITH(imap-ssl,
|
2003-10-03 13:24:33 +08:00
|
|
|
[ --with-imap-ssl=<DIR> IMAP: Include SSL support. DIR is the OpenSSL install dir.],[
|
2001-08-03 13:17:18 +08:00
|
|
|
PHP_IMAP_SSL=$withval
|
|
|
|
],[
|
|
|
|
PHP_IMAP_SSL=no
|
|
|
|
])
|
2001-05-10 14:58:25 +08:00
|
|
|
|
|
|
|
if test "$PHP_IMAP_SSL" = "yes"; then
|
|
|
|
PHP_IMAP_SSL=/usr
|
|
|
|
fi
|
|
|
|
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_MSG_CHECKING([whether SSL libraries are needed for c-client])
|
|
|
|
|
2001-05-10 14:58:25 +08:00
|
|
|
if test "$PHP_IMAP_SSL" != "no"; then
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_MSG_RESULT([$PHP_IMAP_SSL/lib])
|
2001-08-03 13:17:18 +08:00
|
|
|
AC_DEFINE(HAVE_IMAP_SSL,1,[ ])
|
2003-03-11 10:11:57 +08:00
|
|
|
PHP_ADD_LIBRARY_DEFER(ssl, 1, IMAP_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY_DEFER(crypto, 1, IMAP_SHARED_LIBADD)
|
2002-07-25 19:33:21 +08:00
|
|
|
PHP_ADD_LIBPATH($PHP_IMAP_SSL/lib, IMAP_SHARED_LIBADD)
|
2001-08-03 13:17:18 +08:00
|
|
|
else
|
2003-04-30 18:34:47 +08:00
|
|
|
AC_MSG_RESULT(no)
|
2001-05-10 14:58:25 +08:00
|
|
|
fi
|
|
|
|
])
|
2000-10-03 06:16:53 +08:00
|
|
|
|
2001-05-06 13:39:16 +08:00
|
|
|
|
2000-05-24 07:36:44 +08:00
|
|
|
PHP_ARG_WITH(imap,for IMAP support,
|
2001-08-03 13:17:18 +08:00
|
|
|
[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix.])
|
2000-05-24 07:36:44 +08:00
|
|
|
|
2001-05-06 13:39:16 +08:00
|
|
|
if test "$PHP_IMAP" != "no"; then
|
2001-05-10 14:58:25 +08:00
|
|
|
|
|
|
|
PHP_SUBST(IMAP_SHARED_LIBADD)
|
2002-03-13 00:44:00 +08:00
|
|
|
PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared)
|
2001-05-10 14:58:25 +08:00
|
|
|
AC_DEFINE(HAVE_IMAP,1,[ ])
|
|
|
|
|
2003-10-01 06:36:43 +08:00
|
|
|
for i in $PHP_IMAP /usr/local /usr; do
|
2000-03-03 19:47:13 +08:00
|
|
|
IMAP_INC_CHK()
|
2000-05-01 00:10:29 +08:00
|
|
|
el[]IMAP_INC_CHK(/include/c-client)
|
2001-02-25 12:41:18 +08:00
|
|
|
el[]IMAP_INC_CHK(/include/imap)
|
|
|
|
el[]IMAP_INC_CHK(/include)
|
2000-03-03 19:47:13 +08:00
|
|
|
el[]IMAP_INC_CHK(/imap)
|
|
|
|
el[]IMAP_INC_CHK(/c-client)
|
|
|
|
fi
|
2000-02-29 21:12:48 +08:00
|
|
|
done
|
|
|
|
|
2001-08-08 00:18:05 +08:00
|
|
|
old_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS=-I$IMAP_INC_DIR
|
|
|
|
AC_EGREP_CPP(this_is_true, [
|
2002-06-02 04:14:58 +08:00
|
|
|
#include "imap4r1.h"
|
|
|
|
#if defined(IMAPSSLPORT)
|
2001-08-08 00:18:05 +08:00
|
|
|
this_is_true
|
2002-06-02 04:14:58 +08:00
|
|
|
#endif
|
2001-08-08 00:18:05 +08:00
|
|
|
],[
|
|
|
|
AC_DEFINE(HAVE_IMAP2001, 1, [ ])
|
2001-08-21 19:02:42 +08:00
|
|
|
],[])
|
2001-08-08 00:18:05 +08:00
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
|
2001-05-07 04:16:49 +08:00
|
|
|
AC_CHECK_LIB(pam, pam_start)
|
2001-08-03 13:17:18 +08:00
|
|
|
AC_CHECK_LIB(crypt, crypt)
|
|
|
|
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_EXPAND_PATH($IMAP_DIR, IMAP_DIR)
|
2000-02-29 21:12:48 +08:00
|
|
|
|
|
|
|
if test -z "$IMAP_DIR"; then
|
2001-04-11 01:31:35 +08:00
|
|
|
AC_MSG_ERROR(Cannot find rfc822.h. Please check your IMAP installation.)
|
2000-02-29 21:12:48 +08:00
|
|
|
fi
|
|
|
|
|
2000-02-29 21:21:51 +08:00
|
|
|
if test -r "$IMAP_DIR/c-client/c-client.a"; then
|
|
|
|
ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
|
2000-06-02 04:19:26 +08:00
|
|
|
elif test -r "$IMAP_DIR/lib/c-client.a"; then
|
|
|
|
ln -s "$IMAP_DIR/lib/c-client.a" "$IMAP_DIR/lib/libc-client.a" >/dev/null 2>&1
|
2000-02-29 21:21:51 +08:00
|
|
|
fi
|
|
|
|
|
2001-08-02 19:23:01 +08:00
|
|
|
for lib in c-client4 c-client imap; do
|
2000-02-29 21:12:48 +08:00
|
|
|
IMAP_LIB=$lib
|
2000-03-03 19:54:07 +08:00
|
|
|
IMAP_LIB_CHK(lib)
|
|
|
|
IMAP_LIB_CHK(c-client)
|
2000-02-29 21:12:48 +08:00
|
|
|
done
|
1999-04-22 08:45:14 +08:00
|
|
|
|
2000-05-24 07:36:44 +08:00
|
|
|
if test -z "$IMAP_LIBDIR"; then
|
2002-04-02 08:04:53 +08:00
|
|
|
AC_MSG_ERROR(Cannot find imap library (libc-client.a). Please check your IMAP installation.)
|
2000-02-29 21:12:48 +08:00
|
|
|
fi
|
|
|
|
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_INCLUDE($IMAP_INC_DIR)
|
2002-12-28 23:33:25 +08:00
|
|
|
PHP_ADD_LIBRARY_DEFER($IMAP_LIB,, IMAP_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD)
|
2003-03-11 10:11:57 +08:00
|
|
|
PHP_IMAP_KRB_CHK
|
|
|
|
PHP_IMAP_SSL_CHK
|
2002-07-25 19:33:21 +08:00
|
|
|
|
2002-07-12 20:13:45 +08:00
|
|
|
dnl Test the build in the end
|
2002-07-25 19:33:21 +08:00
|
|
|
TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD"
|
2003-01-18 15:00:47 +08:00
|
|
|
|
|
|
|
dnl Check if auth_gss exists
|
|
|
|
PHP_IMAP_TEST_BUILD(auth_gssapi_valid, [
|
|
|
|
AC_DEFINE(HAVE_IMAP_AUTH_GSS, 1, [ ])
|
|
|
|
], [], $TST_LIBS)
|
|
|
|
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_MSG_CHECKING(whether IMAP works)
|
2003-02-23 16:14:25 +08:00
|
|
|
PHP_IMAP_TEST_BUILD(mail_newbody, [
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
], [
|
2002-07-25 19:33:21 +08:00
|
|
|
AC_MSG_RESULT(no)
|
2002-07-12 20:13:45 +08:00
|
|
|
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
2002-07-25 19:33:21 +08:00
|
|
|
], $TST_LIBS)
|
2001-05-06 13:39:16 +08:00
|
|
|
fi
|