Mike Abbott
2009-Oct-27 16:06 UTC
[Dovecot] dovecot-2.0.alpha2 doesn't compile on Mac OS X
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) {
Timo Sirainen
2009-Oct-27 16:22 UTC
[Dovecot] dovecot-2.0.alpha2 doesn't compile on Mac OS X
On Oct 27, 2009, at 12:06 PM, Mike Abbott wrote:> 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) + \Thanks, fixed. But why is your compiler taking that code path? #if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) I think that should test that you're using C99 compiler, and gcc definitely is one. I'd think clang would also test success there.> 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 > ):Again it seems to work in my Leopard + gcc. Or actually loading e.g. imap_quota without quota gives dlopen() error, but the compiling part works fine. It doesn't matter much that this happens, with OSes that support it it would have simply given a nicer error message: Error: Can't load plugin imap_quota_plugin: Plugin quota must be loaded also So are you saying that the compiling part also fails with you? What are you then doing differently? Anyway, if this needs to be disabled I guess I'll have to add a configure check for it. Any idea how that would work?> Third, for cross-compiling the value of WORDS_BIGENDIAN needs to be > tested, not its presence:Fixed.