[svn-commits] mmichelson: branch 1.4 r103698 - in /branches/1.4: ./ apps/ include/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 14 17:30:17 CST 2008


Author: mmichelson
Date: Thu Feb 14 17:30:17 2008
New Revision: 103698

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103698
Log:
Change to the configure logic regarding IMAP. Prior to this commit, if you wished to configure
Asterisk with IMAP support, you would use the --with-imap configure switch in one of the following
two ways:
--with-imap=/some/directory would look in the directory specified for a UW IMAP source installation
--with-imap would assume that you had imap-2004g installed in .. relative to the Asterisk source

With this set of changes the two above options still work the same, but there are two new behaviors, too.
--with-imap=system will assume that you have -libc-client.so where you store your shared objects and will
            attempt to find c-client headers in your include path either in the imap or c-client directory.
If either of the two original methods of specifying the imap option should fail, then the check for --with-imap
=system will be performed in addition. It is only after this "system" check that failure can happen.


Modified:
    branches/1.4/apps/app_voicemail.c
    branches/1.4/configure
    branches/1.4/configure.ac
    branches/1.4/include/asterisk/autoconfig.h.in

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=103698&r1=103697&r2=103698
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Thu Feb 14 17:30:17 2008
@@ -70,9 +70,19 @@
 #include <ctype.h>
 #include <signal.h>
 #include <pwd.h>
+#ifdef USE_SYSTEM_IMAP
+#include <imap/c-client.h>
+#include <imap/imap4r1.h>
+#include <imap/linkage.h>
+#elif defined (USE_SYSTEM_CCLIENT)
+#include <c-client/c-client.h>
+#include <c-client/imap4r1.h>
+#include <c-client/linkage.h>
+#else
 #include "c-client.h"
 #include "imap4r1.h"
 #include "linkage.h"
+#endif
 #endif
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
@@ -379,7 +389,7 @@
 			signed char record_gain, struct vm_state *vms);
 static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain);
 static int vm_play_folder_name(struct ast_channel *chan, char *mbox);
-static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname);
+static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname);
 static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap);
 #if !(defined(ODBC_STORAGE) || defined(IMAP_STORAGE))
 static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit);
@@ -2643,7 +2653,7 @@
 		ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
 	}
 	ast_unlock_path(todir);
-	notify_new_message(chan, recip, NULL, recipmsgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
+	notify_new_message(chan, recip, recipmsgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
 	
 	return 0;
 }
@@ -3172,11 +3182,7 @@
 					}
 					/* Notification and disposal needs to happen after the copy, though. */
 					if (ast_fileexists(fn, NULL, NULL)) {
-#ifdef IMAP_STORAGE
-						notify_new_message(chan, vmu, vms, msgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
-#else
-						notify_new_message(chan, vmu, NULL, msgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
-#endif
+						notify_new_message(chan, vmu, msgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
 						DISPOSE(dir, msgnum);
 					}
 				}
@@ -3921,7 +3927,7 @@
 	return cmd;
 }
 
-static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
+static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
 {
 	char todir[PATH_MAX], fn[PATH_MAX], ext_context[PATH_MAX], *stringp;
 	int newmsgs = 0, oldmsgs = 0;
@@ -3972,20 +3978,15 @@
 		DELETE(todir, msgnum, fn);
 	}
 
+#ifdef IMAP_STORAGE
+	DELETE(todir, msgnum, fn);
+#endif
 	/* Leave voicemail for someone */
 	if (ast_app_has_voicemail(ext_context, NULL)) {
 		ast_app_inboxcount(ext_context, &newmsgs, &oldmsgs);
 	}
 	manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
 	run_externnotify(vmu->context, vmu->mailbox);
-
-#ifdef IMAP_STORAGE
-	DELETE(todir, msgnum, fn);  /* Delete the file, but not the IMAP message */
-	if (ast_test_flag(vmu, VM_DELETE))  { /* Delete the IMAP message if delete = yes */
-		IMAP_DELETE(vms->curdir, vms->curmsg, vms->fn, vms);
-		vms->newmessages--;  /* Fix new message count */
-	}
-#endif
 	return 0;
 }
 
