[Dovecot] dovecot-2.0.alpha2 doesn't compile on Mac OS X

Mike Abbott michael.abbott at apple.com
Tue Oct 27 18:06:37 EET 2009


Howdy, dovecot-2.0.alpha2 doesn't compile on Mac OS X.

First, trivially, there's a typo in array.h:
--- a/src/lib/array.h   2009-10-08 10:04:35.000000000 -0500
+++ b/src/lib/array.h	2009-10-27 10:35:58.000000000 -0500
@@ -72,7 +72,7 @@
              (elem)++)
  #  define array_foreach_modifiable(array, elem) \
         for (elem = ARRAY_TYPE_CAST_MODIFIABLE(array) \
-                       buffer_get_modifiable_data((array)- 
 >arr.buffer, NULL)) + \
+			buffer_get_modifiable_data((array)->arr.buffer, NULL) + \
                         (array)->arr.buffer->used; \
	     elem != CONST_PTR_OFFSET(*(array)->v, (array)->arr.buffer- 
 >used); \
	     (elem)++)


Second, Mac OS X can't link loadable modules against other loadable  
modules (http://www.finkproject.org/doc/porting/porting.en.html#shared.lib-and-mod 
):
--- a/src/plugins/fts-squat/Makefile.am	2009-10-18 16:28:45.000000000  
-0500
+++ b/src/plugins/fts-squat/Makefile.am	2009-10-27 10:35:58.000000000  
-0500
@@ -10,8 +10,9 @@
  module_LTLIBRARIES = \
  	lib21_fts_squat_plugin.la

-lib21_fts_squat_plugin_la_LIBADD = \
-	../fts/lib20_fts_plugin.la
+# Apple can't link loadable modules against other loadable modules
+#lib21_fts_squat_plugin_la_LIBADD = \
+#	../fts/lib20_fts_plugin.la

  lib21_fts_squat_plugin_la_SOURCES = \
  	fts-squat-plugin.c \

--- a/src/plugins/imap-acl/Makefile.am	2009-10-09 13:02:15.000000000  
-0500
+++ b/src/plugins/imap-acl/Makefile.am	2009-10-27 10:35:58.000000000  
-0500
@@ -14,8 +14,9 @@
  imap_module_LTLIBRARIES = \
  	lib02_imap_acl_plugin.la

-lib02_imap_acl_plugin_la_LIBADD = \
-	../acl/lib01_acl_plugin.la
+# Apple can't link loadable modules against other loadable modules
+#lib02_imap_acl_plugin_la_LIBADD = \
+#	../acl/lib01_acl_plugin.la

  lib02_imap_acl_plugin_la_SOURCES = \
  	imap-acl-plugin.c

--- a/src/plugins/imap-quota/Makefile.am	2009-10-09 13:02:15.000000000  
-0500
+++ b/src/plugins/imap-quota/Makefile.am	2009-10-27 10:35:58.000000000  
-0500
@@ -13,8 +13,9 @@
  imap_module_LTLIBRARIES = \
  	lib11_imap_quota_plugin.la

-lib11_imap_quota_plugin_la_LIBADD = \
-	../quota/lib10_quota_plugin.la
+# Apple can't link loadable modules against other loadable modules
+#lib11_imap_quota_plugin_la_LIBADD = \
+#	../quota/lib10_quota_plugin.la

  lib11_imap_quota_plugin_la_SOURCES = \
  	imap-quota-plugin.c

--- a/src/plugins/mail-log/Makefile.am	2009-10-09 13:02:15.000000000  
-0500
+++ b/src/plugins/mail-log/Makefile.am	2009-10-27 10:35:58.000000000  
-0500
@@ -13,8 +13,9 @@
  module_LTLIBRARIES = \
  	lib20_mail_log_plugin.la

-lib20_mail_log_plugin_la_LIBADD = \
-	../notify/lib15_notify_plugin.la
+# Apple can't link loadable modules against other loadable modules
+#lib20_mail_log_plugin_la_LIBADD = \
+#	../notify/lib15_notify_plugin.la

  lib20_mail_log_plugin_la_SOURCES = \
  	mail-log-plugin.c

--- a/src/plugins/trash/Makefile.am	2009-10-09 13:02:15.000000000 -0500
+++ b/src/plugins/trash/Makefile.am	2009-10-27 10:35:58.000000000 -0500
@@ -10,8 +10,9 @@
  module_LTLIBRARIES = \
  	lib11_trash_plugin.la

-lib11_trash_plugin_la_LIBADD = \
-	../quota/lib10_quota_plugin.la
+# Apple can't link loadable modules against other loadable modules
+#lib11_trash_plugin_la_LIBADD = \
+#	../quota/lib10_quota_plugin.la

  lib11_trash_plugin_la_SOURCES = \
  	trash-plugin.c


Third, for cross-compiling the value of WORDS_BIGENDIAN needs to be  
tested, not its presence:
--- a/src/lib-index/mail-transaction-log-file.c	2009-10-15  
21:26:13.000000000 -0500
+++ b/src/lib-index/mail-transaction-log-file.c	2009-10-27  
10:35:58.000000000 -0500
@@ -189,7 +189,7 @@
  	hdr->hdr_size = sizeof(struct mail_transaction_log_header);
  	hdr->indexid = log->index->indexid;
  	hdr->create_stamp = ioloop_time;
-#ifndef WORDS_BIGENDIAN
+#if !WORDS_BIGENDIAN
  	hdr->compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
  #endif

@@ -404,7 +404,7 @@
  		/* we have compatibility flags */
  		enum mail_index_header_compat_flags compat_flags = 0;

-#ifndef WORDS_BIGENDIAN
+#if !WORDS_BIGENDIAN
  		compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
  #endif
  		if (file->hdr.compat_flags != compat_flags) {



More information about the dovecot mailing list