Merged revisions 103722 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Fri, 15 Feb 2008 17:32:43 +0000 (17:32 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 15 Feb 2008 17:32:43 +0000 (17:32 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103722 | mmichelson | 2008-02-15 11:26:37 -0600 (Fri, 15 Feb 2008) | 8 lines

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: https://origsvn.digium.com/svn/asterisk/trunk@103725 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
doc/tex/imapstorage.tex

index d4afaae..b58cef1 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 103711 .
+# From configure.ac Revision: 103715 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -32687,6 +32687,202 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 echo "${ECHO_T}no" >&6; }
                        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
+                               { echo "$as_me:$LINENO: checking for system c-client library..." >&5
+echo $ECHO_N "checking for system c-client library...... $ECHO_C" >&6; }
+                               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}"
+                               cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#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)
+                                               {
+                                               }
+int
+main ()
+{
+
+                                               MAILSTREAM *foo = mail_open(NULL, "", 0);
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_imap_tk="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_imap_tk="no"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+                               if test "${ac_cv_imap_tk}" = "yes"; then
+                                       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#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)
+                                                       {
+                                                       }
+int
+main ()
+{
+
+                                                       long check = mail_expunge_full(NULL, "", 0);
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_imap_tk2006="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_imap_tk2006="no"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+                               fi
                        fi
                fi
        fi
@@ -32694,6 +32890,8 @@ echo "${ECHO_T}no" >&6; }
                #We will enter here if user specified "system" or if any of above checks failed
                { echo "$as_me:$LINENO: checking for system c-client library..." >&5
 echo $ECHO_N "checking for system c-client library...... $ECHO_C" >&6; }
+               CPPFLAGS="${saved_cppflags}"
+               LIBS="${saved_libs}"
                imap_ldflags=""
                imap_libs="-lc-client"
                imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
index 073ec0f..950886a 100644 (file)
@@ -782,12 +782,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
index c690ad2..608a39f 100644 (file)
@@ -55,7 +55,10 @@ need to run 'make install'.
 \subsubsection{Compiling Asterisk}
 
 Configure with ./configure --with-imap=/usr/src/imap
-or where ever you built thfe UWashington IMAP Toolkit. 
+or where ever you built thfe UWashington IMAP Toolkit. This directory
+will be searched for a source installation. If no source installation is
+found there, then a package installation of the IMAP c-client will be 
+searched for in this directory. If one is not found, then configure will fail.
 
 A second configure option is to not specify a directory (i.e.
 ./configure --with-imap). This will assume that you have the