diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 17:26:37 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-15 17:26:37 +0000 |
commit | 9ffccc9423fe00dc1b6e553cda5836fefd21fde5 (patch) | |
tree | 4be41099a7c1b0766e197d334125d9d7ebcc7131 /configure.ac | |
parent | d2725377f5d62c9aa6be659ed2256932ab22f012 (diff) |
Final round of changes for configure script logic for IMAP
Now if a directory is specified, then we will search that directory for
a source installation of the IMAP toolkit. If none is found, then we will
use that directory as the basis for detecting a package installation of
the IMAP c-client. If that check fails, then configure will fail.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103722 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 171f39365..ff346d6db 100644 --- a/configure.ac +++ b/configure.ac @@ -613,12 +613,135 @@ if test "${USE_IMAP_TK}" != "no"; then AC_MSG_RESULT(no) if test "${switch_to_system_on_failure}" = "yes"; then IMAP_TK_DIR="system" + else #This means they specified a directory. Search for a package installation there too + AC_MSG_CHECKING([for system c-client library...]) + CPPFLAGS="${saved_cppflags}" + LIBS="${saved_libs}" + imap_include="-I${IMAP_TK_DIR}/include" + imap_ldflags="-I${IMAP_TK_DIR}/lib" + imap_libs="-lc-client" + CPPFLAGS="${CPPFLAGS} ${imap_include}" + LIBS="${LIBS} ${imap_libs} ${imap_ldflags}" + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [#include "c-client.h" + void mm_searched (MAILSTREAM *stream,unsigned long number) + { + } + void mm_exists (MAILSTREAM *stream,unsigned long number) + { + } + void mm_expunged (MAILSTREAM *stream,unsigned long number) + { + } + void mm_flags (MAILSTREAM *stream,unsigned long number) + { + } + void mm_notify (MAILSTREAM *stream,char *string,long errflg) + { + } + void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) + { + } + void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) + { + } + void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) + { + } + void mm_log (char *string,long errflg) + { + } + void mm_dlog (char *string) + { + } + void mm_login (NETMBX *mb,char *user,char *pwd,long trial) + { + } + void mm_critical (MAILSTREAM *stream) + { + } + void mm_nocritical (MAILSTREAM *stream) + { + } + long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) + { + } + void mm_fatal (char *string) + { + }], + [ + MAILSTREAM *foo = mail_open(NULL, "", 0); + ] + ), + [ac_cv_imap_tk="yes"], + [ac_cv_imap_tk="no"] + ) + if test "${ac_cv_imap_tk}" = "yes"; then + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [#include "c-client.h" + void mm_searched (MAILSTREAM *stream,unsigned long number) + { + } + void mm_exists (MAILSTREAM *stream,unsigned long number) + { + } + void mm_expunged (MAILSTREAM *stream,unsigned long number) + { + } + void mm_flags (MAILSTREAM *stream,unsigned long number) + { + } + void mm_notify (MAILSTREAM *stream,char *string,long errflg) + { + } + void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) + { + } + void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) + { + } + void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) + { + } + void mm_log (char *string,long errflg) + { + } + void mm_dlog (char *string) + { + } + void mm_login (NETMBX *mb,char *user,char *pwd,long trial) + { + } + void mm_critical (MAILSTREAM *stream) + { + } + void mm_nocritical (MAILSTREAM *stream) + { + } + long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) + { + } + void mm_fatal (char *string) + { + }], + [ + long check = mail_expunge_full(NULL, "", 0); + ] + ), + [ac_cv_imap_tk2006="yes"], + [ac_cv_imap_tk2006="no"] + ) + fi fi fi fi if test "${IMAP_TK_DIR}" = "system"; then #We will enter here if user specified "system" or if any of above checks failed AC_MSG_CHECKING([for system c-client library...]) + CPPFLAGS="${saved_cppflags}" + LIBS="${saved_libs}" imap_ldflags="" imap_libs="-lc-client" imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first |