@@ -4768,7 +4769,13 @@
 
 	if (delimiter == '\0') {		/* did not probe the server yet */
 		char *cp;
+#ifdef USE_SYSTEM_IMAP
+#include <imap/linkage.c>
+#elif defined(USE_SYSTEM_CCLIENT)
+#include <c-client/linkage.c>
+#else
 #include "linkage.c"
+#endif
 		/* Connect to INBOX first to get folders delimiter */
 		imap_mailbox_name(tmp, sizeof(tmp), vms, 0, 1);
 		stream = mail_open (stream, tmp, debug ? OP_DEBUG : NIL);

Modified: branches/1.4/configure.ac
URL: http://svn.digium.com/view/asterisk/branches/1.4/configure.ac?view=diff&rev=103698&r1=103697&r2=103698
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Thu Feb 14 17:30:17 2008
@@ -479,156 +479,414 @@
 fi
 
 if test "${USE_IMAP_TK}" != "no"; then
-   if test "${IMAP_TK_DIR}" = ""; then
-      IMAP_TK_DIR=`pwd`"/../imap-2004g"
-      if test  -n "${IMAP_TK_MANDATORY}"; then
-	 AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
-	 AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
-	 AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
-	 AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
-      fi
-   fi
-   AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
-   saved_cppflags="${CPPFLAGS}"
-   saved_libs="${LIBS}"
-   if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
-      imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
-   fi
-   CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
-   LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${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
-   CPPFLAGS="${saved_cppflags}"
-   LIBS="${saved_libs}"
-   if test "${ac_cv_imap_tk}" = "yes"; then
-      AC_MSG_RESULT(yes) 
-      IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
-      IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
-      PBX_IMAP_TK=1
-      AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
-      if test "${ac_cv_imap_tk2006}" = "yes"; then
-         AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
-      fi
-   elif test -n "${IMAP_TK_MANDATORY}"; then
-      AC_MSG_RESULT(no) 
-      AC_MSG_NOTICE([***])
-      AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
-      AC_MSG_NOTICE([*** Either correct the installation, or run configure])
-      AC_MSG_NOTICE([*** including --without-imap.])
-      exit 1
-   else
-      AC_MSG_RESULT(no) 
-   fi
+	if test "${IMAP_TK_DIR}" = ""; then
+		IMAP_TK_DIR=`pwd`"/../imap-2004g"
+	fi
+	saved_cppflags="${CPPFLAGS}"
+	saved_libs="${LIBS}"
+	if test "${IMAP_TK_DIR}" != "system"; then
+		AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
+		if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
+      		imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
+		fi
+		imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
+	  	imap_include="-I${IMAP_TK_DIR}/c-client"
+      	CPPFLAGS="${CPPFLAGS} ${imap_include}"
+	  	LIBS="${LIBS} ${imap_libs} "`echo ${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
+		CPPFLAGS="${saved_cppflags}"
+		LIBS="${saved_libs}"
+		if test "${ac_cv_imap_tk}" = "yes"; then
+			AC_MSG_RESULT(yes)
+      		IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
+      		IMAP_TK_INCLUDE="${imap_include}"
+      		PBX_IMAP_TK=1
+      		AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
+      		if test "${ac_cv_imap_tk2006}" = "yes"; then
+         		AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
+      		fi
+		else
+			AC_MSG_RESULT(no)
+			IMAP_TK_DIR="system"
+		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...])
+		imap_ldflags=""
+		imap_libs="-lc-client"
+		imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
+		CPPFLAGS="${CPPFLAGS} ${imap_include}"
+		LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
+		AC_LINK_IFELSE(
+	    	AC_LANG_PROGRAM(
+				[#include <stdio.h>
+				#include <imap/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 <stdio.h>
+					#include <imap/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"]
+			)
+		else #looking in imap directory didn't work, try c-client
+			imap_ldflags=""
+			imap_libs="-lc-client"
+			imap_include="-DUSE_SYSTEM_CCLIENT"
+			CPPFLAGS="${saved_cppflags}"
+			LIBS="${saved_libs}"
+			CPPFLAGS="${CPPFLAGS} ${imap_include}"
+			LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
+			AC_LINK_IFELSE(
+	    		AC_LANG_PROGRAM(
+					[#include <stdio.h>
+					#include <c-client/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 <stdio.h>
+						#include <c-client/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
+		if test "${ac_cv_imap_tk}" = "yes"; then
+			AC_MSG_RESULT(yes)
+			CPPFLAGS="${saved_cppflags}"
+			LIBS="${saved_libs}"
+			IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
+			IMAP_TK_INCLUDE="${imap_include}"
+			PBX_IMAP_TK=1
+			AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
+			if test "${ac_cv_imap_tk2006}" = "yes"; then
+				AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
+			fi
+		elif test -n "${IMAP_TK_MANDATORY}"; then
+			AC_MSG_RESULT(no) 
+			AC_MSG_NOTICE([***])
+			AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
+			AC_MSG_NOTICE([*** Either correct the installation, or run configure])
+			AC_MSG_NOTICE([*** including --without-imap.])
+			exit 1
+		else
+			AC_MSG_RESULT(no) 
+		fi
+	fi
 fi
 
 # Needed by unixodbc

Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=103698&r1=103697&r2=103698
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Thu Feb 14 17:30:17 2008
@@ -641,6 +641,9 @@
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
 
 /* Define like PROTOTYPES; this can be used by system headers. */
 #undef __PROTOTYPES




More information about the svn-commits mailing list