How to compile cyrus-sasl as universal

Most people probably aren’t going to care about this, but I want to share this so no one else has to go through the same pain. A few things are fairly hackish, but hey, it works. Much thanks goes to Nicholas Riley in helping me figure this out.

  1. Download the cyrus-sasl tarball from http://asg.web.cmu.edu/sasl/sasl-library.html
  2. The newest version of GCC is much stricter when compiling so you’ll have to comment out line 112 in file lib/saslint.h, like so:

    //extern sasl_global_callbacks_t global_callbacks;

  3. DO NOT run configure by itself, instead execute this:

    env CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" ./configure --disable-dependency-tracking

  4. Open libtool in a text editor and change this (should be about line 177):

    # 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 \$(test x\$module != xyes && echo -install_name \$rpath/\$soname \$tmp_verstring)"

    To this:

    # Commands used to build and install a shared archive.
    -archive_cmds="\$CC -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 \$(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)”

  5. Now run make, and it should compile

2 Responses to “How to compile cyrus-sasl as universal”  

  1. 1 Hoa

    I think that this is not the right change :

    //extern sasl_global_callbacks_t global_callbacks;

    that global_callbacks looks strange.
    I would remove the static declaration in client.c line 64 :
    static sasl_global_callbacks_t global_callbacks;
    as I suppose that global_callbacks is shared between client.c and server.c.

  2. 2 Elliott Harris

    I love you, Adium thanks you.

Leave a Reply