Building Cyrus SASL on Mac OS X El Capitan

Larry Stone lstone19 at stonejongleux.com
Wed Dec 23 23:03:10 EST 2015


Thanks to a private note that ended up with me looking at what Apple does (all their open source software can be found at www.opensource.apple.com), I was able to quickly find a solution that involves patching the libtool script built by configure. After that, I seem to have a good build and a rebuild of Postfix linked to it works as expected.

After ./configure, patch libtool as follows:
--- libtool	2015-12-23 21:45:07.000000000 -0600
+++ libtool.patched	2015-12-23 21:47:23.000000000 -0600
@@ -175,7 +175,7 @@
 old_archive_from_new_cmds=""
 
 # Commands used to build and install a shared archive.
-archive_cmds="\$CC \$(test x\$module = xyes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$linkopts -install_name \$rpath/\$soname \$(test -n \\\"\$verstring\\\" -a x\$verstring != x0.0 && echo \$verstring)"
+archive_cmds="\$CC \$(test x\$module = xyes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$linkopts \$(test x\$module != xyes && echo -install_name \$rpath/\$soname \$tmp_verstring)"
 archive_expsym_cmds=""
 postinstall_cmds=""
 postuninstall_cmds=""

Then make and make install.

Also, for the second question below regarding install_name pointing at /usr/lib, that was taken care of by specifying --with-plugindir=/usr/local/lib/sasl2 and --with-configdir=/usr/local/lib/sasl2 on ./configure. I think (unless I missed something) that (along with the defaults) keeps everything in /usr/local/lib and /usr/local/include so it does not conflict with or overwrite what Apple has provided in /usr/lib and /usr/include.

-- 
Larry Stone
lstone19 at stonejongleux.com

> On Dec 23, 2015, at 2:33 PM, Larry Stone via Cyrus-sasl <cyrus-sasl at lists.andrew.cmu.edu> wrote:
> 
> I'm new to trying to build my own Cyrus SASL having relied on what Apple provides with OS X. But as Apple seems to want to provide less and less, I've been trying to move all the server stuff I run on my Macintosh to self-built from source. Cyrus SASL is the last piece and I am having no success (I build Postfix with Cyrus SASL for outgoing SASL authentication).
> 
> Cyrus-SAL version: 2.1.25 (have tried others with same result)
> OS X Version: El Capitan 10.11.2 (had same issue with Yosemite (10.10.x))
> OpenSSL version: 1.0.2e (built from source)
> Configure command: ./configure --with-openssl=/usr/local/ssl
> 
> Make fails with:
> gcc -bundle -undefined error -o .libs/libsasldb.2.0.25.so  sasldb.lo sasldb_init.lo plugin_common.lo -all_load  ../sasldb/.libs/libsasldb.al -L/usr/local/ssl/lib -lresolv -lresolv -lresolv -lresolv -lc -install_name  /usr/lib/sasl2/libsasldb.2.so
> clang: error: invalid argument '-install_name /usr/lib/sasl2/libsasldb.2.so' only allowed with '-dynamiclib'
> make[2]: *** [libsasldb.la] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> 
> Searching the archives, there was a thread four years ago
> (<http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&searchterm=os%20x&msg=9765>)
> with what seems to be the same problem on OS X 10.7 but other than someone
> saying it worked fine for them, I saw no resolution.
> 
> Also, why is the install_name specifying /usr/lib when configure, by default, should be putting everything in /usr/local (and I get the same path if I explicitly say --prefix=/usr/local on the configure command). As of El Capitan, Apple's new "rootless" environment prohibits any changes to /usr (other than /usr/local) unless you go through some strongly discouraged steps to turn off that protection.
> 
> Thanks for any help.
> 





-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4133 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/cyrus-sasl/attachments/20151223/e4f8b2e4/attachment.p7s>


More information about the Cyrus-sasl mailing list