mirror of
https://github.com/php/php-src.git
synced 2024-11-26 11:23:47 +08:00
Cleaning this a bit too. Now I'm also able to configure and compile
with the test for imap-ssl.
This commit is contained in:
parent
b01ba3f820
commit
9cce67f16d
@ -1,47 +1,85 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
AC_DEFUN(IMAP_INC_CHK,[if test -r "$i$1/c-client.h"; then
|
||||
AC_DEFINE(HAVE_IMAP2000, 1, [ ])
|
||||
IMAP_DIR=$i
|
||||
IMAP_INC_DIR=$i$1
|
||||
elif test -r "$i$1/rfc822.h"; then
|
||||
IMAP_DIR=$i;
|
||||
IMAP_INC_DIR=$i$1
|
||||
|
||||
AC_DEFINE(HAVE_IMAP2000, 1, [ ])
|
||||
IMAP_DIR=$i
|
||||
IMAP_INC_DIR=$i$1
|
||||
elif test -r "$i$1/rfc822.h"; then
|
||||
IMAP_DIR=$i;
|
||||
IMAP_INC_DIR=$i$1
|
||||
])
|
||||
|
||||
AC_DEFUN(IMAP_LIB_CHK,[
|
||||
str="$IMAP_DIR/$1/lib$lib.*"
|
||||
for i in `echo $str`; do
|
||||
if test -r $i; then
|
||||
IMAP_LIBDIR=$IMAP_DIR/$1
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
])
|
||||
str="$IMAP_DIR/$1/lib$lib.*"
|
||||
for i in `echo $str`; do
|
||||
if test -r $i; then
|
||||
IMAP_LIBDIR=$IMAP_DIR/$1
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_IMAP_KRB_CHK, [
|
||||
PHP_ARG_WITH(kerberos,for Kerberos support in IMAP,
|
||||
[ --with-kerberos[=DIR] IMAP: Include Kerberos support.])
|
||||
|
||||
PHP_ARG_WITH(kerberos,for Kerberos support in IMAP,
|
||||
[ --with-kerberos[=DIR] Include Kerberos support in IMAP.])
|
||||
if test "$PHP_KERBEROS" = "yes"; then
|
||||
test -d /usr/kerberos && PHP_KERBEROS=/usr/kerberos
|
||||
fi
|
||||
|
||||
if test "$PHP_KERBEROS" = "yes"; then
|
||||
test -d /usr/kerberos && PHP_KERBEROS=/usr/kerberos
|
||||
fi
|
||||
if test "$PHP_KERBEROS" != "no"; then
|
||||
AC_DEFINE(HAVE_IMAP_KRB,1,[ ])
|
||||
PHP_ADD_LIBPATH($PHP_KERBEROS/lib, IMAP_SHARED_LIBADD)
|
||||
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)
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$PHP_KERBEROS" != "no"; then
|
||||
PHP_KERBEROS_LIBDIR=$PHP_KERBEROS/lib
|
||||
fi
|
||||
AC_DEFUN(PHP_IMAP_SSL_CHK, [
|
||||
PHP_ARG_WITH(imap-ssl,for SSL support in IMAP,
|
||||
[ --with-imap-ssl[=DIR] IMAP: Include SSL support.])
|
||||
|
||||
PHP_ARG_WITH(imap-ssl,for SSL support in IMAP,
|
||||
[ --with-imap-ssl[=DIR] Include SSL support in IMAP.])
|
||||
if test "$PHP_IMAP_SSL" = "yes"; then
|
||||
PHP_IMAP_SSL=/usr
|
||||
fi
|
||||
|
||||
if test "$PHP_IMAP_SSL" = "yes"; then
|
||||
PHP_IMAP_SSL=/usr
|
||||
fi
|
||||
if test "$PHP_IMAP_SSL" != "no"; then
|
||||
PHP_ADD_LIBPATH($PHP_IMAP_SSL/lib, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(ssl,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(crypto,, IMAP_SHARED_LIBADD)
|
||||
|
||||
if test "$PHP_IMAP_SSL" != "no"; then
|
||||
PHP_SSL_LIBDIR=$PHP_IMAP_SSL/lib
|
||||
fi
|
||||
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){}
|
||||
char ssl_onceonlyinit();
|
||||
int main() {
|
||||
ssl_onceonlyinit();
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
AC_DEFINE(HAVE_IMAP_SSL,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR(This c-client library does not support SSL. Recompile or remove --with-imap-ssl from configure line.)
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
PHP_ARG_WITH(imap,for IMAP support,
|
||||
@ -49,6 +87,11 @@ PHP_ARG_WITH(imap,for IMAP support,
|
||||
and c-client.a directory.])
|
||||
|
||||
if test "$PHP_IMAP" != "no"; then
|
||||
|
||||
PHP_SUBST(IMAP_SHARED_LIBADD)
|
||||
PHP_EXTENSION(imap, $ext_shared)
|
||||
AC_DEFINE(HAVE_IMAP,1,[ ])
|
||||
|
||||
for i in /usr/local /usr $PHP_IMAP; do
|
||||
IMAP_INC_CHK()
|
||||
el[]IMAP_INC_CHK(/include/c-client)
|
||||
@ -84,51 +127,8 @@ if test "$PHP_IMAP" != "no"; then
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($IMAP_INC_DIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH($IMAP_LIB, $IMAP_LIBDIR, IMAP_SHARED_LIBADD)
|
||||
PHP_SUBST(IMAP_SHARED_LIBADD)
|
||||
|
||||
if test "$PHP_KERBEROS" != "no"; then
|
||||
AC_DEFINE(HAVE_IMAP_KRB,1,[ ])
|
||||
PHP_ADD_LIBPATH($PHP_KERBEROS_LIBDIR, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(com_err,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(k5crypto,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(krb5,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(gssapi_krb5,, IMAP_SHARED_LIBADD)
|
||||
fi
|
||||
|
||||
if test "$PHP_IMAP_SSL" != "no"; then
|
||||
PHP_ADD_LIBPATH($PHP_SSL_LIBDIR, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(ssl,, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(crypto,, IMAP_SHARED_LIBADD)
|
||||
|
||||
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){}
|
||||
char ssl_onceonlyinit();
|
||||
int main() {
|
||||
ssl_onceonlyinit();
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
AC_DEFINE(HAVE_IMAP_SSL,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR(This c-client library does not support SSL. Recompile or remove --with-imap-ssl from configure line.)
|
||||
])
|
||||
fi
|
||||
|
||||
PHP_EXTENSION(imap, $ext_shared)
|
||||
AC_DEFINE(HAVE_IMAP,1,[ ])
|
||||
PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY($IMAP_LIB,, IMAP_SHARED_LIBADD)
|
||||
PHP_IMAP_KRB_CHK
|
||||
PHP_IMAP_SSL_CHK
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user